You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:16:12 UTC

[sling-maven-launchpad-plugin] annotated tag maven-launchpad-plugin-2.1.2 created (now a7f0a07)

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

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


      at a7f0a07  (tag)
 tagging ac6aff2b5ca51911409142c235776884fa7e9b7b (commit)
      by Carsten Ziegeler
      on Wed Aug 15 13:17:52 2012 +0000

- Log -----------------------------------------------------------------
maven-launchpad-plugin-2.1.2
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new 96dc6d5  Introducing the maven-launchpad-plugin and builder (fka uber) project described in SLING-1197
     new ff6a77c  SLING-1310 - Changing artifactId of launchpad.builder to launchpad
     new 1f5bd24  SLING-1322 - adding check to avoid loading launchpad artifact if it's the same as the current project's
     new 347e5fb  SLING-1322 - removing extraneous project variable
     new b8899de  SLING-1323 - adding "bundlesToRemove" option
     new 5682b2d  Unifying bundle addition / removal code (re: SLING-1321)
     new bb29c9b  SLING-1351 Fixed, added the Start levels in when there are none defined.
     new 8ffdfb1  SLING-1364 - creating prepare-test-webapp mojo
     new d2e7962  SLING-1351 When the xpp parser loads a Bundle it only sets the attributes specified on the bundle, and takes no account of any containers, hence on merge the container start level must be inspected to determine where a bundle should be merged. If not specified (ie 0) it should be merged in the containing bundle. This means that its not going to be possible to specify a bundle as loading in start level 0 by setting the level on the bundle. To load in start level 0 you mus [...]
     new 8c0ec78  SLING-1441 - adding run goal to launchpad plugin
     new b3f5ef2  SLING-1454 - adding ability to read filtered sling properties from a file
     new df85fd6  SLING-1442 - adding start and stop goals to launchpad plugin
     new 74b72b9  exposing controlHost configuration parameter in launchpad plugin
     new 99ee468  fix formatting of pom file
     new 9768cfb  SLING-1442 - shouldn't be killing the JVM on a "stop" command.
     new dd65aa8  SLING-1491 - switching from pax web to felix httpservice
     new eb5e840  updating to released launchpad base
     new 2183492  reformatting pom
     new cc7a04f  [maven-release-plugin] prepare release maven-launchpad-plugin-2.0.6
     new d69b5db  [maven-release-plugin] prepare for next development iteration
     new 2e9d194  using next snapshot until release vote is finished
     new e75b100  Update some notice files
     new 2551177  Use released version of launchpad base
     new 917e990  Use released parent pom.
     new c6c90d7  SLING-1586 - adding overwrite version on merge code
     new 99e00dc  SLING-1591 - upgrading to latest base artifacts
     new c52ad9c  SLING-1692 - replacing dummy code for updated() method.
     new 2945145  SLING-1693 - adding xml as a resource provider provided extension
     new 42035b5  changing classname and adding missing license header
     new 119f700  SLING-1693 - implemeting a search path for resources
     new b508767  SLING-1743 / SLING-845 - setting slingHome to default to ${basedir}/sling. No longer need the antrun execution as a result
     new ea8d50e  SLING-1799 - adding output-bundle-list mojo
     new d05a0b4  tabs -> spaces
     new f300177  SLING-1795 - adding Drools-based rules for rewriting bundle list. Includes sample rule which can be activated by running "mvn -P test-reactor-sling-bundles clean install" from the root project.
     new cbb45d4  updating all modules to parent 10-SNAPSHOT in anticipation of emma additions to parent
     new 25154c3  adding jboss repository (for drools dependencies)
     new 793fe22  trivial improvement in error handling
     new 85a3ca6  SLING-1803 - adding emma report. runs with -P emma
     new 3106d97  SLING-1843 - adding launchpad:display-bundle-updates goal
     new c31bbfa  Update to recent snapshots
     new bad22bd  prepping maven-launchpad-plugin for release
     new 63eaf6e  [maven-release-plugin] prepare release maven-launchpad-plugin-2.0.8
     new 9fd2bdb  [maven-release-plugin] prepare for next development iteration
     new 61f3f68  SLING-1597 - adding config installation via launchpad
     new c0518da  removing LICENSE and NOTICE files for future releases
     new ede6563  SLING-1980 - fixing by adding some code as described by Benjamin on maven-users
     new f33d169  updating pom pre-release
     new 64e03a1  [maven-release-plugin] prepare release maven-launchpad-plugin-2.0.10
     new 6cec043  [maven-release-plugin] prepare for next development iteration
     new c80a1cc  using snapshots during vote
     new d8dc15d  Temporarily upgrade to 1.0.1-SNAPSHOT of the launchpad API to not fail builds
     new 8c84089  SLING-1988 - removing errant files
     new 2cddbb6  removing empty dir
     new b751260  SLING-2105 - initial implementation of partial bundle lists
     new f23f3d6  Code  cleanup - remove unused stuff.
     new d8c44e2  Code  cleanup - remove unused stuff.
     new 67eb316  SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
     new 79e6e41  SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
     new 2d6b5a8  SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
     new cb3b66f  SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
     new 0a616ce  SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
     new 2fc71ae  Remove unused code
     new d72004a  SLING-2134 : Provide a way to add additional properties to sling.properties
     new 5039e0f  SLING-2135 : Copying of resources should respect default includes
     new 13dad4c  SLING-2134 : Provide a way to add additional properties to sling.properties
     new 98a09a7  SLING-2150 : Update plugins to use the latest available versions
     new a0121dc  Update to recent snapshot
     new 893c07a  Update to recent snapshot
     new 917e094  Using latest released parent pom
     new ba156ae  SLING-2182 : Provide a way to specify additional bootstrap commands
     new 934711b  SLING-2182 : Provide a way to specify additional bootstrap commands
     new 97dac9a  SLING-2183 : Bundle configurations and sling files with bundlelist
     new 0f6d05c  Using released versions
     new dff0438  SLING-2134 : Provide a way to add additional properties to sling.properties SLING-2182 : Provide a way to specify additional bootstrap commands
     new f1a9178  SLING-2182 : Provide a way to specify additional bootstrap commands
     new a35a90d  SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
     new 179cc9b  temporarily using snapshots during release vote
     new 02a8aea  SLING-2207 : Support different properties and bootstrap commands for standalone and webapp
     new 44145b7  SLING-2207 : Support different properties and bootstrap commands for standalone and webapp
     new 3b2fc20  Prepare for release
     new 3325362  [maven-release-plugin] prepare release maven-launchpad-plugin-2.1.0
     new f02592e  [maven-release-plugin] prepare for next development iteration
     new 4b57990  Use latest snapshot after release
     new d32ced5  using latest releases
     new 1a827c3  SLING-2212 : When merging bundle lists, the highest version should win
     new bc03898  SLING-2238 - doing property interpolation on bundle list
     new 6a0e12a  SLING-2241 - AbstractLaunchpadStartingMojo uses protected fields from parent class
     new b497a89  SLING-2194 - generating bundle list content from a project's dependencies; refactoring testing projects to use this feature.
     new c2c4f2f  SLING-2263 - validating partial bundle lists during their lifecycle
     new 52fb200  trivial formatting and field name change
     new eb65f0b  SLING-2264 - add option to set includeDefaultBundles on command line
     new 69e8764  SLING-2265 - adding maven-dependency-plugin style option includeDepenencies
     new e0008c4  SLING-2273 - implementing a LifecycleParticipant which adds bundle list contents as dependencies
     new 5d54df5  SLING-2292 - dependencies added by LaunchpadPluginLifecycleParticipant should be of scope provided
     new c3a7120  SLING-2310 : Attach bundle list goal should also add configuration artifact
     new 52f90be  SLING-2203 : Allow for better configuration of sling home folder
     new 5deee11  SLING-2331 : Values in partial bundle list should be interpolated Maven style
     new bce914d  SLING-2332 : Partial bundle list should be attachable to any maven project
     new 210d0d4  SLING-2194 : generate a partial bundle list from a project's dependencies SLING-2265 : maven-launchpad-plugin should support a syntax similar to the maven-dependency-plugin
     new 92b1ba9  SLING-2263 - no longer need to validate bundle lists as SLING-2273 handles that now.
     new 802751b  removing unused code
     new bb6cf72  SLING-2194 - fail the build if a bundle list isn't available as this is now the only way to define a partial bundle list.
     new 023486f  SLING-2386 : It should be possible to remove bundles from an inherited partial bundle list. Apply patch from Timo Naroska
     new 5099e0e  SLING-2434 - upgrding to Drools 2.3.1.Final as that's in Maven Central
     new 29f1677  SLING-2480 : Add config for maven-sling-plugin to m2e configuration
     new 54d5e7f  Update to latest parent pom
     new d3b3dde  Use released versions
     new 2165db9  Use released version instead of older snapshot
     new 069d580  [maven-release-plugin] prepare release maven-launchpad-plugin-2.1.2
     new ac6aff2  [maven-release-plugin]  copy for tag maven-launchpad-plugin-2.1.2

The 110 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


-- 
To stop receiving notification emails like this one, please contact
['"commits@sling.apache.org" <co...@sling.apache.org>'].

[sling-maven-launchpad-plugin] 06/29: SLING-2241 - AbstractLaunchpadStartingMojo uses protected fields from parent class

Posted by ro...@apache.org.
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 6a0e12abbbabc9ebff09e0b02fa6aa2b8c4448f1
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Oct 7 19:14:15 2011 +0000

    SLING-2241 - AbstractLaunchpadStartingMojo uses protected fields from parent class
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1180166 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/AbstractLaunchpadStartingMojo.java      | 14 --------------
 .../maven/projectsupport/AbstractUsingBundleListMojo.java  |  2 +-
 2 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
index 9da0201..2cf52d5 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -36,9 +36,7 @@ import java.util.Set;
 
 import org.apache.felix.framework.Logger;
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.shared.filtering.MavenFileFilter;
 import org.apache.maven.shared.filtering.MavenFilteringException;
 import org.apache.maven.shared.filtering.PropertyUtils;
 import org.apache.sling.launchpad.api.LaunchpadContentProvider;
@@ -105,18 +103,6 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
      */
     private File resourceProviderRoot;
 
-    /**
-     * @component
-     */
-    private MavenFileFilter mavenFileFilter;
-
-    /**
-     * @parameter expression="${session}"
-     * @required
-     * @readonly
-     */
-    private MavenSession mavenSession;
-
     private LaunchpadContentProvider resourceProvider = new LaunchpadContentProvider() {
 
         public Iterator<String> getChildren(String path) {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 75bceb5..b6fc886 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -175,7 +175,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
     /**
      * @component
      */
-    private MavenFileFilter mavenFileFilter;
+    protected MavenFileFilter mavenFileFilter;
 
     /**
      * The zip unarchiver.

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 11/29: SLING-2265 - adding maven-dependency-plugin style option includeDepenencies

Posted by ro...@apache.org.
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 69e876402c0f7929637b74721e4db531330eb449
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Nov 4 20:46:12 2011 +0000

    SLING-2265 - adding maven-dependency-plugin style option includeDepenencies
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1197759 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |   7 +-
 .../projectsupport/AbstractBundleListMojo.java     |  35 ++++-
 .../maven/projectsupport/AttachBundleListMojo.java |   1 +
 .../AttachPartialBundleListMojo.java               |   1 +
 .../CheckBundleListForSnapshotsMojo.java           |   1 +
 .../projectsupport/ConfigurationStartLevel.java    | 166 +++++++++++++++++++++
 .../CreateKarafFeatureDescriptorMojo.java          |   1 +
 .../maven/projectsupport/OutputBundleListMojo.java |   1 +
 8 files changed, 210 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3265d3d..d61c403 100644
--- a/pom.xml
+++ b/pom.xml
@@ -108,7 +108,6 @@
             <artifactId>maven-archiver</artifactId>
             <version>2.0</version>
         </dependency>
-
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-archiver</artifactId>
@@ -124,6 +123,12 @@
                 </exclusion>
             </exclusions>
         </dependency>
+        <!-- using utility classes from this plugin -->
+        <dependency>
+            <groupId>org.apache.maven.plugins</groupId>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.3</version>
+        </dependency>
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-utils</artifactId>
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index bd5e788..54d402a 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Properties;
+import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -41,6 +42,7 @@ import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
 import org.apache.maven.settings.Settings;
+import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
@@ -66,8 +68,13 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
     protected File bundleListFile;
 
     /**
+     * @parameter
+     */
+    private ConfigurationStartLevel[] includeDependencies;
+
+    /**
      * The Maven project.
-     *
+     * 
      * @parameter expression="${project}"
      * @required
      * @readonly
@@ -195,7 +202,16 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
     }
 
     @SuppressWarnings("unchecked")
-    protected void addDependencies(final BundleList bundleList) {
+    protected void addDependencies(final BundleList bundleList) throws MojoExecutionException {
+        if (includeDependencies != null) {
+            for (ConfigurationStartLevel startLevel : includeDependencies) {
+                Set<Artifact> artifacts = getArtifacts(startLevel);
+                for (Artifact artifact : artifacts) {
+                    bundleList.add(ArtifactDefinition.toBundle(artifact, startLevel.getLevel()));
+                }
+            }
+        }
+
         if (dependencyStartLevel >= 0) {
             final List<Dependency> dependencies = project.getDependencies();
             for (Dependency dependency : dependencies) {
@@ -206,6 +222,21 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
         }
     }
 
+    @SuppressWarnings("unchecked")
+    private Set<Artifact> getArtifacts(ConfigurationStartLevel startLevel) throws MojoExecutionException {
+        // start with all artifacts.
+        Set<Artifact> artifacts = project.getArtifacts();
+
+        // perform filtering
+        try {
+            artifacts = startLevel.buildFilter(project).filter(artifacts);
+        } catch (ArtifactFilterException e) {
+            throw new MojoExecutionException(e.getMessage(), e);
+        }
+        
+        return artifacts;
+    }
+
     protected void interpolateProperties(BundleList bundleList) throws MojoExecutionException {
         Interpolator interpolator = createInterpolator();
         for (final StartLevel sl : bundleList.getStartLevels()) {
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 9cebe53..e7d9977 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
@@ -29,6 +29,7 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleLis
  *
  * @goal attach-bundle-list
  * @phase package
+ * @requiresDependencyResolution test
  * @description attach the bundle list as a project artifact
  */
 public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
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 3c34afa..470aef0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -34,6 +34,7 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
  *
  * @goal attach-partial-bundle-list
  * @phase package
+ * @requiresDependencyResolution test
  * @description attach the partial bundle list as a project artifact
  */
 public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
index aeebc61..59e92cf 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
@@ -30,6 +30,7 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
  * to SNAPSHOT versions.
  *
  * @goal check-bundle-list-for-snapshots
+ * @requiresDependencyResolution test
  *
  */
 public class CheckBundleListForSnapshotsMojo extends AbstractUsingBundleListMojo {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ConfigurationStartLevel.java b/src/main/java/org/apache/sling/maven/projectsupport/ConfigurationStartLevel.java
new file mode 100644
index 0000000..dd41fcd
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ConfigurationStartLevel.java
@@ -0,0 +1,166 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.sling.maven.projectsupport;
+
+import org.apache.maven.plugin.dependency.utils.DependencyUtil;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.artifact.filter.collection.ArtifactIdFilter;
+import org.apache.maven.shared.artifact.filter.collection.ClassifierFilter;
+import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts;
+import org.apache.maven.shared.artifact.filter.collection.GroupIdFilter;
+import org.apache.maven.shared.artifact.filter.collection.ProjectTransitivityFilter;
+import org.apache.maven.shared.artifact.filter.collection.ScopeFilter;
+import org.apache.maven.shared.artifact.filter.collection.TypeFilter;
+
+public class ConfigurationStartLevel {
+    
+    private int level;
+
+    private String includeTypes;
+
+    private String excludeTypes;
+
+    private String includeScope;
+
+    private String excludeScope;
+
+    private String includeClassifiers;
+
+    private String excludeClassifiers;
+
+    private String excludeArtifactIds;
+
+    private String includeArtifactIds;
+
+    private String excludeGroupIds;
+
+    private String includeGroupIds;
+
+    public int getLevel() {
+        return level;
+    }
+
+    public void setLevel(int level) {
+        this.level = level;
+    }
+
+    public String getIncludeTypes() {
+        return includeTypes;
+    }
+
+    public void setIncludeTypes(String includeTypes) {
+        this.includeTypes = includeTypes;
+    }
+
+    public String getExcludeTypes() {
+        return excludeTypes;
+    }
+
+    public void setExcludeTypes(String excludeTypes) {
+        this.excludeTypes = excludeTypes;
+    }
+
+    public String getIncludeScope() {
+        return includeScope;
+    }
+
+    public void setIncludeScope(String includeScope) {
+        this.includeScope = includeScope;
+    }
+
+    public String getExcludeScope() {
+        return excludeScope;
+    }
+
+    public void setExcludeScope(String excludeScope) {
+        this.excludeScope = excludeScope;
+    }
+
+    public String getIncludeClassifiers() {
+        return includeClassifiers;
+    }
+
+    public void setIncludeClassifiers(String includeClassifiers) {
+        this.includeClassifiers = includeClassifiers;
+    }
+
+    public String getExcludeClassifiers() {
+        return excludeClassifiers;
+    }
+
+    public void setExcludeClassifiers(String excludeClassifiers) {
+        this.excludeClassifiers = excludeClassifiers;
+    }
+
+    public String getExcludeArtifactIds() {
+        return excludeArtifactIds;
+    }
+
+    public void setExcludeArtifactIds(String excludeArtifactIds) {
+        this.excludeArtifactIds = excludeArtifactIds;
+    }
+
+    public String getIncludeArtifactIds() {
+        return includeArtifactIds;
+    }
+
+    public void setIncludeArtifactIds(String includeArtifactIds) {
+        this.includeArtifactIds = includeArtifactIds;
+    }
+
+    public String getExcludeGroupIds() {
+        return excludeGroupIds;
+    }
+
+    public void setExcludeGroupIds(String excludeGroupIds) {
+        this.excludeGroupIds = excludeGroupIds;
+    }
+
+    public String getIncludeGroupIds() {
+        return includeGroupIds;
+    }
+
+    public void setIncludeGroupIds(String includeGroupIds) {
+        this.includeGroupIds = includeGroupIds;
+    }
+
+    public FilterArtifacts buildFilter(MavenProject project) {
+        // add filters in well known order, least specific to most specific
+        FilterArtifacts filter = new FilterArtifacts();
+
+        filter.addFilter(new ProjectTransitivityFilter(project.getDependencyArtifacts(), true));
+
+        filter.addFilter(new ScopeFilter(DependencyUtil.cleanToBeTokenizedString(this.includeScope), DependencyUtil
+                .cleanToBeTokenizedString(this.excludeScope)));
+
+        filter.addFilter(new TypeFilter(DependencyUtil.cleanToBeTokenizedString(this.includeTypes), DependencyUtil
+                .cleanToBeTokenizedString(this.excludeTypes)));
+
+        filter.addFilter(new ClassifierFilter(DependencyUtil.cleanToBeTokenizedString(this.includeClassifiers),
+                DependencyUtil.cleanToBeTokenizedString(this.excludeClassifiers)));
+
+        filter.addFilter(new GroupIdFilter(DependencyUtil.cleanToBeTokenizedString(this.includeGroupIds),
+                DependencyUtil.cleanToBeTokenizedString(this.excludeGroupIds)));
+
+        filter.addFilter(new ArtifactIdFilter(DependencyUtil.cleanToBeTokenizedString(this.includeArtifactIds),
+                DependencyUtil.cleanToBeTokenizedString(this.excludeArtifactIds)));
+        return filter;
+    }
+    
+    
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
index f66b60b..504d9cd 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
@@ -36,6 +36,7 @@ import org.jdom.output.XMLOutputter;
  * @goal create-karaf-descriptor
  * @phase package
  * @description create a karaf feature descriptor
+ * @requiresDependencyResolution test
  */
 public class CreateKarafFeatureDescriptorMojo extends AbstractUsingBundleListMojo {
 
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
index a1e5b67..31d0523 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
@@ -27,6 +27,7 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleLis
  * Output the bundle list back to the console.
  * 
  * @goal output-bundle-list
+ * @requiresDependencyResolution test
  * 
  */
 public class OutputBundleListMojo extends AbstractUsingBundleListMojo {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 12/29: SLING-2273 - implementing a LifecycleParticipant which adds bundle list contents as dependencies

Posted by ro...@apache.org.
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 e0008c40a0c1fda7888f2c8fcabed924dcb8829a
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Nov 15 04:45:09 2011 +0000

    SLING-2273 - implementing a LifecycleParticipant which adds bundle list contents as dependencies
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1202041 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  63 +++++-
 .../projectsupport/AbstractBundleListMojo.java     |  71 +------
 .../AbstractUsingBundleListMojo.java               | 152 +++++++-------
 .../maven/projectsupport/ArtifactDefinition.java   |  29 ++-
 .../AttachPartialBundleListMojo.java               |   1 +
 .../maven/projectsupport/BundleListUtils.java      | 154 ++++++++++++++
 .../maven/projectsupport/CreateBundleJarMojo.java  |   1 -
 .../projectsupport/DisplayBundleUpdatesMojo.java   |   4 +-
 .../LaunchpadPluginLifecycleParticipant.java       | 230 +++++++++++++++++++++
 .../projectsupport/ValidateBundleListMojo.java     |   4 +-
 10 files changed, 560 insertions(+), 149 deletions(-)

diff --git a/pom.xml b/pom.xml
index d61c403..7560e23 100644
--- a/pom.xml
+++ b/pom.xml
@@ -74,6 +74,20 @@
                     </filters>
                 </configuration>
             </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.plexus</groupId>
+                <artifactId>plexus-component-metadata</artifactId>
+                <version>1.5.5</version>
+                <executions>
+                    <execution>
+                        <id>generate-metadata</id>
+                        <goals>
+                            <goal>generate-metadata</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 
@@ -98,15 +112,20 @@
     </reporting>
 
     <dependencies>
+       <dependency>
+           <groupId>org.apache.maven</groupId>
+           <artifactId>maven-core</artifactId>
+           <version>3.0</version>
+       </dependency>
+       <dependency>
+           <groupId>org.apache.maven</groupId>
+           <artifactId>maven-compat</artifactId>
+           <version>3.0</version>
+       </dependency>
         <dependency>
             <groupId>org.apache.maven</groupId>
             <artifactId>maven-plugin-api</artifactId>
-            <version>2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.maven</groupId>
-            <artifactId>maven-archiver</artifactId>
-            <version>2.0</version>
+            <version>3.0</version>
         </dependency>
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
@@ -128,6 +147,16 @@
             <groupId>org.apache.maven.plugins</groupId>
             <artifactId>maven-dependency-plugin</artifactId>
             <version>2.3</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>maven-project</artifactId>
+                    <groupId>org.apache.maven</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>maven-artifact-manager</artifactId>
+                    <groupId>org.apache.maven</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
@@ -164,11 +193,23 @@
             <groupId>org.apache.maven.shared</groupId>
             <artifactId>maven-filtering</artifactId>
             <version>1.0</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>maven-project</artifactId>
+                    <groupId>org.apache.maven</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.apache.maven.shared</groupId>
             <artifactId>maven-osgi</artifactId>
             <version>0.2.0</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>maven-project</artifactId>
+                    <groupId>org.apache.maven</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.drools</groupId>
@@ -179,6 +220,16 @@
             <groupId>org.codehaus.mojo</groupId>
             <artifactId>versions-maven-plugin</artifactId>
             <version>1.2</version>
+            <exclusions>
+                <exclusion>
+                    <artifactId>maven-project</artifactId>
+                    <groupId>org.apache.maven</groupId>
+                </exclusion>
+                <exclusion>
+                    <artifactId>maven-artifact-manager</artifactId>
+                    <groupId>org.apache.maven</groupId>
+                </exclusion>
+            </exclusions>
         </dependency>
     </dependencies>
 
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index 54d402a..7119c21 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -17,11 +17,7 @@
 package org.apache.sling.maven.projectsupport;
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Arrays;
 import java.util.List;
-import java.util.Properties;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
@@ -41,19 +37,9 @@ import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
-import org.apache.maven.settings.Settings;
 import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
-import org.codehaus.plexus.interpolation.InterpolationException;
-import org.codehaus.plexus.interpolation.Interpolator;
-import org.codehaus.plexus.interpolation.PrefixedObjectValueSource;
-import org.codehaus.plexus.interpolation.PropertiesBasedValueSource;
-import org.codehaus.plexus.interpolation.StringSearchInterpolator;
 import org.codehaus.plexus.util.StringUtils;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 public abstract class AbstractBundleListMojo extends AbstractMojo {
 
@@ -178,7 +164,7 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
      * @readonly
      * @required
      */
-    private List<?> remoteRepos;
+    private List<ArtifactRepository> remoteRepos;
 
     /**
      * Used to look up Artifacts in the remote repository.
@@ -191,17 +177,6 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
         return this.configDirectory;
     }
 
-    protected BundleList readBundleList(File file) throws IOException, XmlPullParserException {
-        BundleListXpp3Reader reader = new BundleListXpp3Reader();
-        FileInputStream fis = new FileInputStream(file);
-        try {
-            return reader.read(fis);
-        } finally {
-            fis.close();
-        }
-    }
-
-    @SuppressWarnings("unchecked")
     protected void addDependencies(final BundleList bundleList) throws MojoExecutionException {
         if (includeDependencies != null) {
             for (ConfigurationStartLevel startLevel : includeDependencies) {
@@ -237,48 +212,6 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
         return artifacts;
     }
 
-    protected void interpolateProperties(BundleList bundleList) throws MojoExecutionException {
-        Interpolator interpolator = createInterpolator();
-        for (final StartLevel sl : bundleList.getStartLevels()) {
-            for (final Bundle bndl : sl.getBundles()) {
-                try {
-                    bndl.setArtifactId(interpolator.interpolate(bndl.getArtifactId()));
-                    bndl.setGroupId(interpolator.interpolate(bndl.getGroupId()));
-                    bndl.setVersion(interpolator.interpolate(bndl.getVersion()));
-                    bndl.setClassifier(interpolator.interpolate(bndl.getClassifier()));
-                    bndl.setType(interpolator.interpolate(bndl.getType()));
-                } catch (InterpolationException e) {
-                    throw new MojoExecutionException("Unable to interpolate properties for bundle " + bndl.toString(), e);
-                }
-            }
-        }
-
-    }
-
-    private Interpolator createInterpolator() {
-        StringSearchInterpolator interpolator = new StringSearchInterpolator();
-
-        final Properties props = new Properties();
-        props.putAll(project.getProperties());
-        props.putAll(mavenSession.getExecutionProperties());
-
-        interpolator.addValueSource(new PropertiesBasedValueSource(props));
-
-        // add ${project.foo}
-        interpolator.addValueSource(new PrefixedObjectValueSource(Arrays.asList("project", "pom"), project, true));
-
-        // add ${session.foo}
-        interpolator.addValueSource(new PrefixedObjectValueSource("session", mavenSession));
-
-        // add ${settings.foo}
-        final Settings settings = mavenSession.getSettings();
-        if (settings != null) {
-            interpolator.addValueSource(new PrefixedObjectValueSource("settings", settings));
-        }
-
-        return interpolator;
-    }
-
     /**
      * Get a resolved Artifact from the coordinates found in the artifact
      * definition.
@@ -318,7 +251,7 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
                 // This code kicks in when the version specifier is a range.
                 if (vr.getRecommendedVersion() == null) {
                     try {
-                        List<?> availVersions = metadataSource.retrieveAvailableVersions(artifact, local, remoteRepos);
+                        List<ArtifactVersion> availVersions = metadataSource.retrieveAvailableVersions(artifact, local, remoteRepos);
                         ArtifactVersion resolvedVersion = vr.matchVersion(availVersions);
                         artifact.setVersion(resolvedVersion.toString());
                     } catch (ArtifactMetadataRetrievalException e) {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 87890da..3f242a4 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -43,6 +43,9 @@ import org.drools.builder.KnowledgeBuilderFactory;
 import org.drools.builder.ResourceType;
 import org.drools.io.ResourceFactory;
 import org.drools.runtime.StatefulKnowledgeSession;
+import org.apache.sling.maven.projectsupport.BundleListUtils.ArtifactDefinitionsCallback;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.readBundleList;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.interpolateProperties;
 
 public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo {
 
@@ -141,6 +144,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
     public final void execute() throws MojoFailureException, MojoExecutionException {
         try {
             initBundleList();
+            extractConfigurations();
         } catch (MojoExecutionException e) {
             throw e;
         } catch (Exception e) {
@@ -183,10 +187,6 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
     protected void initBundleList(BundleList bundleList) {
     }
 
-    protected boolean isCurrentArtifact(ArtifactDefinition def) {
-        return (def.getGroupId().equals(project.getGroupId()) && def.getArtifactId().equals(project.getArtifactId()));
-    }
-
     /**
      * Initialize the artifact definitions using defaults inside the plugin JAR.
      *
@@ -195,22 +195,22 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      * @throws MojoExecutionException
      */
     private final void initArtifactDefinitions() throws IOException {
-        Properties dependencies = new Properties();
-        dependencies.load(getClass().getResourceAsStream(
-                "/org/apache/sling/maven/projectsupport/dependencies.properties"));
-
-        if (defaultBundleList == null) {
-            defaultBundleList = new ArtifactDefinition();
-        }
-        defaultBundleList.initDefaults(dependencies.getProperty("defaultBundleList"));
+        BundleListUtils.initArtifactDefinitions(getClass().getClassLoader(), new ArtifactDefinitionsCallback() {
+            
+            public void initArtifactDefinitions(Properties dependencies) {
+                if (defaultBundleList == null) {
+                    defaultBundleList = new ArtifactDefinition();
+                }
+                defaultBundleList.initDefaults(dependencies.getProperty("defaultBundleList"));
 
-        initArtifactDefinitions(dependencies);
+                AbstractUsingBundleListMojo.this.initArtifactDefinitions(dependencies);
+            }
+        });
     }
 
-    @SuppressWarnings("unchecked")
     private final void initBundleList() throws IOException, XmlPullParserException, MojoExecutionException {
         initArtifactDefinitions();
-        if (isCurrentArtifact(defaultBundleList)) {
+        if (BundleListUtils.isCurrentArtifact(project, defaultBundleList)) {
             initializedBundleList = readBundleList(bundleListFile);
         } else {
             initializedBundleList = new BundleList();
@@ -245,70 +245,84 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                         String.format("merging partial bundle list for %s:%s:%s", artifact.getGroupId(),
                                 artifact.getArtifactId(), artifact.getVersion()));
                 initializedBundleList.merge(readBundleList(artifact.getFile()));
-
-                // check for configuration artifact
-                Artifact cfgArtifact = null;
-                try {
-                    cfgArtifact = getArtifact(artifact.getGroupId(),
-                            artifact.getArtifactId(),
-                            artifact.getVersion(),
-                            AttachPartialBundleListMojo.CONFIG_TYPE,
-                            AttachPartialBundleListMojo.CONFIG_CLASSIFIER);
-                } catch (final MojoExecutionException ignore) {
-                    // we just ignore this
-                }
-                if ( cfgArtifact != null ) {
-                    getLog().info(
-                            String.format("merging partial bundle list configuration for %s:%s:%s", cfgArtifact.getGroupId(),
-                                    cfgArtifact.getArtifactId(), cfgArtifact.getVersion()));
-
-                    // extract
-                    zipUnarchiver.setSourceFile(cfgArtifact.getFile());
-                    try {
-                        this.tmpOutputDir.mkdirs();
-                        zipUnarchiver.setDestDirectory(this.tmpOutputDir);
-                        zipUnarchiver.extract();
-
-                        final File slingDir = new File(this.tmpOutputDir, "sling");
-                        this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_COMMON_PROPS), 0);
-                        this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_WEBAPP_PROPS), 1);
-                        this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_STANDALONE_PROPS), 2);
-                        this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_COMMON_BOOTSTRAP), 0);
-                        this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_WEBAPP_BOOTSTRAP), 1);
-                        this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_STANDALONE_BOOTSTRAP), 2);
-
-                        // and now configurations
-                        if ( this.overlayConfigDir == null ) {
-                            this.tempConfigDir.mkdirs();
-                            if ( this.getConfigDirectory().exists() ) {
-                                FileUtils.copyDirectory(this.getConfigDirectory(), this.tempConfigDir,
-                                        null, FileUtils.getDefaultExcludesAsString());
-                            }
-                            this.overlayConfigDir = this.tempConfigDir;
-                        }
-                        final File configDir = new File(this.tmpOutputDir, "config");
-                        if ( configDir.exists() ) {
-                            FileUtils.copyDirectory(configDir, this.tempConfigDir,
-                                    null, FileUtils.getDefaultExcludesAsString());
-                        }
-                    } catch (final ArchiverException ae) {
-                        throw new MojoExecutionException("Unable to extract configuration archive.",ae);
-                    } finally {
-                        // and delete at the end
-                        FileUtils.deleteDirectory(this.tmpOutputDir);
-                    }
-                }
             }
         }
 
 
         initBundleList(initializedBundleList);
 
-        interpolateProperties(initializedBundleList);
+        interpolateProperties(initializedBundleList, project, mavenSession);
 
         rewriteBundleList(initializedBundleList);
     }
     
+    private final void extractConfigurations() throws MojoExecutionException, IOException {
+        final Set<Artifact> dependencies = project.getDependencyArtifacts();
+        for (Artifact artifact : dependencies) {
+            if (PARTIAL.equals(artifact.getType())) {
+                getLog().info(
+                        String.format("merging configuration from partial bundle list for %s:%s:%s", artifact.getGroupId(),
+                                artifact.getArtifactId(), artifact.getVersion()));
+                extractConfiguration(artifact);
+            }
+        }
+    }
+
+    private void extractConfiguration(Artifact artifact) throws MojoExecutionException, IOException {
+        // check for configuration artifact
+        Artifact cfgArtifact = null;
+        try {
+            cfgArtifact = getArtifact(artifact.getGroupId(),
+                    artifact.getArtifactId(),
+                    artifact.getVersion(),
+                    AttachPartialBundleListMojo.CONFIG_TYPE,
+                    AttachPartialBundleListMojo.CONFIG_CLASSIFIER);
+        } catch (final MojoExecutionException ignore) {
+            // we just ignore this
+        }
+        if ( cfgArtifact != null ) {
+            getLog().info(
+                    String.format("merging partial bundle list configuration for %s:%s:%s", cfgArtifact.getGroupId(),
+                            cfgArtifact.getArtifactId(), cfgArtifact.getVersion()));
+
+            // extract
+            zipUnarchiver.setSourceFile(cfgArtifact.getFile());
+            try {
+                this.tmpOutputDir.mkdirs();
+                zipUnarchiver.setDestDirectory(this.tmpOutputDir);
+                zipUnarchiver.extract();
+
+                final File slingDir = new File(this.tmpOutputDir, "sling");
+                this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_COMMON_PROPS), 0);
+                this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_WEBAPP_PROPS), 1);
+                this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_STANDALONE_PROPS), 2);
+                this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_COMMON_BOOTSTRAP), 0);
+                this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_WEBAPP_BOOTSTRAP), 1);
+                this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_STANDALONE_BOOTSTRAP), 2);
+
+                // and now configurations
+                if ( this.overlayConfigDir == null ) {
+                    this.tempConfigDir.mkdirs();
+                    if ( this.getConfigDirectory().exists() ) {
+                        FileUtils.copyDirectory(this.getConfigDirectory(), this.tempConfigDir,
+                                null, FileUtils.getDefaultExcludesAsString());
+                    }
+                    this.overlayConfigDir = this.tempConfigDir;
+                }
+                final File configDir = new File(this.tmpOutputDir, "config");
+                if ( configDir.exists() ) {
+                    FileUtils.copyDirectory(configDir, this.tempConfigDir,
+                            null, FileUtils.getDefaultExcludesAsString());
+                }
+            } catch (final ArchiverException ae) {
+                throw new MojoExecutionException("Unable to extract configuration archive.",ae);
+            } finally {
+                // and delete at the end
+                FileUtils.deleteDirectory(this.tmpOutputDir);
+            }
+        }
+    }
+    
     private void rewriteBundleList(BundleList bundleList) throws MojoExecutionException {
         if (rewriteRuleFiles != null) {
             KnowledgeBase knowledgeBase = createKnowledgeBase(rewriteRuleFiles);
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
index e5dab31..43b08f6 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -20,6 +20,8 @@ import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Dependency;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.*;
 
 /**
  * The definition of an artifact.
@@ -74,6 +76,15 @@ public class ArtifactDefinition {
         this.startLevel = startLevel;
     }
 
+    public ArtifactDefinition(Xpp3Dom config) {
+        this.groupId = nodeValue(config, "groupId", null);
+        this.artifactId = nodeValue(config, "artifactId", null);
+        this.type = nodeValue(config, "type", null);
+        this.version = nodeValue(config, "version", null);
+        this.classifier = nodeValue(config, "classifier", null);
+        this.startLevel = nodeValue(config, "startLevel", 0);
+    }
+
     public String getArtifactId() {
         return artifactId;
     }
@@ -124,7 +135,7 @@ public class ArtifactDefinition {
 
     @Override
     public String toString() {
-        return "AdditionalBundle [artifactId=" + artifactId + ", classifier="
+        return "ArtifactDefinition [artifactId=" + artifactId + ", classifier="
                 + classifier + ", groupId=" + groupId + ", startLevel="
                 + startLevel + ", type=" + type + ", version=" + version + "]";
     }
@@ -205,6 +216,18 @@ public class ArtifactDefinition {
         bnd.setStartLevel(startLevel);
         return bnd;
     }
+
+    public Dependency toDependency() {
+        Dependency dep = new Dependency();
+        dep.setArtifactId(artifactId);
+        dep.setGroupId(groupId);
+        dep.setVersion(version);
+        if (type != null) {
+            dep.setType(type);
+        }
+        dep.setClassifier(classifier);
+        return dep;
+    }
     
     public static Bundle toBundle(Artifact artifact, int startLevel) {
         return new ArtifactDefinition(artifact, startLevel).toBundle();
@@ -214,4 +237,8 @@ public class ArtifactDefinition {
         return new ArtifactDefinition(dependency, startLevel).toBundle();
     }
 
+    public static Dependency toDependency(Bundle bundle) {
+        return new ArtifactDefinition(bundle, 0).toDependency();
+    }
+
 }
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 470aef0..aff92b0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -28,6 +28,7 @@ import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.zip.ZipArchiver;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.readBundleList;
 
 /**
  * Attaches the bundle list as a project artifact.
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListUtils.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListUtils.java
new file mode 100644
index 0000000..4b96313
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListUtils.java
@@ -0,0 +1,154 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.sling.maven.projectsupport;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Properties;
+
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.settings.Settings;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
+import org.codehaus.plexus.interpolation.InterpolationException;
+import org.codehaus.plexus.interpolation.Interpolator;
+import org.codehaus.plexus.interpolation.PrefixedObjectValueSource;
+import org.codehaus.plexus.interpolation.PropertiesBasedValueSource;
+import org.codehaus.plexus.interpolation.StringSearchInterpolator;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+/**
+ * Miscellaneous helper methods for working with bundle lists.
+ */
+public class BundleListUtils {
+    
+    private BundleListUtils() {}
+    
+    /**
+     * Initialize the artifact definitions using defaults inside the plugin JAR.
+     *
+     * @throws IOException if the default properties can't be read
+     * @throws XmlPullParserException
+     * @throws MojoExecutionException
+     */
+    public static final void initArtifactDefinitions(ClassLoader classLoader, ArtifactDefinitionsCallback callback) throws IOException {
+        Properties dependencies = new Properties();
+        dependencies.load(classLoader.getResourceAsStream(
+                "org/apache/sling/maven/projectsupport/dependencies.properties"));
+
+        callback.initArtifactDefinitions(dependencies);
+    }
+    
+    public static boolean isCurrentArtifact(MavenProject project, ArtifactDefinition def) {
+        return (def.getGroupId().equals(project.getGroupId()) && def.getArtifactId().equals(project.getArtifactId()));
+    }
+    
+    public static BundleList readBundleList(File file) throws IOException, XmlPullParserException {
+        BundleListXpp3Reader reader = new BundleListXpp3Reader();
+        FileInputStream fis = new FileInputStream(file);
+        try {
+            return reader.read(fis);
+        } finally {
+            fis.close();
+        }
+    }
+    
+    public static int nodeValue(Xpp3Dom config, String name, int defaultValue) {
+        Xpp3Dom node = config.getChild(name);
+        if (node != null) {
+            return Integer.parseInt(node.getValue());
+        } else {
+            return defaultValue;
+        }
+    }
+    
+    public static boolean nodeValue(Xpp3Dom config, String name, boolean defaultValue) {
+        Xpp3Dom node = config.getChild(name);
+        if (node != null) {
+            return Boolean.parseBoolean(node.getValue());
+        } else {
+            return defaultValue;
+        }
+    }
+
+    public static String nodeValue(Xpp3Dom config, String name, String defaultValue) {
+        Xpp3Dom node = config.getChild(name);
+        if (node != null) {
+            return node.getValue();
+        } else {
+            return defaultValue;
+        }
+    }
+    
+    public static void interpolateProperties(BundleList bundleList, MavenProject project, MavenSession mavenSession) throws MojoExecutionException {
+        Interpolator interpolator = createInterpolator(project, mavenSession);
+        for (final StartLevel sl : bundleList.getStartLevels()) {
+            for (final Bundle bndl : sl.getBundles()) {
+                try {
+                    bndl.setArtifactId(interpolator.interpolate(bndl.getArtifactId()));
+                    bndl.setGroupId(interpolator.interpolate(bndl.getGroupId()));
+                    bndl.setVersion(interpolator.interpolate(bndl.getVersion()));
+                    bndl.setClassifier(interpolator.interpolate(bndl.getClassifier()));
+                    bndl.setType(interpolator.interpolate(bndl.getType()));
+                } catch (InterpolationException e) {
+                    throw new MojoExecutionException("Unable to interpolate properties for bundle " + bndl.toString(), e);
+                }
+            }
+        }
+
+    }
+    
+    public static Interpolator createInterpolator(MavenProject project, MavenSession mavenSession) {
+        StringSearchInterpolator interpolator = new StringSearchInterpolator();
+
+        final Properties props = new Properties();
+        props.putAll(project.getProperties());
+        props.putAll(mavenSession.getSystemProperties());
+        props.putAll(mavenSession.getUserProperties());
+        
+        interpolator.addValueSource(new PropertiesBasedValueSource(props));
+
+        // add ${project.foo}
+        interpolator.addValueSource(new PrefixedObjectValueSource(Arrays.asList("project", "pom"), project, true));
+
+        // add ${session.foo}
+        interpolator.addValueSource(new PrefixedObjectValueSource("session", mavenSession));
+
+        // add ${settings.foo}
+        final Settings settings = mavenSession.getSettings();
+        if (settings != null) {
+            interpolator.addValueSource(new PrefixedObjectValueSource("settings", settings));
+        }
+
+        return interpolator;
+    }
+
+    /**
+     * Callback interface for use with initArtifactDefinitions.
+     */
+    public static interface ArtifactDefinitionsCallback {
+        void initArtifactDefinitions(Properties dependencies);
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
index a969d81..dc848e7 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
@@ -164,7 +164,6 @@ public class CreateBundleJarMojo extends AbstractLaunchpadFrameworkMojo {
      *            the resource to be scanned
      * @return the array of filenames, relative to the sourceDir
      */
-    @SuppressWarnings("unchecked")
     private static String[] getFilesToCopy(Resource resource) {
         DirectoryScanner scanner = new DirectoryScanner();
         scanner.setBasedir(resource.getDirectory());
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
index 2b9868f..7f11573 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
@@ -81,13 +81,13 @@ public class DisplayBundleUpdatesMojo extends AbstractMojo {
      * @parameter expression="${project.remoteArtifactRepositories}"
      * @readonly
      */
-    private List remoteArtifactRepositories;
+    private List<ArtifactRepository> remoteArtifactRepositories;
 
     /**
      * @parameter expression="${project.pluginArtifactRepositories}"
      * @readonly
      */
-    private List remotePluginRepositories;
+    private List<ArtifactRepository> remotePluginRepositories;
 
     /**
      * @parameter expression="${localRepository}"
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java b/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java
new file mode 100644
index 0000000..606a6a2
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java
@@ -0,0 +1,230 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.sling.maven.projectsupport;
+
+import static org.apache.sling.maven.projectsupport.BundleListUtils.*;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.maven.AbstractMavenLifecycleParticipant;
+import org.apache.maven.MavenExecutionException;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.PluginExecution;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.logging.Logger;
+import org.codehaus.plexus.util.xml.Xpp3Dom;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+/**
+ * Maven lifecycle participant which adds the default bundle list, the
+ * jar web support bundle, and the contents of any local bundle list.
+ */
+@Component(role = AbstractMavenLifecycleParticipant.class)
+public class LaunchpadPluginLifecycleParticipant extends AbstractMavenLifecycleParticipant {
+
+    private static final String PLUGIN_ID = "maven-launchpad-plugin";
+
+    @Requirement
+    private Logger log;
+
+    @Override
+    public void afterProjectsRead(MavenSession session) throws MavenExecutionException {
+        try {
+            Map<String, MavenProject> projectMap = new HashMap<String, MavenProject>();
+            for (MavenProject project : session.getProjects()) {
+                projectMap.put(project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion(),
+                        project);
+            }
+
+            for (MavenProject project : session.getProjects()) {
+                for (Plugin plugin : project.getBuild().getPlugins()) {
+                    if (plugin.getArtifactId().equals(PLUGIN_ID)) {
+                        BundleListDependencyAdder performer = new BundleListDependencyAdder(session, project, plugin);
+                        performer.addDependencies();
+                    }
+                }
+            }
+        } catch (Exception e) {
+            throw new MavenExecutionException("Unable to determine launchpad plugin-based dependencies", e);
+        }
+        super.afterProjectsRead(session);
+    }
+
+    private class BundleListDependencyAdder {
+
+        private final MavenSession session;
+        private final MavenProject project;
+        private final Plugin plugin;
+        private final List<ArtifactDefinition> additionalBundles;
+
+        private ArtifactDefinition defaultBundleList;
+        private boolean includeDefaultBundles;
+        private ArtifactDefinition jarWebSupport;
+        private File bundleListFile;
+
+        public BundleListDependencyAdder(MavenSession session, MavenProject project, Plugin plugin) {
+            this.session = session;
+            this.project = project;
+            this.plugin = plugin;
+            this.additionalBundles = new ArrayList<ArtifactDefinition>();
+        }
+
+        void addDependencies() throws Exception {
+            readConfiguration();
+            
+            addBundleListDependencies();
+
+            if (hasPreparePackageExecution()) {
+                if (includeDefaultBundles && !isCurrentArtifact(project, defaultBundleList)) {
+                    log.debug(String.format("adding default bundle list (%s) to dependencies of project %s", defaultBundleList, project));
+                    project.getDependencies().add(defaultBundleList.toDependency());
+                }
+
+                if (hasJarPackagingExecution()) {
+                    log.debug(String.format("adding jar web support (%s) to dependencies of project %s", jarWebSupport, project));
+                    project.getDependencies().add(jarWebSupport.toDependency());
+                }
+            }
+        }
+
+        private void addBundleListDependencies() throws IOException, XmlPullParserException, MojoExecutionException {
+            BundleList bundleList;
+            
+            if (bundleListFile.exists()) {
+                bundleList = readBundleList(bundleListFile);
+            } else {
+                bundleList = new BundleList();
+            }
+            
+            if (additionalBundles != null) {
+                for (ArtifactDefinition def : additionalBundles) {
+                    bundleList.add(def.toBundle());
+                }
+            }
+            
+            interpolateProperties(bundleList, project, session);
+            
+            for (StartLevel startLevel : bundleList.getStartLevels()) {
+                for (Bundle bundle : startLevel.getBundles()) {
+                    log.debug(String.format("adding bundle (%s) from bundle list to dependencies of project %s", bundle, project));
+                    project.getDependencies().add(ArtifactDefinition.toDependency(bundle));
+                }
+            }
+        }
+
+        private void readConfiguration() throws IOException {
+            Xpp3Dom configuration = (Xpp3Dom) plugin.getConfiguration();
+            defaultBundleList = null;
+            jarWebSupport = null;
+            includeDefaultBundles = true;
+            bundleListFile = new File(project.getBasedir(), "src/main/bundles/list.xml");
+            if (configuration != null) {
+                includeDefaultBundles = nodeValue(configuration, "includeDefaultBundles", true);
+                Xpp3Dom defaultBundleListConfig = configuration.getChild("defaultBundleList");
+                if (defaultBundleListConfig != null) {
+                    defaultBundleList = new ArtifactDefinition(defaultBundleListConfig);
+                }
+                Xpp3Dom jarWebSupportConfig = configuration.getChild("jarWebSupport");
+                if (jarWebSupportConfig != null) {
+                    jarWebSupport = new ArtifactDefinition(jarWebSupportConfig);
+                }
+                Xpp3Dom bundleListFileConfig = configuration.getChild("bundleListFile");
+                if (bundleListFileConfig != null) {
+                    bundleListFile = new File(project.getBasedir(), bundleListFileConfig.getValue());
+                }
+                
+                configureAdditionalBundles(configuration);
+            }
+            
+            for (PluginExecution execution : plugin.getExecutions()) {
+                Xpp3Dom executionConfiguration = (Xpp3Dom) execution.getConfiguration();
+                if (executionConfiguration != null) {
+                    configureAdditionalBundles(executionConfiguration);
+                }
+            }
+
+            initArtifactDefinitions(getClass().getClassLoader(), new ArtifactDefinitionsCallback() {
+
+                public void initArtifactDefinitions(Properties dependencies) {
+                    if (defaultBundleList == null) {
+                        defaultBundleList = new ArtifactDefinition();
+                    }
+                    defaultBundleList.initDefaults(dependencies.getProperty("defaultBundleList"));
+
+                    if (jarWebSupport == null) {
+                        jarWebSupport = new ArtifactDefinition();
+                    }
+                    jarWebSupport.initDefaults(dependencies.getProperty("jarWebSupport"));
+                }
+            });
+        }
+
+        private void configureAdditionalBundles(Xpp3Dom configuration) {
+            Xpp3Dom additionalBundlesConfig = configuration.getChild("additionalBundles");
+            if (additionalBundlesConfig != null) {
+                Xpp3Dom[] bundleConfigs = additionalBundlesConfig.getChildren("bundle");
+                if (bundleConfigs != null) {
+                    for (Xpp3Dom bundleConfig : bundleConfigs) {
+                        additionalBundles.add(new ArtifactDefinition(bundleConfig));
+                    }
+                }
+            }
+        }
+
+        private boolean hasJarPackagingExecution() {
+            if (AbstractUsingBundleListMojo.JAR.equals(project.getPackaging())) {
+                return true;
+            } else {
+                for (PluginExecution execution : plugin.getExecutions()) {
+                    if (execution.getGoals().contains("prepare-package")) {
+                        Xpp3Dom executionConfig = (Xpp3Dom) execution.getConfiguration();
+                        if (executionConfig != null) {
+                            Xpp3Dom packagingConfig = executionConfig.getChild("packaging");
+                            if (packagingConfig != null
+                                    && AbstractUsingBundleListMojo.JAR.equals(packagingConfig.getValue())) {
+                                return true;
+                            }
+                        }
+                    }
+                }
+                return false;
+            }
+        }
+
+        private boolean hasPreparePackageExecution() {
+            for (PluginExecution execution : plugin.getExecutions()) {
+                if (execution.getGoals().contains("prepare-package")) {
+                    return true;
+                }
+            }
+            return false;
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
index bb12d9d..d57d2f7 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
@@ -24,6 +24,8 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.readBundleList;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.interpolateProperties;
 
 /**
  * Validate that the artifacts listed in a bundle list are valid
@@ -51,7 +53,7 @@ public class ValidateBundleListMojo extends AbstractBundleListMojo {
         
         addDependencies(initializedBundleList);
 
-        interpolateProperties(initializedBundleList);
+        interpolateProperties(initializedBundleList, project, mavenSession);
         
         for (StartLevel sl : initializedBundleList.getStartLevels()) {
             for (Bundle bundle : sl.getBundles()) {

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 10/29: SLING-2264 - add option to set includeDefaultBundles on command line

Posted by ro...@apache.org.
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 eb65f0bb2a7060c54142cac68306bbfdf7a26046
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Nov 4 20:45:55 2011 +0000

    SLING-2264 - add option to set includeDefaultBundles on command line
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1197758 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index eb87a93..87890da 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -93,7 +93,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
     /**
      * If true, include the default bundles.
      *
-     * @parameter default-value="true"
+     * @parameter expression="${includeDefaultBundles}" default-value="true"
      */
     private boolean includeDefaultBundles;
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 18/29: SLING-2194 : generate a partial bundle list from a project's dependencies SLING-2265 : maven-launchpad-plugin should support a syntax similar to the maven-dependency-plugin

Posted by ro...@apache.org.
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 210d0d40ccfa1aa08349af59f13e7ed1a5f50fa4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Dec 23 09:51:55 2011 +0000

    SLING-2194 : generate a partial bundle list from a project's dependencies
    SLING-2265 : maven-launchpad-plugin should support a syntax similar to the maven-dependency-plugin
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1222624 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/AbstractBundleListMojo.java     |  63 +-------
 .../AbstractUsingBundleListMojo.java               |  15 +-
 .../AttachPartialBundleListMojo.java               |   2 -
 .../projectsupport/ConfigurationStartLevel.java    | 166 ---------------------
 .../projectsupport/ValidateBundleListMojo.java     |  15 +-
 5 files changed, 21 insertions(+), 240 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index 7119c21..eca43fe 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -18,7 +18,6 @@ package org.apache.sling.maven.projectsupport;
 
 import java.io.File;
 import java.util.List;
-import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -32,13 +31,10 @@ import org.apache.maven.artifact.versioning.ArtifactVersion;
 import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
 import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.execution.MavenSession;
-import org.apache.maven.model.Dependency;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
-import org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
 import org.codehaus.plexus.util.StringUtils;
 
 public abstract class AbstractBundleListMojo extends AbstractMojo {
@@ -54,13 +50,8 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
     protected File bundleListFile;
 
     /**
-     * @parameter
-     */
-    private ConfigurationStartLevel[] includeDependencies;
-
-    /**
      * The Maven project.
-     * 
+     *
      * @parameter expression="${project}"
      * @required
      * @readonly
@@ -128,13 +119,6 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
     protected MavenSession mavenSession;
 
     /**
-     * The start level to be used when generating the bundle list.
-     * 
-     * @parameter default-value="-1"
-     */
-    private int dependencyStartLevel;
-
-    /**
      * Used to look up Artifacts in the remote repository.
      *
      * @component
@@ -177,41 +161,6 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
         return this.configDirectory;
     }
 
-    protected void addDependencies(final BundleList bundleList) throws MojoExecutionException {
-        if (includeDependencies != null) {
-            for (ConfigurationStartLevel startLevel : includeDependencies) {
-                Set<Artifact> artifacts = getArtifacts(startLevel);
-                for (Artifact artifact : artifacts) {
-                    bundleList.add(ArtifactDefinition.toBundle(artifact, startLevel.getLevel()));
-                }
-            }
-        }
-
-        if (dependencyStartLevel >= 0) {
-            final List<Dependency> dependencies = project.getDependencies();
-            for (Dependency dependency : dependencies) {
-                if (!PARTIAL.equals(dependency.getType())) {
-                    bundleList.add(ArtifactDefinition.toBundle(dependency, dependencyStartLevel));
-                }
-            }
-        }
-    }
-
-    @SuppressWarnings("unchecked")
-    private Set<Artifact> getArtifacts(ConfigurationStartLevel startLevel) throws MojoExecutionException {
-        // start with all artifacts.
-        Set<Artifact> artifacts = project.getArtifacts();
-
-        // perform filtering
-        try {
-            artifacts = startLevel.buildFilter(project).filter(artifacts);
-        } catch (ArtifactFilterException e) {
-            throw new MojoExecutionException(e.getMessage(), e);
-        }
-        
-        return artifacts;
-    }
-
     /**
      * Get a resolved Artifact from the coordinates found in the artifact
      * definition.
@@ -234,20 +183,20 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
             throws MojoExecutionException {
                 Artifact artifact;
                 VersionRange vr;
-            
+
                 try {
                     vr = VersionRange.createFromVersionSpec(version);
                 } catch (InvalidVersionSpecificationException e) {
                     vr = VersionRange.createFromVersion(version);
                 }
-            
+
                 if (StringUtils.isEmpty(classifier)) {
                     artifact = factory.createDependencyArtifact(groupId, artifactId, vr, type, null, Artifact.SCOPE_COMPILE);
                 } else {
                     artifact = factory.createDependencyArtifact(groupId, artifactId, vr, type, classifier,
                             Artifact.SCOPE_COMPILE);
                 }
-            
+
                 // This code kicks in when the version specifier is a range.
                 if (vr.getRecommendedVersion() == null) {
                     try {
@@ -257,9 +206,9 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
                     } catch (ArtifactMetadataRetrievalException e) {
                         throw new MojoExecutionException("Unable to find version for artifact", e);
                     }
-            
+
                 }
-            
+
                 try {
                     resolver.resolve(artifact, remoteRepos, local);
                 } catch (ArtifactResolutionException e) {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 3f242a4..90dd76f 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -16,6 +16,9 @@
  */
 package org.apache.sling.maven.projectsupport;
 
+import static org.apache.sling.maven.projectsupport.BundleListUtils.interpolateProperties;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.readBundleList;
+
 import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
@@ -30,6 +33,7 @@ import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.shared.filtering.MavenFileFilter;
 import org.apache.maven.shared.filtering.MavenFilteringException;
 import org.apache.maven.shared.filtering.PropertyUtils;
+import org.apache.sling.maven.projectsupport.BundleListUtils.ArtifactDefinitionsCallback;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
@@ -43,9 +47,6 @@ import org.drools.builder.KnowledgeBuilderFactory;
 import org.drools.builder.ResourceType;
 import org.drools.io.ResourceFactory;
 import org.drools.runtime.StatefulKnowledgeSession;
-import org.apache.sling.maven.projectsupport.BundleListUtils.ArtifactDefinitionsCallback;
-import static org.apache.sling.maven.projectsupport.BundleListUtils.readBundleList;
-import static org.apache.sling.maven.projectsupport.BundleListUtils.interpolateProperties;
 
 public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo {
 
@@ -196,7 +197,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      */
     private final void initArtifactDefinitions() throws IOException {
         BundleListUtils.initArtifactDefinitions(getClass().getClassLoader(), new ArtifactDefinitionsCallback() {
-            
+
             public void initArtifactDefinitions(Properties dependencies) {
                 if (defaultBundleList == null) {
                     defaultBundleList = new ArtifactDefinition();
@@ -231,7 +232,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                 initializedBundleList.add(def.toBundle());
             }
         }
-        addDependencies(initializedBundleList);
+
         if (bundleExclusions != null) {
             for (ArtifactDefinition def : bundleExclusions) {
                 initializedBundleList.remove(def.toBundle(), false);
@@ -255,7 +256,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
 
         rewriteBundleList(initializedBundleList);
     }
-    
+
     private final void extractConfigurations() throws MojoExecutionException, IOException {
         final Set<Artifact> dependencies = project.getDependencyArtifacts();
         for (Artifact artifact : dependencies) {
@@ -322,7 +323,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
             }
         }
     }
-    
+
     private void rewriteBundleList(BundleList bundleList) throws MojoExecutionException {
         if (rewriteRuleFiles != null) {
             KnowledgeBase knowledgeBase = createKnowledgeBase(rewriteRuleFiles);
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 aa2dcd3..c4e264c 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -93,8 +93,6 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
             initializedBundleList = new BundleList();
         }
 
-        addDependencies(initializedBundleList);
-
         interpolateProperties(initializedBundleList, this.project, this.mavenSession);
 
         final BundleListXpp3Writer writer = new BundleListXpp3Writer();
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ConfigurationStartLevel.java b/src/main/java/org/apache/sling/maven/projectsupport/ConfigurationStartLevel.java
deleted file mode 100644
index dd41fcd..0000000
--- a/src/main/java/org/apache/sling/maven/projectsupport/ConfigurationStartLevel.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.sling.maven.projectsupport;
-
-import org.apache.maven.plugin.dependency.utils.DependencyUtil;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.artifact.filter.collection.ArtifactIdFilter;
-import org.apache.maven.shared.artifact.filter.collection.ClassifierFilter;
-import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts;
-import org.apache.maven.shared.artifact.filter.collection.GroupIdFilter;
-import org.apache.maven.shared.artifact.filter.collection.ProjectTransitivityFilter;
-import org.apache.maven.shared.artifact.filter.collection.ScopeFilter;
-import org.apache.maven.shared.artifact.filter.collection.TypeFilter;
-
-public class ConfigurationStartLevel {
-    
-    private int level;
-
-    private String includeTypes;
-
-    private String excludeTypes;
-
-    private String includeScope;
-
-    private String excludeScope;
-
-    private String includeClassifiers;
-
-    private String excludeClassifiers;
-
-    private String excludeArtifactIds;
-
-    private String includeArtifactIds;
-
-    private String excludeGroupIds;
-
-    private String includeGroupIds;
-
-    public int getLevel() {
-        return level;
-    }
-
-    public void setLevel(int level) {
-        this.level = level;
-    }
-
-    public String getIncludeTypes() {
-        return includeTypes;
-    }
-
-    public void setIncludeTypes(String includeTypes) {
-        this.includeTypes = includeTypes;
-    }
-
-    public String getExcludeTypes() {
-        return excludeTypes;
-    }
-
-    public void setExcludeTypes(String excludeTypes) {
-        this.excludeTypes = excludeTypes;
-    }
-
-    public String getIncludeScope() {
-        return includeScope;
-    }
-
-    public void setIncludeScope(String includeScope) {
-        this.includeScope = includeScope;
-    }
-
-    public String getExcludeScope() {
-        return excludeScope;
-    }
-
-    public void setExcludeScope(String excludeScope) {
-        this.excludeScope = excludeScope;
-    }
-
-    public String getIncludeClassifiers() {
-        return includeClassifiers;
-    }
-
-    public void setIncludeClassifiers(String includeClassifiers) {
-        this.includeClassifiers = includeClassifiers;
-    }
-
-    public String getExcludeClassifiers() {
-        return excludeClassifiers;
-    }
-
-    public void setExcludeClassifiers(String excludeClassifiers) {
-        this.excludeClassifiers = excludeClassifiers;
-    }
-
-    public String getExcludeArtifactIds() {
-        return excludeArtifactIds;
-    }
-
-    public void setExcludeArtifactIds(String excludeArtifactIds) {
-        this.excludeArtifactIds = excludeArtifactIds;
-    }
-
-    public String getIncludeArtifactIds() {
-        return includeArtifactIds;
-    }
-
-    public void setIncludeArtifactIds(String includeArtifactIds) {
-        this.includeArtifactIds = includeArtifactIds;
-    }
-
-    public String getExcludeGroupIds() {
-        return excludeGroupIds;
-    }
-
-    public void setExcludeGroupIds(String excludeGroupIds) {
-        this.excludeGroupIds = excludeGroupIds;
-    }
-
-    public String getIncludeGroupIds() {
-        return includeGroupIds;
-    }
-
-    public void setIncludeGroupIds(String includeGroupIds) {
-        this.includeGroupIds = includeGroupIds;
-    }
-
-    public FilterArtifacts buildFilter(MavenProject project) {
-        // add filters in well known order, least specific to most specific
-        FilterArtifacts filter = new FilterArtifacts();
-
-        filter.addFilter(new ProjectTransitivityFilter(project.getDependencyArtifacts(), true));
-
-        filter.addFilter(new ScopeFilter(DependencyUtil.cleanToBeTokenizedString(this.includeScope), DependencyUtil
-                .cleanToBeTokenizedString(this.excludeScope)));
-
-        filter.addFilter(new TypeFilter(DependencyUtil.cleanToBeTokenizedString(this.includeTypes), DependencyUtil
-                .cleanToBeTokenizedString(this.excludeTypes)));
-
-        filter.addFilter(new ClassifierFilter(DependencyUtil.cleanToBeTokenizedString(this.includeClassifiers),
-                DependencyUtil.cleanToBeTokenizedString(this.excludeClassifiers)));
-
-        filter.addFilter(new GroupIdFilter(DependencyUtil.cleanToBeTokenizedString(this.includeGroupIds),
-                DependencyUtil.cleanToBeTokenizedString(this.excludeGroupIds)));
-
-        filter.addFilter(new ArtifactIdFilter(DependencyUtil.cleanToBeTokenizedString(this.includeArtifactIds),
-                DependencyUtil.cleanToBeTokenizedString(this.excludeArtifactIds)));
-        return filter;
-    }
-    
-    
-
-}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
index d57d2f7..df890cf 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
@@ -5,9 +5,9 @@
  * licenses this file to You under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -16,6 +16,9 @@
  */
 package org.apache.sling.maven.projectsupport;
 
+import static org.apache.sling.maven.projectsupport.BundleListUtils.interpolateProperties;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.readBundleList;
+
 import java.io.IOException;
 
 import org.apache.maven.plugin.MojoExecutionException;
@@ -24,8 +27,6 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import static org.apache.sling.maven.projectsupport.BundleListUtils.readBundleList;
-import static org.apache.sling.maven.projectsupport.BundleListUtils.interpolateProperties;
 
 /**
  * Validate that the artifacts listed in a bundle list are valid
@@ -36,7 +37,7 @@ import static org.apache.sling.maven.projectsupport.BundleListUtils.interpolateP
  * @description validate that the artifacts listed in a bundle list are valid
  */
 public class ValidateBundleListMojo extends AbstractBundleListMojo {
-   
+
     public void execute() throws MojoExecutionException, MojoFailureException {
         final BundleList initializedBundleList;
         if (bundleListFile.exists()) {
@@ -50,11 +51,9 @@ public class ValidateBundleListMojo extends AbstractBundleListMojo {
         } else {
             initializedBundleList = new BundleList();
         }
-        
-        addDependencies(initializedBundleList);
 
         interpolateProperties(initializedBundleList, project, mavenSession);
-        
+
         for (StartLevel sl : initializedBundleList.getStartLevels()) {
             for (Bundle bundle : sl.getBundles()) {
                 getArtifact(new ArtifactDefinition(bundle, -1));

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 09/29: trivial formatting and field name change

Posted by ro...@apache.org.
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 52fb2008acb10bf3469524d75909a32407bd7029
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Nov 4 15:46:50 2011 +0000

    trivial formatting and field name change
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1197607 13f79535-47bb-0310-9956-ffa450edef68
---
 .../AbstractLaunchpadStartingMojo.java             |   4 +-
 .../AbstractUsingBundleListMojo.java               |  28 +-
 .../maven/projectsupport/AttachBundleListMojo.java |   2 +-
 .../AttachPartialBundleListMojo.java               |  10 +-
 .../CheckBundleListForSnapshotsMojo.java           |   2 +-
 .../maven/projectsupport/CreateBundleJarMojo.java  | 286 ++++++++++-----------
 .../CreateKarafFeatureDescriptorMojo.java          |   2 +-
 .../maven/projectsupport/OutputBundleListMojo.java |   2 +-
 .../maven/projectsupport/PreparePackageMojo.java   | 282 ++++++++++----------
 .../projectsupport/ValidateBundleListMojo.java     |  12 +-
 10 files changed, 315 insertions(+), 315 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
index 2cf52d5..f16fa2a 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -108,7 +108,7 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
         public Iterator<String> getChildren(String path) {
             if (path.equals(BUNDLE_PATH_PREFIX)) {
                 final Set<String> levels = new HashSet<String>();
-                for (final StartLevel level : getBundleList().getStartLevels()) {
+                for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
                     // we treat the boot level as level 1
                     if ( level.getStartLevel() == -1 ) {
                         levels.add(BUNDLE_PATH_PREFIX + "/1/");
@@ -148,7 +148,7 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
                     final int startLevel = Integer.parseInt(startLevelInfo);
 
                     final List<String> bundles = new ArrayList<String>();
-                    for (final StartLevel level : getBundleList().getStartLevels()) {
+                    for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
                         if (level.getStartLevel() == startLevel || (startLevel == 1 && level.getStartLevel() == -1)) {
                             for (final Bundle bundle : level.getBundles()) {
                                 final ArtifactDefinition d = new ArtifactDefinition(bundle, startLevel);
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 56cc6c9..eb87a93 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -81,7 +81,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      */
     private ArtifactDefinition[] additionalBundles;
 
-    private BundleList bundleList;
+    private BundleList initializedBundleList;
 
     /**
      * Bundles which should be removed from the project's bundles directory.
@@ -164,8 +164,8 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      */
     protected abstract void executeWithArtifacts() throws MojoExecutionException, MojoFailureException;
 
-    protected BundleList getBundleList() {
-        return bundleList;
+    protected BundleList getInitializedBundleList() {
+        return initializedBundleList;
     }
 
     /**
@@ -211,30 +211,30 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
     private final void initBundleList() throws IOException, XmlPullParserException, MojoExecutionException {
         initArtifactDefinitions();
         if (isCurrentArtifact(defaultBundleList)) {
-            bundleList = readBundleList(bundleListFile);
+            initializedBundleList = readBundleList(bundleListFile);
         } else {
-            bundleList = new BundleList();
+            initializedBundleList = new BundleList();
             if (includeDefaultBundles) {
                 Artifact defBndListArtifact = getArtifact(defaultBundleList.getGroupId(),
                         defaultBundleList.getArtifactId(), defaultBundleList.getVersion(), defaultBundleList.getType(),
                         defaultBundleList.getClassifier());
                 getLog().info("Using bundle list file from " + defBndListArtifact.getFile().getAbsolutePath());
-                bundleList = readBundleList(defBndListArtifact.getFile());
+                initializedBundleList = readBundleList(defBndListArtifact.getFile());
             }
 
             if (bundleListFile.exists()) {
-                bundleList.merge(readBundleList(bundleListFile));
+                initializedBundleList.merge(readBundleList(bundleListFile));
             }
         }
         if (additionalBundles != null) {
             for (ArtifactDefinition def : additionalBundles) {
-                bundleList.add(def.toBundle());
+                initializedBundleList.add(def.toBundle());
             }
         }
-        addDependencies(bundleList);
+        addDependencies(initializedBundleList);
         if (bundleExclusions != null) {
             for (ArtifactDefinition def : bundleExclusions) {
-                bundleList.remove(def.toBundle(), false);
+                initializedBundleList.remove(def.toBundle(), false);
             }
         }
 
@@ -244,7 +244,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                 getLog().info(
                         String.format("merging partial bundle list for %s:%s:%s", artifact.getGroupId(),
                                 artifact.getArtifactId(), artifact.getVersion()));
-                bundleList.merge(readBundleList(artifact.getFile()));
+                initializedBundleList.merge(readBundleList(artifact.getFile()));
 
                 // check for configuration artifact
                 Artifact cfgArtifact = null;
@@ -302,11 +302,11 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         }
 
 
-        initBundleList(bundleList);
+        initBundleList(initializedBundleList);
 
-        interpolateProperties(bundleList);
+        interpolateProperties(initializedBundleList);
 
-        rewriteBundleList(bundleList);
+        rewriteBundleList(initializedBundleList);
     }
     
     private void rewriteBundleList(BundleList bundleList) throws MojoExecutionException {
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 dc5505c..9cebe53 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
@@ -49,7 +49,7 @@ public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
         FileWriter fw = null;
         try {
             fw = new FileWriter(outputFile);
-            writer.write(fw, getBundleList());
+            writer.write(fw, getInitializedBundleList());
             projectHelper.attachArtifact(project, TYPE, CLASSIFIER, outputFile);
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to output effective bundle list", e);
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 ed2c8ac..3c34afa 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -72,24 +72,24 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
     private ZipArchiver zipArchiver;
 
     public void execute() throws MojoExecutionException, MojoFailureException {
-        final BundleList bundleList;
+        final BundleList initializedBundleList;
         if (bundleListFile.exists()) {
             try {
-                bundleList = readBundleList(bundleListFile);
+                initializedBundleList = readBundleList(bundleListFile);
             } catch (IOException e) {
                 throw new MojoExecutionException("Unable to read bundle list file", e);
             } catch (XmlPullParserException e) {
                 throw new MojoExecutionException("Unable to read bundle list file", e);
             }
         } else {
-            bundleList = new BundleList();
+            initializedBundleList = new BundleList();
         }
         
-        addDependencies(bundleList);
+        addDependencies(initializedBundleList);
         
         BundleListXpp3Writer writer = new BundleListXpp3Writer();
         try {
-            writer.write(new FileWriter(bundleListOutput), bundleList);
+            writer.write(new FileWriter(bundleListOutput), initializedBundleList);
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to write bundle list", e);
         }
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
index 9c6b97b..aeebc61 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
@@ -44,7 +44,7 @@ public class CheckBundleListForSnapshotsMojo extends AbstractUsingBundleListMojo
     @Override
     protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
         List<Bundle> snapshots = new ArrayList<Bundle>();
-        BundleList bundleList = getBundleList();
+        BundleList bundleList = getInitializedBundleList();
         for (StartLevel level : bundleList.getStartLevels()) {
             for (Bundle bundle : level.getBundles()) {
                 if (isSnapshot(bundle)) {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
index b1b22b0..a969d81 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
@@ -41,148 +41,148 @@ import org.codehaus.plexus.util.DirectoryScanner;
  */
 public class CreateBundleJarMojo extends AbstractLaunchpadFrameworkMojo {
 
-	/**
-	 * The list of resources we want to add to the bundle JAR file.
-	 *
-	 * @parameter
-	 */
-	private Resource[] resources;
-
-	/**
-	 * The output directory.
-	 *
-	 * @parameter default-value="${project.build.directory}"
-	 */
-	private File outputDirectory;
-
-	/**
-	 * Name of the generated JAR.
-	 *
-	 * @parameter default-value="${project.artifactId}-${project.version}"
-	 * @required
-	 */
-	private String jarName;
-
-	/**
-	 * The Jar archiver.
-	 *
-	 * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
-	 */
-	private JarArchiver jarArchiver;
-
-	private static final String CLASSIFIER = "bundles";
-
-	public static final String[] DEFAULT_INCLUDES = { "**/**" };
-
-	private void addBundles() throws MojoExecutionException {
-		BundleList bundles = getBundleList();
-
-		for (StartLevel level : bundles.getStartLevels()) {
-			for (Bundle bundle : level.getBundles()) {
-				Artifact artifact = getArtifact(new ArtifactDefinition(bundle,
-						level.getStartLevel()));
-				final String destFileName = getPathForArtifact(level.getStartLevel(), artifact.getFile().getName());
-				try {
-					jarArchiver.addFile(artifact.getFile(), destFileName);
-				} catch (ArchiverException e) {
-					throw new MojoExecutionException(
-							"Unable to add file to bundle jar file: "
-									+ artifact.getFile().getAbsolutePath(), e);
-				}
-			}
-		}
-	}
-
-	private void addResources(Resource resource) throws MojoExecutionException {
-		getLog().info(
-				String.format("Adding resources [%s] to [%s]", resource
-						.getDirectory(), resource.getTargetPath()));
-		String[] fileNames = getFilesToCopy(resource);
-		for (int i = 0; i < fileNames.length; i++) {
-			String targetFileName = fileNames[i];
-			if (resource.getTargetPath() != null) {
-				targetFileName = resource.getTargetPath() + File.separator
-						+ targetFileName;
-			}
-
-			try {
-				jarArchiver.addFile(new File(resource.getDirectory(),
-						fileNames[i]), targetFileName);
-			} catch (ArchiverException e) {
-				throw new MojoExecutionException(
-						"Unable to add resources to JAR file", e);
-			}
-
-		}
-	}
-
-	private File createJARFile() throws MojoExecutionException {
-		File jarFile = new File(outputDirectory, jarName + "-" + CLASSIFIER
-				+ "." + JAR);
-		jarArchiver.setDestFile(jarFile);
-
-		addBundles();
-		addResources();
-
-		try {
-			jarArchiver.createArchive();
-		} catch (ArchiverException e) {
-			throw new MojoExecutionException(
-					"Unable to create bundle jar file", e);
-		} catch (IOException e) {
-			throw new MojoExecutionException(
-					"Unable to create bundle jar file", e);
-		}
-
-		return jarFile;
-	}
-
-	private void addResources() throws MojoExecutionException {
-		if (resources != null) {
-			for (Resource resource : resources) {
-				if (!(new File(resource.getDirectory())).isAbsolute()) {
-					resource.setDirectory(project.getBasedir() + File.separator
-							+ resource.getDirectory());
-				}
-				addResources(resource);
-			}
-		}
-	}
-
-	@Override
-	protected void executeWithArtifacts() throws MojoExecutionException,
-			MojoFailureException {
-		File jarFile = createJARFile();
-		projectHelper.attachArtifact(project, JAR, CLASSIFIER, jarFile);
-	}
-
-	/**
-	 * Returns a list of filenames that should be copied over to the destination
-	 * directory.
-	 *
-	 * @param resource
-	 *            the resource to be scanned
-	 * @return the array of filenames, relative to the sourceDir
-	 */
-	@SuppressWarnings("unchecked")
+    /**
+     * The list of resources we want to add to the bundle JAR file.
+     *
+     * @parameter
+     */
+    private Resource[] resources;
+
+    /**
+     * The output directory.
+     *
+     * @parameter default-value="${project.build.directory}"
+     */
+    private File outputDirectory;
+
+    /**
+     * Name of the generated JAR.
+     *
+     * @parameter default-value="${project.artifactId}-${project.version}"
+     * @required
+     */
+    private String jarName;
+
+    /**
+     * The Jar archiver.
+     *
+     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
+     */
+    private JarArchiver jarArchiver;
+
+    private static final String CLASSIFIER = "bundles";
+
+    public static final String[] DEFAULT_INCLUDES = { "**/**" };
+
+    private void addBundles() throws MojoExecutionException {
+        BundleList bundles = getInitializedBundleList();
+
+        for (StartLevel level : bundles.getStartLevels()) {
+            for (Bundle bundle : level.getBundles()) {
+                Artifact artifact = getArtifact(new ArtifactDefinition(bundle,
+                        level.getStartLevel()));
+                final String destFileName = getPathForArtifact(level.getStartLevel(), artifact.getFile().getName());
+                try {
+                    jarArchiver.addFile(artifact.getFile(), destFileName);
+                } catch (ArchiverException e) {
+                    throw new MojoExecutionException(
+                            "Unable to add file to bundle jar file: "
+                                    + artifact.getFile().getAbsolutePath(), e);
+                }
+            }
+        }
+    }
+
+    private void addResources(Resource resource) throws MojoExecutionException {
+        getLog().info(
+                String.format("Adding resources [%s] to [%s]", resource
+                        .getDirectory(), resource.getTargetPath()));
+        String[] fileNames = getFilesToCopy(resource);
+        for (int i = 0; i < fileNames.length; i++) {
+            String targetFileName = fileNames[i];
+            if (resource.getTargetPath() != null) {
+                targetFileName = resource.getTargetPath() + File.separator
+                        + targetFileName;
+            }
+
+            try {
+                jarArchiver.addFile(new File(resource.getDirectory(),
+                        fileNames[i]), targetFileName);
+            } catch (ArchiverException e) {
+                throw new MojoExecutionException(
+                        "Unable to add resources to JAR file", e);
+            }
+
+        }
+    }
+
+    private File createJARFile() throws MojoExecutionException {
+        File jarFile = new File(outputDirectory, jarName + "-" + CLASSIFIER
+                + "." + JAR);
+        jarArchiver.setDestFile(jarFile);
+
+        addBundles();
+        addResources();
+
+        try {
+            jarArchiver.createArchive();
+        } catch (ArchiverException e) {
+            throw new MojoExecutionException(
+                    "Unable to create bundle jar file", e);
+        } catch (IOException e) {
+            throw new MojoExecutionException(
+                    "Unable to create bundle jar file", e);
+        }
+
+        return jarFile;
+    }
+
+    private void addResources() throws MojoExecutionException {
+        if (resources != null) {
+            for (Resource resource : resources) {
+                if (!(new File(resource.getDirectory())).isAbsolute()) {
+                    resource.setDirectory(project.getBasedir() + File.separator
+                            + resource.getDirectory());
+                }
+                addResources(resource);
+            }
+        }
+    }
+
+    @Override
+    protected void executeWithArtifacts() throws MojoExecutionException,
+            MojoFailureException {
+        File jarFile = createJARFile();
+        projectHelper.attachArtifact(project, JAR, CLASSIFIER, jarFile);
+    }
+
+    /**
+     * Returns a list of filenames that should be copied over to the destination
+     * directory.
+     *
+     * @param resource
+     *            the resource to be scanned
+     * @return the array of filenames, relative to the sourceDir
+     */
+    @SuppressWarnings("unchecked")
     private static String[] getFilesToCopy(Resource resource) {
-		DirectoryScanner scanner = new DirectoryScanner();
-		scanner.setBasedir(resource.getDirectory());
-		if (resource.getIncludes() != null && !resource.getIncludes().isEmpty()) {
-			scanner.setIncludes((String[]) resource.getIncludes().toArray(
-					new String[resource.getIncludes().size()]));
-		} else {
-			scanner.setIncludes(DEFAULT_INCLUDES);
-		}
-		if (resource.getExcludes() != null && !resource.getExcludes().isEmpty()) {
-			scanner.setExcludes((String[]) resource.getExcludes().toArray(
-					new String[resource.getExcludes().size()]));
-		}
-
-		scanner.addDefaultExcludes();
-
-		scanner.scan();
-
-		return scanner.getIncludedFiles();
-	}
+        DirectoryScanner scanner = new DirectoryScanner();
+        scanner.setBasedir(resource.getDirectory());
+        if (resource.getIncludes() != null && !resource.getIncludes().isEmpty()) {
+            scanner.setIncludes((String[]) resource.getIncludes().toArray(
+                    new String[resource.getIncludes().size()]));
+        } else {
+            scanner.setIncludes(DEFAULT_INCLUDES);
+        }
+        if (resource.getExcludes() != null && !resource.getExcludes().isEmpty()) {
+            scanner.setExcludes((String[]) resource.getExcludes().toArray(
+                    new String[resource.getExcludes().size()]));
+        }
+
+        scanner.addDefaultExcludes();
+
+        scanner.scan();
+
+        return scanner.getIncludedFiles();
+    }
 }
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
index dba8b69..f66b60b 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
@@ -78,7 +78,7 @@ public class CreateKarafFeatureDescriptorMojo extends AbstractUsingBundleListMoj
         feature.setAttribute("name", featureName);
         feature.setAttribute("version", featureVersion);
 
-        BundleList bundleList = getBundleList();
+        BundleList bundleList = getInitializedBundleList();
         for (StartLevel level : bundleList.getStartLevels()) {
             for (Bundle bundle : level.getBundles()) {
                 String bundleRef = String.format("mvn:%s/%s/%s", bundle.getGroupId(), bundle.getArtifactId(), bundle
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
index 9c8cec1..a1e5b67 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
@@ -35,7 +35,7 @@ public class OutputBundleListMojo extends AbstractUsingBundleListMojo {
     protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
         BundleListXpp3Writer writer = new BundleListXpp3Writer();
         try {
-            writer.write(new OutputStreamWriter(System.out), getBundleList());
+            writer.write(new OutputStreamWriter(System.out), getInitializedBundleList());
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to write bundle list", e);
         }
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
index abc2f03..378857c 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -46,44 +46,44 @@ import org.codehaus.plexus.util.FileUtils;
  */
 public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 
-	/**
-	 * The output directory for the default bundles in a WAR-packaged project,
-	 * the base JAR (in the subdirectory named in the baseDestination
-	 * parameter), and any additional bundles.
-	 *
-	 * @parameter default-value="${project.build.directory}/launchpad-bundles"
-	 */
-	private File warOutputDirectory;
-
-	/**
-	 * The project's packaging type.
-	 *
-	 * @parameter expression="${project.packaging}"
-	 */
-	private String packaging;
-
-	/**
-	 * The definition of the base JAR.
-	 *
-	 * @parameter
-	 */
-	private ArtifactDefinition base;
-
-	/**
-	 * The definition of the package to be included to provide web support for
-	 * JAR-packaged projects (i.e. pax-web).
-	 *
-	 * @parameter
-	 */
-	private ArtifactDefinition jarWebSupport;
-
-	/**
-	 * The project's build output directory (i.e. target/classes).
-	 *
-	 * @parameter expression="${project.build.outputDirectory}"
-	 * @readonly
-	 */
-	private File buildOutputDirectory;
+    /**
+     * The output directory for the default bundles in a WAR-packaged project,
+     * the base JAR (in the subdirectory named in the baseDestination
+     * parameter), and any additional bundles.
+     *
+     * @parameter default-value="${project.build.directory}/launchpad-bundles"
+     */
+    private File warOutputDirectory;
+
+    /**
+     * The project's packaging type.
+     *
+     * @parameter expression="${project.packaging}"
+     */
+    private String packaging;
+
+    /**
+     * The definition of the base JAR.
+     *
+     * @parameter
+     */
+    private ArtifactDefinition base;
+
+    /**
+     * The definition of the package to be included to provide web support for
+     * JAR-packaged projects (i.e. pax-web).
+     *
+     * @parameter
+     */
+    private ArtifactDefinition jarWebSupport;
+
+    /**
+     * The project's build output directory (i.e. target/classes).
+     *
+     * @parameter expression="${project.build.outputDirectory}"
+     * @readonly
+     */
+    private File buildOutputDirectory;
 
     /**
      * The temp directory (i.e. target/maven-launchpad-plugintmp).
@@ -108,27 +108,27 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
     private JarArchiver jarArchiver;
 
     public void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
-		copyBaseArtifact();
-		copyBundles(getBundleList(), getOutputDirectory());
-		copyConfigurationFiles();
-		if (JAR.equals(packaging)) {
-			unpackBaseArtifact();
-		}
-	}
+        copyBaseArtifact();
+        copyBundles(getInitializedBundleList(), getOutputDirectory());
+        copyConfigurationFiles();
+        if (JAR.equals(packaging)) {
+            unpackBaseArtifact();
+        }
+    }
 
     protected void initArtifactDefinitions(Properties dependencies) {
-		if (base == null) {
-			base = new ArtifactDefinition();
-		}
-		base.initDefaults(dependencies.getProperty("base"));
-
-		if (jarWebSupport == null) {
-			jarWebSupport = new ArtifactDefinition();
-		}
-		jarWebSupport.initDefaults(dependencies.getProperty("jarWebSupport"));
-	}
-
-	/**
+        if (base == null) {
+            base = new ArtifactDefinition();
+        }
+        base.initDefaults(dependencies.getProperty("base"));
+
+        if (jarWebSupport == null) {
+            jarWebSupport = new ArtifactDefinition();
+        }
+        jarWebSupport.initDefaults(dependencies.getProperty("jarWebSupport"));
+    }
+
+    /**
      * Add the JAR Web Support bundle to the bundle list.
      */
     @Override
@@ -210,96 +210,96 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
     }
 
     private void copyBaseArtifact() throws MojoExecutionException {
-		Artifact artifact = getBaseArtifact();
-		if (artifact == null) {
-			throw new MojoExecutionException(
-					String.format("Project doesn't have a base dependency of groupId %s and artifactId %s",
-									base.getGroupId(), base.getArtifactId()));
-		}
-		File destinationDir = new File(getOutputDirectory(), baseDestination);
-		File destinationFile = new File(destinationDir, artifact
-				.getArtifactId()
-				+ "." + artifact.getArtifactHandler().getExtension());
-
-		// check if custom sling.properties file or bootstrap command exists
-		final Properties additionalProps = this.getSlingProperties(JAR.equals(this.packaging));
-		final String bootstrapCmd = this.getSlingBootstrap(JAR.equals(this.packaging));
-		if ( additionalProps != null || bootstrapCmd != null ) {
-    		// unpack to a temp destination
-		    final File dest = new File(this.tempDirectory, "basejar");
-		    try {
-        		unpack(artifact.getFile(), dest);
-
-        		// patch sling properties
-        		if ( additionalProps != null ) {
-        		    this.patchSlingProperties(dest, additionalProps);
-        		}
-
-        		// patch bootstrap command
+        Artifact artifact = getBaseArtifact();
+        if (artifact == null) {
+            throw new MojoExecutionException(
+                    String.format("Project doesn't have a base dependency of groupId %s and artifactId %s",
+                                    base.getGroupId(), base.getArtifactId()));
+        }
+        File destinationDir = new File(getOutputDirectory(), baseDestination);
+        File destinationFile = new File(destinationDir, artifact
+                .getArtifactId()
+                + "." + artifact.getArtifactHandler().getExtension());
+
+        // check if custom sling.properties file or bootstrap command exists
+        final Properties additionalProps = this.getSlingProperties(JAR.equals(this.packaging));
+        final String bootstrapCmd = this.getSlingBootstrap(JAR.equals(this.packaging));
+        if ( additionalProps != null || bootstrapCmd != null ) {
+            // unpack to a temp destination
+            final File dest = new File(this.tempDirectory, "basejar");
+            try {
+                unpack(artifact.getFile(), dest);
+
+                // patch sling properties
+                if ( additionalProps != null ) {
+                    this.patchSlingProperties(dest, additionalProps);
+                }
+
+                // patch bootstrap command
                 if  ( bootstrapCmd != null ) {
                     this.patchSlingBootstrap(dest, bootstrapCmd);
                 }
 
                 // and repack again
-        		pack(dest, destinationFile);
-		    } finally {
-		        this.tempDirectory.delete();
-		    }
-		} else {
-		    // we can just copy
-    		if (shouldCopy(artifact.getFile(), destinationFile)) {
-    			try {
-    				getLog().info(
-    						String.format("Copying base artifact from %s to %s.",
-    								artifact.getFile(), destinationFile));
-    				FileUtils.copyFile(artifact.getFile(), destinationFile);
-    			} catch (IOException e) {
-    				throw new MojoExecutionException(
-    						"Unable to copy base artifact.", e);
-    			}
-    		} else {
-    			getLog().debug(
-    					String.format("Skipping copy of base artifact from %s.",
-    							artifact.getFile()));
-    		}
-		}
-	}
-
-	private Artifact getBaseArtifact() throws MojoExecutionException {
-		Artifact baseDependency = getBaseDependency();
-		if (baseDependency == null) {
-			return null;
-		}
-
-		return getArtifact(base.getGroupId(), base.getArtifactId(),
-				baseDependency.getVersion(), base.getType(), base
-						.getClassifier());
-
-	}
-
-	private Artifact getBaseDependency() {
-		return (Artifact) project.getArtifactMap().get(
-				base.getGroupId() + ":" + base.getArtifactId());
-	}
-
-	protected File getOutputDirectory() {
-		if (WAR.equals(packaging)) {
-			return warOutputDirectory;
+                pack(dest, destinationFile);
+            } finally {
+                this.tempDirectory.delete();
+            }
+        } else {
+            // we can just copy
+            if (shouldCopy(artifact.getFile(), destinationFile)) {
+                try {
+                    getLog().info(
+                            String.format("Copying base artifact from %s to %s.",
+                                    artifact.getFile(), destinationFile));
+                    FileUtils.copyFile(artifact.getFile(), destinationFile);
+                } catch (IOException e) {
+                    throw new MojoExecutionException(
+                            "Unable to copy base artifact.", e);
+                }
+            } else {
+                getLog().debug(
+                        String.format("Skipping copy of base artifact from %s.",
+                                artifact.getFile()));
+            }
+        }
+    }
+
+    private Artifact getBaseArtifact() throws MojoExecutionException {
+        Artifact baseDependency = getBaseDependency();
+        if (baseDependency == null) {
+            return null;
+        }
+
+        return getArtifact(base.getGroupId(), base.getArtifactId(),
+                baseDependency.getVersion(), base.getType(), base
+                        .getClassifier());
+
+    }
+
+    private Artifact getBaseDependency() {
+        return (Artifact) project.getArtifactMap().get(
+                base.getGroupId() + ":" + base.getArtifactId());
+    }
+
+    protected File getOutputDirectory() {
+        if (WAR.equals(packaging)) {
+            return warOutputDirectory;
+        }
+        return buildOutputDirectory;
+    }
+
+    protected void unpackBaseArtifact() throws MojoExecutionException {
+        Artifact artifact = getBaseDependency();
+        if (artifact == null) {
+            throw new MojoExecutionException(
+                    String
+                            .format(
+                                    "Project doesn't have a base dependency of groupId %s and artifactId %s",
+                                    base.getGroupId(), base.getArtifactId()));
         }
-		return buildOutputDirectory;
-	}
-
-	protected void unpackBaseArtifact() throws MojoExecutionException {
-		Artifact artifact = getBaseDependency();
-		if (artifact == null) {
-			throw new MojoExecutionException(
-					String
-							.format(
-									"Project doesn't have a base dependency of groupId %s and artifactId %s",
-									base.getGroupId(), base.getArtifactId()));
-		}
-		unpack(artifact.getFile(), buildOutputDirectory);
-	}
+        unpack(artifact.getFile(), buildOutputDirectory);
+    }
 
     private void copyConfigurationFiles() throws MojoExecutionException {
         try {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
index 4cdd931..bb12d9d 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
@@ -36,24 +36,24 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 public class ValidateBundleListMojo extends AbstractBundleListMojo {
    
     public void execute() throws MojoExecutionException, MojoFailureException {
-        final BundleList bundleList;
+        final BundleList initializedBundleList;
         if (bundleListFile.exists()) {
             try {
-                bundleList = readBundleList(bundleListFile);
+                initializedBundleList = readBundleList(bundleListFile);
             } catch (IOException e) {
                 throw new MojoExecutionException("Unable to read bundle list file", e);
             } catch (XmlPullParserException e) {
                 throw new MojoExecutionException("Unable to read bundle list file", e);
             }
         } else {
-            bundleList = new BundleList();
+            initializedBundleList = new BundleList();
         }
         
-        addDependencies(bundleList);
+        addDependencies(initializedBundleList);
 
-        interpolateProperties(bundleList);
+        interpolateProperties(initializedBundleList);
         
-        for (StartLevel sl : bundleList.getStartLevels()) {
+        for (StartLevel sl : initializedBundleList.getStartLevels()) {
             for (Bundle bundle : sl.getBundles()) {
                 getArtifact(new ArtifactDefinition(bundle, -1));
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 13/29: SLING-2292 - dependencies added by LaunchpadPluginLifecycleParticipant should be of scope provided

Posted by ro...@apache.org.
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 5d54df55508ba6c5342e359f1ff65b2977858bcf
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Nov 17 21:44:19 2011 +0000

    SLING-2292 - dependencies added by LaunchpadPluginLifecycleParticipant should be of scope provided
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1203382 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/maven/projectsupport/ArtifactDefinition.java    | 9 +++++----
 .../projectsupport/LaunchpadPluginLifecycleParticipant.java      | 8 +++++---
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
index 43b08f6..6af4cb0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -216,8 +216,8 @@ public class ArtifactDefinition {
         bnd.setStartLevel(startLevel);
         return bnd;
     }
-
-    public Dependency toDependency() {
+    
+    public Dependency toDependency(String scope) {
         Dependency dep = new Dependency();
         dep.setArtifactId(artifactId);
         dep.setGroupId(groupId);
@@ -226,6 +226,7 @@ public class ArtifactDefinition {
             dep.setType(type);
         }
         dep.setClassifier(classifier);
+        dep.setScope(scope);
         return dep;
     }
     
@@ -237,8 +238,8 @@ public class ArtifactDefinition {
         return new ArtifactDefinition(dependency, startLevel).toBundle();
     }
 
-    public static Dependency toDependency(Bundle bundle) {
-        return new ArtifactDefinition(bundle, 0).toDependency();
+    public static Dependency toDependency(Bundle bundle, String scope) {
+        return new ArtifactDefinition(bundle, 0).toDependency(scope);
     }
 
 }
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java b/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java
index 606a6a2..57dd147 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java
@@ -50,6 +50,8 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 public class LaunchpadPluginLifecycleParticipant extends AbstractMavenLifecycleParticipant {
 
     private static final String PLUGIN_ID = "maven-launchpad-plugin";
+    
+    private static final String PROVIDED = "provided";
 
     @Requirement
     private Logger log;
@@ -104,12 +106,12 @@ public class LaunchpadPluginLifecycleParticipant extends AbstractMavenLifecycleP
             if (hasPreparePackageExecution()) {
                 if (includeDefaultBundles && !isCurrentArtifact(project, defaultBundleList)) {
                     log.debug(String.format("adding default bundle list (%s) to dependencies of project %s", defaultBundleList, project));
-                    project.getDependencies().add(defaultBundleList.toDependency());
+                    project.getDependencies().add(defaultBundleList.toDependency(PROVIDED));
                 }
 
                 if (hasJarPackagingExecution()) {
                     log.debug(String.format("adding jar web support (%s) to dependencies of project %s", jarWebSupport, project));
-                    project.getDependencies().add(jarWebSupport.toDependency());
+                    project.getDependencies().add(jarWebSupport.toDependency(PROVIDED));
                 }
             }
         }
@@ -134,7 +136,7 @@ public class LaunchpadPluginLifecycleParticipant extends AbstractMavenLifecycleP
             for (StartLevel startLevel : bundleList.getStartLevels()) {
                 for (Bundle bundle : startLevel.getBundles()) {
                     log.debug(String.format("adding bundle (%s) from bundle list to dependencies of project %s", bundle, project));
-                    project.getDependencies().add(ArtifactDefinition.toDependency(bundle));
+                    project.getDependencies().add(ArtifactDefinition.toDependency(bundle, PROVIDED));
                 }
             }
         }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 19/29: SLING-2263 - no longer need to validate bundle lists as SLING-2273 handles that now.

Posted by ro...@apache.org.
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 92b1ba9649e69e7657a7ec8e035363d4fd50f410
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Jan 17 23:17:17 2012 +0000

    SLING-2263 - no longer need to validate bundle lists as SLING-2273 handles that now.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1232640 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/ValidateBundleListMojo.java     | 63 ----------------------
 src/main/resources/META-INF/plexus/components.xml  |  1 -
 2 files changed, 64 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
deleted file mode 100644
index df890cf..0000000
--- a/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.sling.maven.projectsupport;
-
-import static org.apache.sling.maven.projectsupport.BundleListUtils.interpolateProperties;
-import static org.apache.sling.maven.projectsupport.BundleListUtils.readBundleList;
-
-import java.io.IOException;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
-import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-
-/**
- * Validate that the artifacts listed in a bundle list are valid
- *
- * @goal validate-bundle-list
- * @phase validate
- * @requiresDependencyResolution test
- * @description validate that the artifacts listed in a bundle list are valid
- */
-public class ValidateBundleListMojo extends AbstractBundleListMojo {
-
-    public void execute() throws MojoExecutionException, MojoFailureException {
-        final BundleList initializedBundleList;
-        if (bundleListFile.exists()) {
-            try {
-                initializedBundleList = readBundleList(bundleListFile);
-            } catch (IOException e) {
-                throw new MojoExecutionException("Unable to read bundle list file", e);
-            } catch (XmlPullParserException e) {
-                throw new MojoExecutionException("Unable to read bundle list file", e);
-            }
-        } else {
-            initializedBundleList = new BundleList();
-        }
-
-        interpolateProperties(initializedBundleList, project, mavenSession);
-
-        for (StartLevel sl : initializedBundleList.getStartLevels()) {
-            for (Bundle bundle : sl.getBundles()) {
-                getArtifact(new ArtifactDefinition(bundle, -1));
-            }
-        }
-    }
-}
diff --git a/src/main/resources/META-INF/plexus/components.xml b/src/main/resources/META-INF/plexus/components.xml
index 572d1ef..d6fd19c 100644
--- a/src/main/resources/META-INF/plexus/components.xml
+++ b/src/main/resources/META-INF/plexus/components.xml
@@ -28,7 +28,6 @@
             <id>default</id>
             <!-- START SNIPPET: bundle-lifecycle -->
             <phases>
-              <validate>org.apache.sling:maven-launchpad-plugin:validate-bundle-list</validate>
               <package>org.apache.sling:maven-launchpad-plugin:attach-partial-bundle-list</package>
               <install>org.apache.maven.plugins:maven-install-plugin:install</install>
               <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 24/29: SLING-2480 : Add config for maven-sling-plugin to m2e configuration

Posted by ro...@apache.org.
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 29f16774e7ceed134e2ea9c63d79101bcbaa0f56
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed May 16 07:39:13 2012 +0000

    SLING-2480 : Add config for maven-sling-plugin to m2e configuration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1339038 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 19b68a8..77e975e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>12</version>
+        <version>13-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 20/29: removing unused code

Posted by ro...@apache.org.
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 802751bcf4c90705c164993fd89cf17fc06e2d6d
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Jan 17 23:19:19 2012 +0000

    removing unused code
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1232642 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 16 ------------
 .../maven/projectsupport/ArtifactDefinition.java   | 30 ++--------------------
 2 files changed, 2 insertions(+), 44 deletions(-)

diff --git a/pom.xml b/pom.xml
index 60f01af..f7220d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -142,22 +142,6 @@
                 </exclusion>
             </exclusions>
         </dependency>
-        <!-- using utility classes from this plugin -->
-        <dependency>
-            <groupId>org.apache.maven.plugins</groupId>
-            <artifactId>maven-dependency-plugin</artifactId>
-            <version>2.3</version>
-            <exclusions>
-                <exclusion>
-                    <artifactId>maven-project</artifactId>
-                    <groupId>org.apache.maven</groupId>
-                </exclusion>
-                <exclusion>
-                    <artifactId>maven-artifact-manager</artifactId>
-                    <groupId>org.apache.maven</groupId>
-                </exclusion>
-            </exclusions>
-        </dependency>
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-utils</artifactId>
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
index 6af4cb0..edb4271 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -16,12 +16,12 @@
  */
 package org.apache.sling.maven.projectsupport;
 
-import org.apache.maven.artifact.Artifact;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.*;
+
 import org.apache.maven.model.Dependency;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.Xpp3Dom;
-import static org.apache.sling.maven.projectsupport.BundleListUtils.*;
 
 /**
  * The definition of an artifact.
@@ -48,24 +48,6 @@ public class ArtifactDefinition {
 
     public ArtifactDefinition() {
     }
-
-    public ArtifactDefinition(Artifact artifact, int startLevel) {
-        this.groupId = artifact.getGroupId();
-        this.artifactId = artifact.getArtifactId();
-        this.type = artifact.getType();
-        this.version = artifact.getVersion();
-        this.classifier = artifact.getClassifier();
-        this.startLevel = startLevel;
-    }
-
-    public ArtifactDefinition(Dependency dependency, int startLevel) {
-        this.groupId = dependency.getGroupId();
-        this.artifactId = dependency.getArtifactId();
-        this.type = dependency.getType();
-        this.version = dependency.getVersion();
-        this.classifier = dependency.getClassifier();
-        this.startLevel = startLevel;
-    }
     
     public ArtifactDefinition(Bundle bundle, int startLevel) {
         this.groupId = bundle.getGroupId();
@@ -230,14 +212,6 @@ public class ArtifactDefinition {
         return dep;
     }
     
-    public static Bundle toBundle(Artifact artifact, int startLevel) {
-        return new ArtifactDefinition(artifact, startLevel).toBundle();
-    }
-    
-    public static Bundle toBundle(Dependency dependency, int startLevel) {
-        return new ArtifactDefinition(dependency, startLevel).toBundle();
-    }
-
     public static Dependency toDependency(Bundle bundle, String scope) {
         return new ArtifactDefinition(bundle, 0).toDependency(scope);
     }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 16/29: SLING-2331 : Values in partial bundle list should be interpolated Maven style

Posted by ro...@apache.org.
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 5deee1155234cb780189253368e846c38af1ec92
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Dec 19 10:54:42 2011 +0000

    SLING-2331 : Values in partial bundle list should be interpolated Maven style
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1220684 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/AttachPartialBundleListMojo.java      | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

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 aff92b0..64c519b 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -16,6 +16,9 @@
  */
 package org.apache.sling.maven.projectsupport;
 
+import static org.apache.sling.maven.projectsupport.BundleListUtils.interpolateProperties;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.readBundleList;
+
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
@@ -28,7 +31,6 @@ import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.zip.ZipArchiver;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
-import static org.apache.sling.maven.projectsupport.BundleListUtils.readBundleList;
 
 /**
  * Attaches the bundle list as a project artifact.
@@ -60,7 +62,7 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
      * @parameter default-value="${project.build.directory}/bundleListconfig"
      */
     private File configOutputDir;
-    
+
     /**
      * @parameter default-value="${project.build.directory}/list.xml"
      */
@@ -86,16 +88,18 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
         } else {
             initializedBundleList = new BundleList();
         }
-        
+
         addDependencies(initializedBundleList);
-        
-        BundleListXpp3Writer writer = new BundleListXpp3Writer();
+
+        interpolateProperties(initializedBundleList, this.project, this.mavenSession);
+
+        final BundleListXpp3Writer writer = new BundleListXpp3Writer();
         try {
             writer.write(new FileWriter(bundleListOutput), initializedBundleList);
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to write bundle list", e);
         }
-        
+
         project.getArtifact().setFile(bundleListOutput);
 
         this.getLog().info("Attaching bundle list configuration");

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 26/29: Use released versions

Posted by ro...@apache.org.
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 d3b3dde7f9e14aec61359f1c1c02e47f822ad0aa
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jul 10 11:07:18 2012 +0000

    Use released versions
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1359601 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b39685c..57b09bc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>14-SNAPSHOT</version>
+        <version>13</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 05/29: SLING-2238 - doing property interpolation on bundle list

Posted by ro...@apache.org.
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 bc03898e968409c4cb829df33b4202d4b50938ff
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Oct 6 17:03:55 2011 +0000

    SLING-2238 - doing property interpolation on bundle list
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1179709 13f79535-47bb-0310-9956-ffa450edef68
---
 .../AbstractUsingBundleListMojo.java               | 53 ++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 60898d6..75bceb5 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -21,6 +21,7 @@ import java.io.FileInputStream;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.Reader;
+import java.util.Arrays;
 import java.util.Enumeration;
 import java.util.List;
 import java.util.Properties;
@@ -40,13 +41,21 @@ import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.settings.Settings;
 import org.apache.maven.shared.filtering.MavenFileFilter;
 import org.apache.maven.shared.filtering.MavenFilteringException;
 import org.apache.maven.shared.filtering.PropertyUtils;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
+import org.codehaus.plexus.interpolation.InterpolationException;
+import org.codehaus.plexus.interpolation.Interpolator;
+import org.codehaus.plexus.interpolation.PrefixedObjectValueSource;
+import org.codehaus.plexus.interpolation.PropertiesBasedValueSource;
+import org.codehaus.plexus.interpolation.StringSearchInterpolator;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -422,9 +431,53 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
 
         initBundleList(bundleList);
 
+        interpolateProperties(bundleList);
+
         rewriteBundleList(bundleList);
     }
 
+    private void interpolateProperties(BundleList bundleList) throws MojoExecutionException {
+        Interpolator interpolator = createInterpolator();
+        for (final StartLevel sl : bundleList.getStartLevels()) {
+            for (final Bundle bndl : sl.getBundles()) {
+                try {
+                    bndl.setArtifactId(interpolator.interpolate(bndl.getArtifactId()));
+                    bndl.setGroupId(interpolator.interpolate(bndl.getGroupId()));
+                    bndl.setVersion(interpolator.interpolate(bndl.getVersion()));
+                    bndl.setClassifier(interpolator.interpolate(bndl.getClassifier()));
+                    bndl.setType(interpolator.interpolate(bndl.getType()));
+                } catch (InterpolationException e) {
+                    throw new MojoExecutionException("Unable to interpolate properties for bundle " + bndl.toString(), e);
+                }
+            }
+        }
+
+    }
+
+    private Interpolator createInterpolator() {
+        StringSearchInterpolator interpolator = new StringSearchInterpolator();
+
+        final Properties props = new Properties();
+        props.putAll(project.getProperties());
+        props.putAll(mavenSession.getExecutionProperties());
+
+        interpolator.addValueSource(new PropertiesBasedValueSource(props));
+
+        // add ${project.foo}
+        interpolator.addValueSource(new PrefixedObjectValueSource(Arrays.asList("project", "pom"), project, true));
+
+        // add ${session.foo}
+        interpolator.addValueSource(new PrefixedObjectValueSource("session", mavenSession));
+
+        // add ${settings.foo}
+        final Settings settings = mavenSession.getSettings();
+        if (settings != null) {
+            interpolator.addValueSource(new PrefixedObjectValueSource("settings", settings));
+        }
+
+        return interpolator;
+    }
+
     private void rewriteBundleList(BundleList bundleList) throws MojoExecutionException {
         if (rewriteRuleFiles != null) {
             KnowledgeBase knowledgeBase = createKnowledgeBase(rewriteRuleFiles);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 22/29: SLING-2386 : It should be possible to remove bundles from an inherited partial bundle list. Apply patch from Timo Naroska

Posted by ro...@apache.org.
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 023486f96e7f8d348685d3e25f0f1d120e186347
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Jan 31 07:47:17 2012 +0000

    SLING-2386 : It should be possible to remove bundles from an inherited partial bundle list. Apply patch from Timo Naroska
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1238220 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/projectsupport/AbstractUsingBundleListMojo.java  | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 90dd76f..991f2be 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -227,18 +227,14 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                 initializedBundleList.merge(readBundleList(bundleListFile));
             }
         }
+        // add additional bundles
         if (additionalBundles != null) {
             for (ArtifactDefinition def : additionalBundles) {
                 initializedBundleList.add(def.toBundle());
             }
         }
 
-        if (bundleExclusions != null) {
-            for (ArtifactDefinition def : bundleExclusions) {
-                initializedBundleList.remove(def.toBundle(), false);
-            }
-        }
-
+        // check for partial bundle lists
         final Set<Artifact> dependencies = project.getDependencyArtifacts();
         for (Artifact artifact : dependencies) {
             if (PARTIAL.equals(artifact.getType())) {
@@ -249,6 +245,12 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
             }
         }
 
+        // handle exclusions
+        if (bundleExclusions != null) {
+            for (ArtifactDefinition def : bundleExclusions) {
+                initializedBundleList.remove(def.toBundle(), false);
+            }
+        }
 
         initBundleList(initializedBundleList);
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 01/29: [maven-release-plugin] prepare for next development iteration

Posted by ro...@apache.org.
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 f02592e54db853d370fde4df78c5f1bfd6936d49
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Sep 6 07:53:56 2011 +0000

    [maven-release-plugin] prepare for next development iteration
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1165546 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 93fe716..b5c1da4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
 
     <groupId>org.apache.sling</groupId>
     <artifactId>maven-launchpad-plugin</artifactId>
-    <version>2.1.0</version>
+    <version>2.1.1-SNAPSHOT</version>
     <packaging>maven-plugin</packaging>
 
     <name>Apache Sling Launchpad Maven Plugin</name>
@@ -32,9 +32,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.1.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.1.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.1.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 08/29: SLING-2263 - validating partial bundle lists during their lifecycle

Posted by ro...@apache.org.
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 c2c4f2fecb167c80f17393bbfd13dc246673a48c
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Thu Nov 3 21:49:04 2011 +0000

    SLING-2263 - validating partial bundle lists during their lifecycle
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1197323 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/AbstractBundleListMojo.java     | 171 +++++++++++++++++++++
 .../AbstractUsingBundleListMojo.java               | 170 +-------------------
 .../projectsupport/ValidateBundleListMojo.java     |  62 ++++++++
 src/main/resources/META-INF/plexus/components.xml  |   1 +
 4 files changed, 235 insertions(+), 169 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index 226e5fb..bd5e788 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -19,14 +19,38 @@ package org.apache.sling.maven.projectsupport;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.util.Arrays;
 import java.util.List;
+import java.util.Properties;
 
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.artifact.versioning.ArtifactVersion;
+import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
+import org.apache.maven.artifact.versioning.VersionRange;
+import org.apache.maven.execution.MavenSession;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
+import org.apache.maven.settings.Settings;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
+import org.codehaus.plexus.interpolation.InterpolationException;
+import org.codehaus.plexus.interpolation.Interpolator;
+import org.codehaus.plexus.interpolation.PrefixedObjectValueSource;
+import org.codehaus.plexus.interpolation.PropertiesBasedValueSource;
+import org.codehaus.plexus.interpolation.StringSearchInterpolator;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 public abstract class AbstractBundleListMojo extends AbstractMojo {
@@ -104,12 +128,58 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
     protected boolean ignoreBundleListConfig;
 
     /**
+     * @parameter expression="${session}
+     * @required
+     * @readonly
+     */
+    protected MavenSession mavenSession;
+
+    /**
      * The start level to be used when generating the bundle list.
      * 
      * @parameter default-value="-1"
      */
     private int dependencyStartLevel;
 
+    /**
+     * Used to look up Artifacts in the remote repository.
+     *
+     * @component
+     */
+    private ArtifactFactory factory;
+
+    /**
+     * Used to look up Artifacts in the remote repository.
+     *
+     * @component hint="maven"
+     */
+    private ArtifactMetadataSource metadataSource;
+
+    /**
+     * Location of the local repository.
+     *
+     * @parameter expression="${localRepository}"
+     * @readonly
+     * @required
+     */
+    private ArtifactRepository local;
+
+    /**
+     * List of Remote Repositories used by the resolver.
+     *
+     * @parameter expression="${project.remoteArtifactRepositories}"
+     * @readonly
+     * @required
+     */
+    private List<?> remoteRepos;
+
+    /**
+     * Used to look up Artifacts in the remote repository.
+     *
+     * @component
+     */
+    private ArtifactResolver resolver;
+
     protected File getConfigDirectory() {
         return this.configDirectory;
     }
@@ -135,4 +205,105 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
             }
         }
     }
+
+    protected void interpolateProperties(BundleList bundleList) throws MojoExecutionException {
+        Interpolator interpolator = createInterpolator();
+        for (final StartLevel sl : bundleList.getStartLevels()) {
+            for (final Bundle bndl : sl.getBundles()) {
+                try {
+                    bndl.setArtifactId(interpolator.interpolate(bndl.getArtifactId()));
+                    bndl.setGroupId(interpolator.interpolate(bndl.getGroupId()));
+                    bndl.setVersion(interpolator.interpolate(bndl.getVersion()));
+                    bndl.setClassifier(interpolator.interpolate(bndl.getClassifier()));
+                    bndl.setType(interpolator.interpolate(bndl.getType()));
+                } catch (InterpolationException e) {
+                    throw new MojoExecutionException("Unable to interpolate properties for bundle " + bndl.toString(), e);
+                }
+            }
+        }
+
+    }
+
+    private Interpolator createInterpolator() {
+        StringSearchInterpolator interpolator = new StringSearchInterpolator();
+
+        final Properties props = new Properties();
+        props.putAll(project.getProperties());
+        props.putAll(mavenSession.getExecutionProperties());
+
+        interpolator.addValueSource(new PropertiesBasedValueSource(props));
+
+        // add ${project.foo}
+        interpolator.addValueSource(new PrefixedObjectValueSource(Arrays.asList("project", "pom"), project, true));
+
+        // add ${session.foo}
+        interpolator.addValueSource(new PrefixedObjectValueSource("session", mavenSession));
+
+        // add ${settings.foo}
+        final Settings settings = mavenSession.getSettings();
+        if (settings != null) {
+            interpolator.addValueSource(new PrefixedObjectValueSource("settings", settings));
+        }
+
+        return interpolator;
+    }
+
+    /**
+     * Get a resolved Artifact from the coordinates found in the artifact
+     * definition.
+     *
+     * @param def the artifact definition
+     * @return the artifact, which has been resolved
+     * @throws MojoExecutionException
+     */
+    protected Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException {
+        return getArtifact(def.getGroupId(), def.getArtifactId(), def.getVersion(), def.getType(), def.getClassifier());
+    }
+
+    /**
+     * Get a resolved Artifact from the coordinates provided
+     *
+     * @return the artifact, which has been resolved.
+     * @throws MojoExecutionException
+     */
+    protected Artifact getArtifact(String groupId, String artifactId, String version, String type, String classifier)
+            throws MojoExecutionException {
+                Artifact artifact;
+                VersionRange vr;
+            
+                try {
+                    vr = VersionRange.createFromVersionSpec(version);
+                } catch (InvalidVersionSpecificationException e) {
+                    vr = VersionRange.createFromVersion(version);
+                }
+            
+                if (StringUtils.isEmpty(classifier)) {
+                    artifact = factory.createDependencyArtifact(groupId, artifactId, vr, type, null, Artifact.SCOPE_COMPILE);
+                } else {
+                    artifact = factory.createDependencyArtifact(groupId, artifactId, vr, type, classifier,
+                            Artifact.SCOPE_COMPILE);
+                }
+            
+                // This code kicks in when the version specifier is a range.
+                if (vr.getRecommendedVersion() == null) {
+                    try {
+                        List<?> availVersions = metadataSource.retrieveAvailableVersions(artifact, local, remoteRepos);
+                        ArtifactVersion resolvedVersion = vr.matchVersion(availVersions);
+                        artifact.setVersion(resolvedVersion.toString());
+                    } catch (ArtifactMetadataRetrievalException e) {
+                        throw new MojoExecutionException("Unable to find version for artifact", e);
+                    }
+            
+                }
+            
+                try {
+                    resolver.resolve(artifact, remoteRepos, local);
+                } catch (ArtifactResolutionException e) {
+                    throw new MojoExecutionException("Unable to resolve artifact.", e);
+                } catch (ArtifactNotFoundException e) {
+                    throw new MojoExecutionException("Unable to find artifact.", e);
+                }
+                return artifact;
+            }
+
 }
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 6117498..56cc6c9 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -20,42 +20,20 @@ import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.Reader;
-import java.util.Arrays;
 import java.util.Enumeration;
-import java.util.List;
 import java.util.Properties;
 import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.versioning.ArtifactVersion;
-import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.settings.Settings;
 import org.apache.maven.shared.filtering.MavenFileFilter;
 import org.apache.maven.shared.filtering.MavenFilteringException;
 import org.apache.maven.shared.filtering.PropertyUtils;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
-import org.codehaus.plexus.interpolation.InterpolationException;
-import org.codehaus.plexus.interpolation.Interpolator;
-import org.codehaus.plexus.interpolation.PrefixedObjectValueSource;
-import org.codehaus.plexus.interpolation.PropertiesBasedValueSource;
-import org.codehaus.plexus.interpolation.StringSearchInterpolator;
 import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.drools.KnowledgeBase;
 import org.drools.KnowledgeBaseFactory;
@@ -113,20 +91,6 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
     private ArtifactDefinition[] bundleExclusions;
 
     /**
-     * Used to look up Artifacts in the remote repository.
-     *
-     * @component
-     */
-    private ArtifactFactory factory;
-
-    /**
-     * Used to look up Artifacts in the remote repository.
-     *
-     * @component hint="maven"
-     */
-    private ArtifactMetadataSource metadataSource;
-
-    /**
      * If true, include the default bundles.
      *
      * @parameter default-value="true"
@@ -134,43 +98,11 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
     private boolean includeDefaultBundles;
 
     /**
-     * Location of the local repository.
-     *
-     * @parameter expression="${localRepository}"
-     * @readonly
-     * @required
-     */
-    private ArtifactRepository local;
-
-    /**
-     * List of Remote Repositories used by the resolver.
-     *
-     * @parameter expression="${project.remoteArtifactRepositories}"
-     * @readonly
-     * @required
-     */
-    private List<?> remoteRepos;
-
-    /**
-     * Used to look up Artifacts in the remote repository.
-     *
-     * @component
-     */
-    private ArtifactResolver resolver;
-
-    /**
      * @parameter
      */
     private File[] rewriteRuleFiles;
 
     /**
-     * @parameter expression="${session}
-     * @required
-     * @readonly
-     */
-    protected MavenSession mavenSession;
-
-    /**
      * @component
      */
     protected MavenFileFilter mavenFileFilter;
@@ -232,64 +164,6 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      */
     protected abstract void executeWithArtifacts() throws MojoExecutionException, MojoFailureException;
 
-    /**
-     * Get a resolved Artifact from the coordinates found in the artifact
-     * definition.
-     *
-     * @param def the artifact definition
-     * @return the artifact, which has been resolved
-     * @throws MojoExecutionException
-     */
-    protected Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException {
-        return getArtifact(def.getGroupId(), def.getArtifactId(), def.getVersion(), def.getType(), def.getClassifier());
-    }
-
-    /**
-     * Get a resolved Artifact from the coordinates provided
-     *
-     * @return the artifact, which has been resolved.
-     * @throws MojoExecutionException
-     */
-    protected Artifact getArtifact(String groupId, String artifactId, String version, String type, String classifier)
-            throws MojoExecutionException {
-        Artifact artifact;
-        VersionRange vr;
-
-        try {
-            vr = VersionRange.createFromVersionSpec(version);
-        } catch (InvalidVersionSpecificationException e) {
-            vr = VersionRange.createFromVersion(version);
-        }
-
-        if (StringUtils.isEmpty(classifier)) {
-            artifact = factory.createDependencyArtifact(groupId, artifactId, vr, type, null, Artifact.SCOPE_COMPILE);
-        } else {
-            artifact = factory.createDependencyArtifact(groupId, artifactId, vr, type, classifier,
-                    Artifact.SCOPE_COMPILE);
-        }
-
-        // This code kicks in when the version specifier is a range.
-        if (vr.getRecommendedVersion() == null) {
-            try {
-                List<?> availVersions = metadataSource.retrieveAvailableVersions(artifact, local, remoteRepos);
-                ArtifactVersion resolvedVersion = vr.matchVersion(availVersions);
-                artifact.setVersion(resolvedVersion.toString());
-            } catch (ArtifactMetadataRetrievalException e) {
-                throw new MojoExecutionException("Unable to find version for artifact", e);
-            }
-
-        }
-
-        try {
-            resolver.resolve(artifact, remoteRepos, local);
-        } catch (ArtifactResolutionException e) {
-            throw new MojoExecutionException("Unable to resolve artifact.", e);
-        } catch (ArtifactNotFoundException e) {
-            throw new MojoExecutionException("Unable to find artifact.", e);
-        }
-        return artifact;
-    }
-
     protected BundleList getBundleList() {
         return bundleList;
     }
@@ -434,49 +308,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
 
         rewriteBundleList(bundleList);
     }
-
-    private void interpolateProperties(BundleList bundleList) throws MojoExecutionException {
-        Interpolator interpolator = createInterpolator();
-        for (final StartLevel sl : bundleList.getStartLevels()) {
-            for (final Bundle bndl : sl.getBundles()) {
-                try {
-                    bndl.setArtifactId(interpolator.interpolate(bndl.getArtifactId()));
-                    bndl.setGroupId(interpolator.interpolate(bndl.getGroupId()));
-                    bndl.setVersion(interpolator.interpolate(bndl.getVersion()));
-                    bndl.setClassifier(interpolator.interpolate(bndl.getClassifier()));
-                    bndl.setType(interpolator.interpolate(bndl.getType()));
-                } catch (InterpolationException e) {
-                    throw new MojoExecutionException("Unable to interpolate properties for bundle " + bndl.toString(), e);
-                }
-            }
-        }
-
-    }
-
-    private Interpolator createInterpolator() {
-        StringSearchInterpolator interpolator = new StringSearchInterpolator();
-
-        final Properties props = new Properties();
-        props.putAll(project.getProperties());
-        props.putAll(mavenSession.getExecutionProperties());
-
-        interpolator.addValueSource(new PropertiesBasedValueSource(props));
-
-        // add ${project.foo}
-        interpolator.addValueSource(new PrefixedObjectValueSource(Arrays.asList("project", "pom"), project, true));
-
-        // add ${session.foo}
-        interpolator.addValueSource(new PrefixedObjectValueSource("session", mavenSession));
-
-        // add ${settings.foo}
-        final Settings settings = mavenSession.getSettings();
-        if (settings != null) {
-            interpolator.addValueSource(new PrefixedObjectValueSource("settings", settings));
-        }
-
-        return interpolator;
-    }
-
+    
     private void rewriteBundleList(BundleList bundleList) throws MojoExecutionException {
         if (rewriteRuleFiles != null) {
             KnowledgeBase knowledgeBase = createKnowledgeBase(rewriteRuleFiles);
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
new file mode 100644
index 0000000..4cdd931
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ValidateBundleListMojo.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.sling.maven.projectsupport;
+
+import java.io.IOException;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+/**
+ * Validate that the artifacts listed in a bundle list are valid
+ *
+ * @goal validate-bundle-list
+ * @phase validate
+ * @requiresDependencyResolution test
+ * @description validate that the artifacts listed in a bundle list are valid
+ */
+public class ValidateBundleListMojo extends AbstractBundleListMojo {
+   
+    public void execute() throws MojoExecutionException, MojoFailureException {
+        final BundleList bundleList;
+        if (bundleListFile.exists()) {
+            try {
+                bundleList = readBundleList(bundleListFile);
+            } catch (IOException e) {
+                throw new MojoExecutionException("Unable to read bundle list file", e);
+            } catch (XmlPullParserException e) {
+                throw new MojoExecutionException("Unable to read bundle list file", e);
+            }
+        } else {
+            bundleList = new BundleList();
+        }
+        
+        addDependencies(bundleList);
+
+        interpolateProperties(bundleList);
+        
+        for (StartLevel sl : bundleList.getStartLevels()) {
+            for (Bundle bundle : sl.getBundles()) {
+                getArtifact(new ArtifactDefinition(bundle, -1));
+            }
+        }
+    }
+}
diff --git a/src/main/resources/META-INF/plexus/components.xml b/src/main/resources/META-INF/plexus/components.xml
index d6fd19c..572d1ef 100644
--- a/src/main/resources/META-INF/plexus/components.xml
+++ b/src/main/resources/META-INF/plexus/components.xml
@@ -28,6 +28,7 @@
             <id>default</id>
             <!-- START SNIPPET: bundle-lifecycle -->
             <phases>
+              <validate>org.apache.sling:maven-launchpad-plugin:validate-bundle-list</validate>
               <package>org.apache.sling:maven-launchpad-plugin:attach-partial-bundle-list</package>
               <install>org.apache.maven.plugins:maven-install-plugin:install</install>
               <deploy>org.apache.maven.plugins:maven-deploy-plugin:deploy</deploy>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 27/29: Use released version instead of older snapshot

Posted by ro...@apache.org.
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 2165db9902196186a1d9489211b0952d3000896c
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 12 14:40:28 2012 +0000

    Use released version instead of older snapshot
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1360705 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 57b09bc..5219710 100644
--- a/pom.xml
+++ b/pom.xml
@@ -160,12 +160,12 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.base</artifactId>
-            <version>2.3.1-SNAPSHOT</version>
+            <version>2.4.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.base</artifactId>
-            <version>2.3.1-SNAPSHOT</version>
+            <version>2.4.0</version>
             <classifier>app</classifier>
         </dependency>
         <dependency>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 23/29: SLING-2434 - upgrding to Drools 2.3.1.Final as that's in Maven Central

Posted by ro...@apache.org.
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 5099e0e31562b6266210c5585d5680659c55c95c
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Mar 13 15:28:01 2012 +0000

    SLING-2434 - upgrding to Drools 2.3.1.Final as that's in Maven Central
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1300189 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/pom.xml b/pom.xml
index f7220d6..19b68a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -198,7 +198,7 @@
         <dependency>
             <groupId>org.drools</groupId>
             <artifactId>drools-compiler</artifactId>
-            <version>5.1.1</version>
+            <version>5.3.1.Final</version>
         </dependency>
         <dependency>
             <groupId>org.codehaus.mojo</groupId>
@@ -216,17 +216,4 @@
             </exclusions>
         </dependency>
     </dependencies>
-
-    <repositories>
-        <repository>
-            <id>jboss</id>
-            <url>https://repository.jboss.org/nexus/content/repositories/releases/</url>
-            <releases>
-                <enabled>true</enabled>
-            </releases>
-            <snapshots>
-                <enabled>false</enabled>
-            </snapshots>
-        </repository>
-    </repositories>
 </project>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 28/29: [maven-release-plugin] prepare release maven-launchpad-plugin-2.1.2

Posted by ro...@apache.org.
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 069d5809e84093b6d5b02c6231d1a63cae207eb9
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Aug 15 13:17:40 2012 +0000

    [maven-release-plugin] prepare release maven-launchpad-plugin-2.1.2
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1373388 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5219710..c5ac9bc 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     </parent>
 
     <artifactId>maven-launchpad-plugin</artifactId>
-    <version>2.1.1-SNAPSHOT</version>
+    <version>2.1.2</version>
     <packaging>maven-plugin</packaging>
 
     <name>Apache Sling Launchpad Maven Plugin</name>
@@ -31,9 +31,9 @@
     </description>
 
     <scm>
-        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.1.2</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.1.2</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.1.2</url>
     </scm>
 
     <build>

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 17/29: SLING-2332 : Partial bundle list should be attachable to any maven project

Posted by ro...@apache.org.
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 <cz...@apache.org>
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
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 02/29: Use latest snapshot after release

Posted by ro...@apache.org.
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 4b579904f4996318a7feb9100b53f792d2f4f62b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Sep 6 07:58:39 2011 +0000

    Use latest snapshot after release
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1165548 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index b5c1da4..9d9ec60 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>11</version>
+        <version>13-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 04/29: SLING-2212 : When merging bundle lists, the highest version should win

Posted by ro...@apache.org.
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 1a827c3d125bd43e408f82558131b6e1a116367e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 9 09:14:25 2011 +0000

    SLING-2212 : When merging bundle lists, the highest version should win
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1167055 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                    |  5 +++++
 .../maven/projectsupport/bundlelist/BaseBundleList.java    | 14 +++++++++++---
 2 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/pom.xml b/pom.xml
index c138789..2cb1d42 100644
--- a/pom.xml
+++ b/pom.xml
@@ -162,6 +162,11 @@
             <version>1.0</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.maven.shared</groupId>
+            <artifactId>maven-osgi</artifactId>
+            <version>0.2.0</version>
+        </dependency>
+        <dependency>
             <groupId>org.drools</groupId>
             <artifactId>drools-compiler</artifactId>
             <version>5.1.1</version>
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
index 85cc7a8..1c7bc56 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
@@ -18,9 +18,12 @@ package org.apache.sling.maven.projectsupport.bundlelist;
 
 import java.util.List;
 
+import org.apache.maven.shared.osgi.DefaultMaven2OsgiConverter;
+import org.apache.maven.shared.osgi.Maven2OsgiConverter;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
+import org.osgi.framework.Version;
 
 public abstract class BaseBundleList {
 
@@ -78,7 +81,14 @@ public abstract class BaseBundleList {
     private void add(StartLevel mergeStartLevel, Bundle newBnd) {
         Bundle current = get(newBnd, false);
         if (current != null) {
-            current.setVersion(newBnd.getVersion());
+            final Maven2OsgiConverter converter = new DefaultMaven2OsgiConverter();
+
+            // compare versions, the highest will be used
+            final Version newVersion = new Version(converter.getVersion(newBnd.getVersion()));
+            final Version oldVersion = new Version(converter.getVersion(current.getVersion()));
+            if ( newVersion.compareTo(oldVersion) > 0 ) {
+                current.setVersion(newBnd.getVersion());
+            }
         } else {
             StartLevel startLevel = null;
             if ( mergeStartLevel == null || newBnd.getStartLevel() != 0) {
@@ -88,7 +98,6 @@ public abstract class BaseBundleList {
             }
             startLevel.getBundles().add(newBnd);
         }
-
     }
 
     private StartLevel getOrCreateStartLevel(int startLevel) {
@@ -103,5 +112,4 @@ public abstract class BaseBundleList {
         sl.setRawLevel(startLevel);
         return sl;
     }
-
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 07/29: SLING-2194 - generating bundle list content from a project's dependencies; refactoring testing projects to use this feature.

Posted by ro...@apache.org.
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 b497a89d8584050d2e1ee4f27c5e6a35116e5774
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Oct 19 19:14:54 2011 +0000

    SLING-2194 - generating bundle list content from a project's dependencies; refactoring testing projects to use this feature.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1186417 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |  1 -
 .../projectsupport/AbstractBundleListMojo.java     | 42 ++++++++++++++++++++
 .../AbstractUsingBundleListMojo.java               | 13 +-----
 .../maven/projectsupport/ArtifactDefinition.java   | 46 +++++++++++++++++-----
 .../AttachPartialBundleListMojo.java               | 36 ++++++++++++++---
 5 files changed, 111 insertions(+), 27 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2cb1d42..3265d3d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,6 @@
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 
-    <groupId>org.apache.sling</groupId>
     <artifactId>maven-launchpad-plugin</artifactId>
     <version>2.1.1-SNAPSHOT</version>
     <packaging>maven-plugin</packaging>
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index 912fa3d..226e5fb 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -17,10 +17,17 @@
 package org.apache.sling.maven.projectsupport;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.List;
 
+import org.apache.maven.model.Dependency;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 public abstract class AbstractBundleListMojo extends AbstractMojo {
 
@@ -90,7 +97,42 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
      */
     protected File standaloneSlingBootstrap;
 
+    /**
+     * @parameter expression="${ignoreBundleListConfig}"
+     *            default-value="false"
+     */
+    protected boolean ignoreBundleListConfig;
+
+    /**
+     * The start level to be used when generating the bundle list.
+     * 
+     * @parameter default-value="-1"
+     */
+    private int dependencyStartLevel;
+
     protected File getConfigDirectory() {
         return this.configDirectory;
     }
+
+    protected BundleList readBundleList(File file) throws IOException, XmlPullParserException {
+        BundleListXpp3Reader reader = new BundleListXpp3Reader();
+        FileInputStream fis = new FileInputStream(file);
+        try {
+            return reader.read(fis);
+        } finally {
+            fis.close();
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    protected void addDependencies(final BundleList bundleList) {
+        if (dependencyStartLevel >= 0) {
+            final List<Dependency> dependencies = project.getDependencies();
+            for (Dependency dependency : dependencies) {
+                if (!PARTIAL.equals(dependency.getType())) {
+                    bundleList.add(ArtifactDefinition.toBundle(dependency, dependencyStartLevel));
+                }
+            }
+        }
+    }
 }
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index b6fc886..6117498 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -17,7 +17,6 @@
 package org.apache.sling.maven.projectsupport;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.Reader;
@@ -48,7 +47,6 @@ import org.apache.maven.shared.filtering.PropertyUtils;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
 import org.codehaus.plexus.interpolation.InterpolationException;
@@ -359,6 +357,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                 bundleList.add(def.toBundle());
             }
         }
+        addDependencies(bundleList);
         if (bundleExclusions != null) {
             for (ArtifactDefinition def : bundleExclusions) {
                 bundleList.remove(def.toBundle(), false);
@@ -513,16 +512,6 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         return base;
     }
 
-    private BundleList readBundleList(File file) throws IOException, XmlPullParserException {
-        BundleListXpp3Reader reader = new BundleListXpp3Reader();
-        FileInputStream fis = new FileInputStream(file);
-        try {
-            return reader.read(fis);
-        } finally {
-            fis.close();
-        }
-    }
-
     private void copyProperties(final Properties source, final Properties dest) {
         final Enumeration<Object> keys = source.keys();
         while ( keys.hasMoreElements() ) {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
index 801b879..e5dab31 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -16,6 +16,8 @@
  */
 package org.apache.sling.maven.projectsupport;
 
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.model.Dependency;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.codehaus.plexus.util.StringUtils;
 
@@ -45,16 +47,34 @@ public class ArtifactDefinition {
     public ArtifactDefinition() {
     }
 
+    public ArtifactDefinition(Artifact artifact, int startLevel) {
+        this.groupId = artifact.getGroupId();
+        this.artifactId = artifact.getArtifactId();
+        this.type = artifact.getType();
+        this.version = artifact.getVersion();
+        this.classifier = artifact.getClassifier();
+        this.startLevel = startLevel;
+    }
+
+    public ArtifactDefinition(Dependency dependency, int startLevel) {
+        this.groupId = dependency.getGroupId();
+        this.artifactId = dependency.getArtifactId();
+        this.type = dependency.getType();
+        this.version = dependency.getVersion();
+        this.classifier = dependency.getClassifier();
+        this.startLevel = startLevel;
+    }
+    
     public ArtifactDefinition(Bundle bundle, int startLevel) {
-		this.groupId = bundle.getGroupId();
-		this.artifactId = bundle.getArtifactId();
-		this.type = bundle.getType();
-		this.version = bundle.getVersion();
-		this.classifier = bundle.getClassifier();
-		this.startLevel = startLevel;
-	}
-
-	public String getArtifactId() {
+        this.groupId = bundle.getGroupId();
+        this.artifactId = bundle.getArtifactId();
+        this.type = bundle.getType();
+        this.version = bundle.getVersion();
+        this.classifier = bundle.getClassifier();
+        this.startLevel = startLevel;
+    }
+
+    public String getArtifactId() {
         return artifactId;
     }
 
@@ -185,5 +205,13 @@ public class ArtifactDefinition {
         bnd.setStartLevel(startLevel);
         return bnd;
     }
+    
+    public static Bundle toBundle(Artifact artifact, int startLevel) {
+        return new ArtifactDefinition(artifact, startLevel).toBundle();
+    }
+    
+    public static Bundle toBundle(Dependency dependency, int startLevel) {
+        return new ArtifactDefinition(dependency, startLevel).toBundle();
+    }
 
 }
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 40f5732..ed2c8ac 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -17,13 +17,17 @@
 package org.apache.sling.maven.projectsupport;
 
 import java.io.File;
+import java.io.FileWriter;
 import java.io.IOException;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Writer;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.zip.ZipArchiver;
 import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
  * Attaches the bundle list as a project artifact.
@@ -54,12 +58,11 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
      * @parameter default-value="${project.build.directory}/bundleListconfig"
      */
     private File configOutputDir;
-
+    
     /**
-     * @parameter expression="${ignoreBundleListConfig}"
-     *            default-value="false"
+     * @parameter default-value="${project.build.directory}/list.xml"
      */
-    private boolean ignoreBundleListConfig;
+    private File bundleListOutput;
 
     /**
      * The zip archiver.
@@ -69,7 +72,30 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
     private ZipArchiver zipArchiver;
 
     public void execute() throws MojoExecutionException, MojoFailureException {
-        project.getArtifact().setFile(bundleListFile);
+        final BundleList bundleList;
+        if (bundleListFile.exists()) {
+            try {
+                bundleList = readBundleList(bundleListFile);
+            } catch (IOException e) {
+                throw new MojoExecutionException("Unable to read bundle list file", e);
+            } catch (XmlPullParserException e) {
+                throw new MojoExecutionException("Unable to read bundle list file", e);
+            }
+        } else {
+            bundleList = new BundleList();
+        }
+        
+        addDependencies(bundleList);
+        
+        BundleListXpp3Writer writer = new BundleListXpp3Writer();
+        try {
+            writer.write(new FileWriter(bundleListOutput), bundleList);
+        } catch (IOException e) {
+            throw new MojoExecutionException("Unable to write bundle list", e);
+        }
+        
+        project.getArtifact().setFile(bundleListOutput);
+
         this.getLog().info("Attaching bundle list configuration");
         try {
             this.attachConfigurations();

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 15/29: SLING-2203 : Allow for better configuration of sling home folder

Posted by ro...@apache.org.
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 52f90beaae06103a9bef07b700800cb11fd80abf
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Dec 1 15:11:02 2011 +0000

    SLING-2203 : Allow for better configuration of sling home folder
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1209114 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                                               | 4 ++--
 .../sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java     | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 7560e23..60f01af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -176,12 +176,12 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.base</artifactId>
-            <version>2.3.0</version>
+            <version>2.3.1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.base</artifactId>
-            <version>2.3.0</version>
+            <version>2.3.1-SNAPSHOT</version>
             <classifier>app</classifier>
         </dependency>
         <dependency>
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
index f16fa2a..867535e 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -267,6 +267,9 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
 
             props.put(SharedConstants.SLING_HOME, slingHome);
 
+            // ensure launchpad is set
+            props.put(SharedConstants.SLING_LAUNCHPAD, slingHome);
+
             if (forceBundleLoad) {
                 props.put(SharedConstants.FORCE_PACKAGE_BUNDLE_LOADING, "true");
             }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 25/29: Update to latest parent pom

Posted by ro...@apache.org.
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 54d5e7f28fc548970fdeda6d83917675d5629415
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 5 09:29:47 2012 +0000

    Update to latest parent pom
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1357521 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 77e975e..b39685c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>13-SNAPSHOT</version>
+        <version>14-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 03/29: using latest releases

Posted by ro...@apache.org.
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 d32ced53ccd6c412759bd42af396c25fd9123737
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Sep 7 14:35:51 2011 +0000

    using latest releases
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1166199 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 9d9ec60..c138789 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>13-SNAPSHOT</version>
+        <version>12</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 14/29: SLING-2310 : Attach bundle list goal should also add configuration artifact

Posted by ro...@apache.org.
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 c3a7120571654dbf48d1fbd5be2d9f18a54ca8cd
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Nov 30 14:03:21 2011 +0000

    SLING-2310 : Attach bundle list goal should also add configuration artifact
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1208441 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/projectsupport/AttachBundleListMojo.java | 94 +++++++++++++++++++++-
 1 file changed, 93 insertions(+), 1 deletion(-)

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 e7d9977..ea21b3a 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
@@ -17,12 +17,16 @@
 package org.apache.sling.maven.projectsupport;
 
 import java.io.File;
+import java.io.FileOutputStream;
 import java.io.FileWriter;
 import java.io.IOException;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Writer;
+import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.zip.ZipArchiver;
+import org.codehaus.plexus.util.FileUtils;
 
 /**
  * Attaches the bundle list as a project artifact.
@@ -43,7 +47,19 @@ public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
      */
     private File outputFile;
 
-    private BundleListXpp3Writer writer = new BundleListXpp3Writer();
+    /**
+     * @parameter default-value="${project.build.directory}/bundleListconfig"
+     */
+    private File configOutputDir;
+
+    /**
+     * The zip archiver.
+     *
+     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="zip"
+     */
+    private ZipArchiver zipArchiver;
+
+    private final BundleListXpp3Writer writer = new BundleListXpp3Writer();
 
     @Override
     protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
@@ -62,6 +78,82 @@ public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
                 }
             }
         }
+        this.getLog().info("Attaching bundle list configuration");
+        try {
+            this.attachConfigurations();
+        } catch (final IOException ioe) {
+            throw new MojoExecutionException("Unable to attach configuration.", ioe);
+        } catch (final ArchiverException ioe) {
+            throw new MojoExecutionException("Unable to attach configuration.", ioe);
+        }
     }
 
+    private boolean checkFile(final File f) {
+        return f != null && f.exists();
+    }
+
+    private void attachConfigurations() throws MojoExecutionException, IOException, ArchiverException {
+        if ( this.ignoreBundleListConfig ) {
+            this.getLog().debug("ignoreBundleListConfig is set to true, therefore not attaching configurations.");
+            return;
+        }
+        // check if we have configurations
+        boolean hasConfigs = this.checkFile(this.getConfigDirectory());
+        hasConfigs |= this.getSlingBootstrap(true) != null;
+        hasConfigs |= this.getSlingBootstrap(false) != null;
+        hasConfigs |= this.getSlingProperties(true) != null;
+        hasConfigs |= this.getSlingProperties(false) != null;
+
+        if ( !hasConfigs ) {
+            this.getLog().debug("No configurations to attach.");
+            return;
+        }
+        // copy configuration, as this project might use different names we have to copy everything!
+        this.configOutputDir.mkdirs();
+        if ( this.getSlingBootstrap(false) != null ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            FileUtils.fileWrite(new File(slingDir, AttachPartialBundleListMojo.SLING_WEBAPP_BOOTSTRAP).getAbsolutePath(),
+                                "UTF-8", this.getSlingBootstrap(false));
+        }
+        if ( this.getSlingProperties(false) != null ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            final FileOutputStream fos = new FileOutputStream(new File(slingDir, AttachPartialBundleListMojo.SLING_WEBAPP_PROPS));
+            try {
+                this.getSlingProperties(false).store(fos, null);
+            } finally {
+                try { fos.close(); } catch (final IOException ioe) {}
+            }
+        }
+        if ( this.getSlingBootstrap(true) != null ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            FileUtils.fileWrite(new File(slingDir, AttachPartialBundleListMojo.SLING_STANDALONE_BOOTSTRAP).getAbsolutePath(),
+                    "UTF-8", this.getSlingBootstrap(true));
+        }
+        if ( this.getSlingProperties(true) != null ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            final FileOutputStream fos = new FileOutputStream(new File(slingDir, AttachPartialBundleListMojo.SLING_STANDALONE_PROPS));
+            try {
+                this.getSlingProperties(true).store(fos, null);
+            } finally {
+                try { fos.close(); } catch (final IOException ioe) {}
+            }
+        }
+        if ( this.checkFile(this.getConfigDirectory()) ) {
+            final File configDir = new File(this.configOutputDir, "config");
+            configDir.mkdirs();
+            FileUtils.copyDirectory(this.getConfigDirectory(), configDir,
+                    null, FileUtils.getDefaultExcludesAsString());
+        }
+        final File destFile = new File(this.configOutputDir.getParent(), this.configOutputDir.getName() + ".zip");
+        zipArchiver.setDestFile(destFile);
+        zipArchiver.addDirectory(this.configOutputDir);
+        zipArchiver.createArchive();
+
+        projectHelper.attachArtifact(project, AttachPartialBundleListMojo.CONFIG_TYPE,
+                AttachPartialBundleListMojo.CONFIG_CLASSIFIER, destFile);
+    }
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 29/29: [maven-release-plugin] copy for tag maven-launchpad-plugin-2.1.2

Posted by ro...@apache.org.
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 ac6aff2b5ca51911409142c235776884fa7e9b7b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Aug 15 13:17:52 2012 +0000

    [maven-release-plugin]  copy for tag maven-launchpad-plugin-2.1.2
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.1.2@1373389 13f79535-47bb-0310-9956-ffa450edef68

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.

[sling-maven-launchpad-plugin] 21/29: SLING-2194 - fail the build if a bundle list isn't available as this is now the only way to define a partial bundle list.

Posted by ro...@apache.org.
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 bb6cf72ea85379bdca0e0d2fdcedaf8b0281dff7
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Jan 17 23:19:32 2012 +0000

    SLING-2194 - fail the build if a bundle list isn't available as this is now the only way to define a partial bundle list.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1232643 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 c4e264c..c157a80 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -90,7 +90,7 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
                 throw new MojoExecutionException("Unable to read bundle list file", e);
             }
         } else {
-            initializedBundleList = new BundleList();
+            throw new MojoFailureException(String.format("Bundle list file %s does not exist.", bundleListFile.getAbsolutePath()));
         }
 
         interpolateProperties(initializedBundleList, this.project, this.mavenSession);

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.