Applied patch (FELIX-269) to avoid running the plugin on pom projects.
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@533166 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java b/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
index 462ed87..1cd40ff 100644
--- a/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
+++ b/tools/maven2/maven-bundle-plugin/src/main/java/org/apache/felix/tools/maven2/bundleplugin/BundlePlugin.java
@@ -49,6 +49,8 @@
/** pattern that matches strings that contain only numbers */
private static final Pattern ONLY_NUMBERS = Pattern.compile("[0-9]+");
+ private static final Collection SUPPORTED_PROJECT_TYPES = Arrays.asList(new String[]{"jar","osgi-bundle"});
+
/**
* @parameter expression="${project.build.outputDirectory}"
* @required
@@ -99,6 +101,12 @@
header(properties, Analyzer.INCLUDE_RESOURCE, "src/main/resources/");
}
+ /* ignore project types not supported, useful when the plugin is configured in the parent pom */
+ if (!SUPPORTED_PROJECT_TYPES.contains(getProject().getArtifact().getType())) {
+ getLog().debug("Ignoring project " + getProject().getArtifact() + " : type not supported by bundle plugin");
+ return;
+ }
+
execute(project, instructions, properties);
}