This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to annotated tag maven-launchpad-plugin-2.1.2
in repository 
https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git

commit bce914dde6ea6e425cca164d3b0b2c71248216e7
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Mon Dec 19 11:36:09 2011 +0000

    SLING-2332 : Partial bundle list should be attachable to any maven project
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1220697
 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/maven/projectsupport/AttachBundleListMojo.java     |  6 +-----
 .../maven/projectsupport/AttachPartialBundleListMojo.java    | 12 +++++++++++-
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java 
b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
index ea21b3a..a64d84f 100644
--- 
a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
+++ 
b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
@@ -38,10 +38,6 @@ import org.codehaus.plexus.util.FileUtils;
  */
 public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
 
-    private static final String CLASSIFIER = "bundlelist";
-
-    private static final String TYPE = "xml";
-
     /**
      * @parameter default-value="${project.build.directory}/bundleList.xml"
      */
@@ -67,7 +63,7 @@ public class AttachBundleListMojo extends 
AbstractUsingBundleListMojo {
         try {
             fw = new FileWriter(outputFile);
             writer.write(fw, getInitializedBundleList());
-            projectHelper.attachArtifact(project, TYPE, CLASSIFIER, 
outputFile);
+            projectHelper.attachArtifact(project, 
AttachPartialBundleListMojo.TYPE, AttachPartialBundleListMojo.CLASSIFIER, 
outputFile);
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to output effective 
bundle list", e);
         } finally {
diff --git 
a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
 
b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
index 64c519b..aa2dcd3 100644
--- 
a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ 
b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -46,6 +46,10 @@ public class AttachPartialBundleListMojo extends 
AbstractBundleListMojo {
 
     public static final String CONFIG_TYPE = "zip";
 
+    public static final String CLASSIFIER = "bundlelist";
+
+    public static final String TYPE = "xml";
+
     public static final String SLING_COMMON_PROPS = "common.properties";
 
     public static final String SLING_COMMON_BOOTSTRAP = "common.bootstrap.txt";
@@ -100,7 +104,13 @@ public class AttachPartialBundleListMojo extends 
AbstractBundleListMojo {
             throw new MojoExecutionException("Unable to write bundle list", e);
         }
 
-        project.getArtifact().setFile(bundleListOutput);
+        // if this project is a partial bundle list, it's the main artifact
+        if ( project.getPackaging().equals(PARTIAL) ) {
+            project.getArtifact().setFile(bundleListOutput);
+        } else {
+            // otherwise attach it as an additional artifact
+            projectHelper.attachArtifact(project, TYPE, CLASSIFIER, 
bundleListOutput);
+        }
 
         this.getLog().info("Attaching bundle list configuration");
         try {

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to