You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by cz...@apache.org on 2012/06/28 17:20:55 UTC

svn commit: r1355041 - /felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java

Author: cziegeler
Date: Thu Jun 28 15:20:54 2012
New Revision: 1355041

URL: http://svn.apache.org/viewvc?rev=1355041&view=rev
Log:
FELIX-3555 : Maven SCR Plugin shoudln't attempt to run on modules of type POM

Modified:
    felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java

Modified: felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java
URL: http://svn.apache.org/viewvc/felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java?rev=1355041&r1=1355040&r2=1355041&view=diff
==============================================================================
--- felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java (original)
+++ felix/trunk/scrplugin/maven-scr-plugin/src/main/java/org/apache/felix/scrplugin/mojo/SCRDescriptorMojo.java Thu Jun 28 15:20:54 2012
@@ -23,6 +23,7 @@ import java.io.IOException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -158,7 +159,24 @@ public class SCRDescriptorMojo extends A
      */
     private String specVersion;
 
+    /**
+     * Project types which this plugin supports.
+     *
+     * @parameter
+     */
+    protected List<String> supportedProjectTypes = Arrays.asList( new String[]
+        { "jar", "bundle" } );
+
     public void execute() throws MojoExecutionException, MojoFailureException {
+        final String projectType = project.getArtifact().getType();
+
+        // ignore unsupported project types, useful when bundleplugin is configured in parent pom
+        if ( !supportedProjectTypes.contains( projectType ) ) {
+            getLog().debug(
+                "Ignoring project type " + projectType + " - supportedProjectTypes = " + supportedProjectTypes );
+            return;
+        }
+
         // create the log for the generator
         final org.apache.felix.scrplugin.Log scrLog = new MavenLog(getLog());