Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFred Bricon2015-08-18 19:50:30 -0400
committerFred Bricon2015-08-18 19:50:30 -0400
commit0b8baa3b0f29887eb1725419b9ffcc05b91ea50b (patch)
treef291d233ac831394b281c22c9a036fe1e3e8cc92 /org.eclipse.m2e.core
parent94bbfb79da37462020103af4569eed16978728cc (diff)
downloadm2e-core-0b8baa3b0f29887eb1725419b9ffcc05b91ea50b.tar.gz
m2e-core-0b8baa3b0f29887eb1725419b9ffcc05b91ea50b.tar.xz
m2e-core-0b8baa3b0f29887eb1725419b9ffcc05b91ea50b.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>
Diffstat (limited to 'org.eclipse.m2e.core')
-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