Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2015-08-18 19:50:30 -0400
committerFred Bricon2015-08-18 19:51:40 -0400
commitcf480e038e35cb90c070c2991ad904a3e88733cc (patch)
tree5aaa8c8c217f395b4790601f3030955bf12aa07c
parent59bd399506b9e53648efcafda93809e06fe8819f (diff)
downloadm2e-core-cf480e038e35cb90c070c2991ad904a3e88733cc.tar.gz
m2e-core-cf480e038e35cb90c070c2991ad904a3e88733cc.tar.xz
m2e-core-cf480e038e35cb90c070c2991ad904a3e88733cc.zip
371618 : fix NPE when lifecycle-mapping plugin version is set in parent pom
Change-Id: Ib7a4a638e52435875380d5a7e14f78f99f3d7229 Signed-off-by: Fred Bricon <fbricon@gmail.com>
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java
index 4cf2a1ee..34fbd5f5 100644
--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java
+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java
@@ -1009,11 +1009,15 @@ public class LifecycleMappingFactory {
}
private static void checkCompatibleVersion(Plugin metadataPlugin) {
- ComparableVersion version = new ComparableVersion(metadataPlugin.getVersion());
+ String v = metadataPlugin.getVersion();
+ if(v == null) {
+ return; //TODO doesn't inherit version from parent, so we can't check the value
+ }
+ ComparableVersion version = new ComparableVersion(v);
if(!version.equals(new ComparableVersion(LIFECYCLE_MAPPING_PLUGIN_VERSION))) {
SourceLocation location = SourceLocationHelper.findLocation(metadataPlugin, SourceLocationHelper.VERSION);
- throw new LifecycleMappingConfigurationException(NLS.bind(Messages.LifecycleMappingPluginVersionIncompatible,
- metadataPlugin.getVersion()), location);
+ throw new LifecycleMappingConfigurationException(
+ NLS.bind(Messages.LifecycleMappingPluginVersionIncompatible, metadataPlugin.getVersion()), location);
}
}

Back to the top