Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Leske2014-02-28 09:37:57 -0500
committerIgor Fedorenko2014-03-15 09:48:21 -0400
commit98028eb929dd76ddb00f5500dab5d9506b523ca2 (patch)
tree7b119d734ac01f79322970ae4f7a9685bcbd40da
parentf382eb623672cbb8fb7359e498b51858e784be3a (diff)
downloadm2e-core-98028eb929dd76ddb00f5500dab5d9506b523ca2.tar.gz
m2e-core-98028eb929dd76ddb00f5500dab5d9506b523ca2.tar.xz
m2e-core-98028eb929dd76ddb00f5500dab5d9506b523ca2.zip
347602 Exception with error message instead of NPE when pluginExectionFilter entry is missing required elements.
Signed-off-by: Sebastian Leske <sebastian.leske@sleske.name>
-rw-r--r--org.eclipse.m2e.core/mdo/lifecycle-mapping-metadata-model.xml9
1 files changed, 9 insertions, 0 deletions
diff --git a/org.eclipse.m2e.core/mdo/lifecycle-mapping-metadata-model.xml b/org.eclipse.m2e.core/mdo/lifecycle-mapping-metadata-model.xml
index ce8a4995..c7b76018 100644
--- a/org.eclipse.m2e.core/mdo/lifecycle-mapping-metadata-model.xml
+++ b/org.eclipse.m2e.core/mdo/lifecycle-mapping-metadata-model.xml
@@ -163,11 +163,20 @@
}
}
+ private void checkAllFieldsSet() {
+ if (groupId==null || artifactId==null || versionRange==null || goals==null || goals.isEmpty() ){
+ throw new IllegalArgumentException(
+ "Missing parameter for pluginExecutionFilter. " +
+ "groupId, artifactId, versionRange and goals must be specificed, but found: "+this);
+ }
+ }
+
/**
* Returns true if mojoExecution matches this key or false otherwise. This method does not consider mojo execution
* parameters.
*/
public boolean match(org.eclipse.m2e.core.project.configurator.MojoExecutionKey mojoExecution) {
+ checkAllFieldsSet();
if(!getGroupId().equals(mojoExecution.getGroupId()) || !getArtifactId().equals(mojoExecution.getArtifactId())) {
return false;
}

Back to the top