Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.m2e.core')
-rw-r--r--org.eclipse.m2e.core/mdo/lifecycle-mapping-metadata-model.xml8
-rw-r--r--org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java6
2 files changed, 9 insertions, 5 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 c7b76018..791b62f1 100644
--- a/org.eclipse.m2e.core/mdo/lifecycle-mapping-metadata-model.xml
+++ b/org.eclipse.m2e.core/mdo/lifecycle-mapping-metadata-model.xml
@@ -233,13 +233,15 @@
<codeSegment>
<code><![CDATA[
public org.eclipse.m2e.core.lifecyclemapping.model.PluginExecutionAction getAction() {
- org.codehaus.plexus.util.xml.Xpp3Dom actionDom = ((org.codehaus.plexus.util.xml.Xpp3Dom) getActionDom()).getChild(0);
- return org.eclipse.m2e.core.lifecyclemapping.model.PluginExecutionAction.valueOf(actionDom.getName());
+ org.codehaus.plexus.util.xml.Xpp3Dom actionDom = (org.codehaus.plexus.util.xml.Xpp3Dom) getActionDom();
+ org.codehaus.plexus.util.xml.Xpp3Dom childDom = actionDom == null ? null : actionDom.getChild(0);
+ if(childDom == null) return org.eclipse.m2e.core.lifecyclemapping.model.PluginExecutionAction.configurator;
+ return org.eclipse.m2e.core.lifecyclemapping.model.PluginExecutionAction.valueOf(childDom.getName());
}
public org.codehaus.plexus.util.xml.Xpp3Dom getConfiguration() {
org.codehaus.plexus.util.xml.Xpp3Dom actionDom = ((org.codehaus.plexus.util.xml.Xpp3Dom) getActionDom());
- return actionDom.getChild(0);
+ return actionDom == null ? null : actionDom.getChild(0);
}
private transient LifecycleMappingMetadataSource source;
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 93f12331..ad3d3222 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
@@ -895,7 +895,8 @@ public class LifecycleMappingFactory {
}
public static String getProjectConfiguratorId(IPluginExecutionMetadata metadata) {
- Xpp3Dom child = ((PluginExecutionMetadata) metadata).getConfiguration().getChild(ATTR_ID);
+ Xpp3Dom configuration = ((PluginExecutionMetadata) metadata).getConfiguration();
+ Xpp3Dom child = configuration == null ? null : configuration.getChild(ATTR_ID);
if(child == null || child.getValue().trim().length() == 0) {
throw new LifecycleMappingConfigurationException("A configurator id must be specified");
}
@@ -903,7 +904,8 @@ public class LifecycleMappingFactory {
}
public static String getActionMessage(IPluginExecutionMetadata metadata) {
- Xpp3Dom child = ((PluginExecutionMetadata) metadata).getConfiguration().getChild(ELEMENT_MESSAGE);
+ Xpp3Dom configuration = ((PluginExecutionMetadata) metadata).getConfiguration();
+ Xpp3Dom child = configuration == null ? null : configuration.getChild(ELEMENT_MESSAGE);
if(child == null || child.getValue().trim().length() == 0) {
return null;
}

Back to the top