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/10/18 23:30:13 UTC

[sling-maven-launchpad-plugin] branch master created (now 41628b6)

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

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


      at 41628b6  SLING-7167 Adjust READMEs

This branch includes the following new commits:

     new ee750e0  SLING-2978 - Create tooling top-level directory and move maven and ide under it
     new 993da3e  SLING-3011 - Bind the launchpad:prepare-package goal to the prepare-package lifecycle phase
     new 43d12a1  Update to parent pom 18
     new 7bcfa01  SLING-3142 : NullPointerException with Java8 in AbstractUsingBundleList
     new 0a67330  SLING-3205 - factor out BundleListContentProvider to make it easier to test, and add tests. No functional changes so far
     new d70e827  SLING-3205 - refactor if statement into more readable methods
     new c816f45  SLING-3205 - provide bundle resources under resources/install to support run modes
     new 805488f  SLING-3205 - avoid confusing warning on config files
     new 34824f8  SLING-3401 Support multiple bundles for the jarWebSupport
     new fbb241f  SLING-3401 : Support multiple bundles for jarWebSupport Add support for reading multiple bundles when directly reading the maven xml (lifecycle participant) and add support to define several bundles in the dependencies.properties file
     new 2a7f05a  SLING-3401 : Support multiple bundles for jarWebSupport Implement toString and provide a way to get the contained artifact definitions
     new 29d7677  SLING-3401 : Support multiple bundles for jarWebSupport Fix init method
     new 396172e  SLING-3416 - Some tests in o.a.s.m.projectsupport.BundleListContentProviderTest fails on windows
     new be66d6e  [maven-release-plugin] prepare release maven-launchpad-plugin-2.3.0
     new 199ecaf  [maven-release-plugin] prepare for next development iteration
     new 4fcf0e7  Update to parent pom v19
     new 870559a  SLING-3681 - Enable the maven-launchpad-plugin to generate the XSD for bundles list XML document
     new e8b4a10  SLING-3681 - Enable the maven-launchpad-plugin to generate the XSD for bundles list XML document
     new e57f56e  Updated to parent version 20
     new 9d96205  SLING-3883 : Merging partial bundle list with properties fails. Apply patch from Marcel Reutegger
     new 83cee9a  [maven-release-plugin] prepare release maven-launchpad-plugin-2.3.2
     new c3794df  [maven-release-plugin] prepare for next development iteration
     new 8f0f3d3  Update to Sling Parent POM 22 with baselining enabled
     new e7bad3a  SLING-4284 - Support nested config path in BundleListContentProvider
     new 4c53c11  Add missing licence headers
     new 60a6393  SLING-4698 - Set parent.relativePath to empty for all modules
     new 4e12946  Update to Sling Parent 23
     new 033e1fc  set parent version to 24 and add empty relativePath where missing
     new 36ea42a  Update the main reactor to parent 25
     new dbff959  SLING-5107 - Switch to Java annotations for Maven plugins
     new e3c394e  SLING-5177- Launchpad plugin breaks after release of Sling 8
     new d7a362f  [maven-release-plugin] prepare release maven-launchpad-plugin-2.3.4
     new 04b81d7  [maven-release-plugin] prepare for next development iteration
     new 93873ae  Switch to parent pom 26
     new 9239126  SLING-7167 Adjust READMEs
     new fd4088a  SLING-7167 Adjust READMEs
     new 41628b6  SLING-7167 Adjust READMEs

The 37 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] 31/37: SLING-5177- Launchpad plugin breaks after release of Sling 8

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e3c394ed80138c974a46998c7fcc66eb144f372c
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Oct 21 11:38:25 2015 +0000

    SLING-5177- Launchpad plugin breaks after release of Sling 8
    
    Depend on version 7 of the launchpad instead of RELEASE.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1709800 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/maven/projectsupport/dependencies.properties     | 4 ++--
 .../org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties b/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties
index d8102e3..e6d9369 100644
--- a/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties
+++ b/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties
@@ -15,6 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 base=org.apache.sling,org.apache.sling.launchpad.base,,jar,,0
-defaultBundles=org.apache.sling,org.apache.sling.launchpad,RELEASE,jar,bundles,0
-defaultBundleList=org.apache.sling,org.apache.sling.launchpad,RELEASE,xml,bundlelist,0
+defaultBundles=org.apache.sling,org.apache.sling.launchpad,7,jar,bundles,0
+defaultBundleList=org.apache.sling,org.apache.sling.launchpad,7,xml,bundlelist,0
 jarWebSupport=org.apache.felix,org.apache.felix.http.jetty,RELEASE,jar,,-1
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java b/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
index 2a2fff3..c4d765d 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
@@ -41,7 +41,7 @@ public class PreparePackageMojoTest {
 		//		"org.apache.sling.launchpad", "RELEASE", "jar", "bundles", 0);
 
 		makeArtifactAssertions(mojo, "defaultBundleList", "org.apache.sling",
-		        "org.apache.sling.launchpad", "RELEASE", "xml", "bundlelist", 0);
+		        "org.apache.sling.launchpad", "7", "xml", "bundlelist", 0);
 
 		makeArtifactAssertions(mojo, "jarWebSupport", "org.apache.felix",
 				"org.apache.felix.http.jetty", "RELEASE", "jar", null, -1);

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

[sling-maven-launchpad-plugin] 25/37: Add missing licence headers

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4c53c1195a94531be05a8267c55901342e9fb3e0
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Apr 27 12:15:34 2015 +0000

    Add missing licence headers
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1676244 13f79535-47bb-0310-9956-ffa450edef68
---
 src/test/resources/test-bundle-list.xml | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/test/resources/test-bundle-list.xml b/src/test/resources/test-bundle-list.xml
index 43b7da5..1106f0b 100644
--- a/src/test/resources/test-bundle-list.xml
+++ b/src/test/resources/test-bundle-list.xml
@@ -1,4 +1,16 @@
 <?xml version="1.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.
+    -->
 <bundles>
     <startLevel level="boot">
         <!-- bootstrap bundles, must allow the installer core to start -->

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

[sling-maven-launchpad-plugin] 11/37: SLING-3401 : Support multiple bundles for jarWebSupport Implement toString and provide a way to get the contained artifact definitions

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2a7f05ad62024780473b6c5ad8a87add237cead5
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Feb 20 13:12:19 2014 +0000

    SLING-3401 : Support multiple bundles for jarWebSupport
    Implement toString and provide a way to get the contained artifact definitions
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1570182 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/projectsupport/ArtifactDefinition.java   | 36 +++++++++++++++++-----
 1 file changed, 29 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 29930a5..f9f6ab3 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -19,6 +19,7 @@ package org.apache.sling.maven.projectsupport;
 import static org.apache.sling.maven.projectsupport.BundleListUtils.nodeValue;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 
 import org.apache.maven.model.Dependency;
@@ -137,12 +138,20 @@ public class ArtifactDefinition {
         this.version = version;
     }
 
+    public ArtifactDefinition[] getContainedArtifacts() {
+        return this.bundles;
+    }
+
     @Override
     public String toString() {
-        return "ArtifactDefinition [artifactId=" + artifactId + ", classifier="
-                + classifier + ", groupId=" + groupId + ", startLevel="
-                + startLevel + ", type=" + type + ", version=" + version
-                + ", runModes=" + runModes + "]";
+        if ( this.bundles == null ) {
+            return "ArtifactDefinition [artifactId=" + artifactId + ", classifier="
+                    + classifier + ", groupId=" + groupId + ", startLevel="
+                    + startLevel + ", type=" + type + ", version=" + version
+                    + ", runModes=" + runModes + "]";
+        } else {
+            return "ArtifactDefinition [artifacts=" + Arrays.toString(this.bundles) + "]";
+        }
     }
 
     /**
@@ -157,13 +166,26 @@ public class ArtifactDefinition {
      *            the comma-delimited list
      */
     public void initDefaults(String commaDelimitedList) {
-        String[] values = commaDelimitedList.split(",");
+        this.initDefaults(commaDelimitedList, ',');
+    }
+
+    /**
+     * Initialize this ArtifactDefinition with a set of default values from a
+     * delimited string. This string must have 6 items in it:
+     * [groupId],[artifactId],[version],[type],[classifier],[startLevel]
+     *
+     * @param valueList the delimited list
+     * @param delimiter the delimiter
+     */
+    public void initDefaults(final String valueList, final char delimiter) {
+        final String delString = "" + delimiter;
+        String[] values = valueList.split(delString);
         if (values.length == 0 || values.length % 6 != 0 ) {
             throw new IllegalArgumentException(
                     String
                             .format(
-                                    "The string %s does not have the correct number of items (a multiple of 6).",
-                                    commaDelimitedList));
+                                    "The string %s does not have the correct number of items (a multiple of 6) separated by %s",
+                                    valueList, delString));
         }
         if ( values.length == 6 ) {
             initDefaults(values[0], values[1], values[2], values[3], values[4],

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

[sling-maven-launchpad-plugin] 09/37: SLING-3401 Support multiple bundles for the jarWebSupport

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 34824f88a070743ae46a8e83980ee1ac4f3cbedc
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Feb 20 11:47:18 2014 +0000

    SLING-3401 Support multiple bundles for the jarWebSupport
    
    The solution is to extend the ArtifactDefinition to internally support
    a collection of ArtifactDefinitions named "bundles".
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1570154 13f79535-47bb-0310-9956-ffa450edef68
---
 .../AbstractLaunchpadStartingMojo.java             |   2 +-
 .../AbstractUsingBundleListMojo.java               |   4 +-
 .../maven/projectsupport/ArtifactDefinition.java   | 113 +++++++++++++--------
 .../LaunchpadPluginLifecycleParticipant.java       |  28 ++---
 .../maven/projectsupport/PreparePackageMojo.java   |   2 +-
 .../projectsupport/bundlelist/BaseBundleList.java  |  21 ++--
 6 files changed, 103 insertions(+), 67 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 3c5e22b..636a470 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -234,6 +234,6 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
      */
     @Override
     protected void initBundleList(BundleList bundleList) {
-        bundleList.add(jarWebSupport.toBundle());
+        bundleList.add(jarWebSupport.toBundleList());
     }
 }
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 146a134..ac6a0ba 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -255,7 +255,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         // add additional bundles
         if (additionalBundles != null) {
             for (ArtifactDefinition def : additionalBundles) {
-                initializedBundleList.add(def.toBundle());
+                initializedBundleList.add(def.toBundleList());
             }
         }
 
@@ -273,7 +273,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         // handle exclusions
         if (bundleExclusions != null) {
             for (ArtifactDefinition def : bundleExclusions) {
-                initializedBundleList.remove(def.toBundle(), false);
+                initializedBundleList.remove(def.toBundleList(), false);
             }
         }
 
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 2183c2e..10285dc 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -18,6 +18,9 @@ package org.apache.sling.maven.projectsupport;
 
 import static org.apache.sling.maven.projectsupport.BundleListUtils.nodeValue;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.apache.maven.model.Dependency;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
 import org.codehaus.plexus.util.StringUtils;
@@ -49,6 +52,8 @@ public class ArtifactDefinition {
     /** The artifact run modes */
     private String runModes;
 
+    private ArtifactDefinition[] bundles;
+
     public ArtifactDefinition() {
     }
 
@@ -176,54 +181,80 @@ public class ArtifactDefinition {
      */
     public void initDefaults(String groupId, String artifactId, String version,
             String type, String classifier, int startLevel) {
-        if (this.groupId == null && StringUtils.isNotEmpty(groupId)) {
-            this.groupId = groupId;
-        }
-        if (this.artifactId == null && StringUtils.isNotEmpty(artifactId)) {
-            this.artifactId = artifactId;
-        }
-        if (this.version == null && StringUtils.isNotEmpty(version)) {
-            this.version = version;
-        }
-        if (this.type == null && StringUtils.isNotEmpty(groupId)) {
-            this.type = type;
-        }
-        if (this.classifier == null && StringUtils.isNotEmpty(classifier)) {
-            this.classifier = classifier;
-        }
-        if (this.startLevel == 0) {
-            this.startLevel = startLevel;
+        if (this.bundles == null) {
+            if (this.groupId == null && StringUtils.isNotEmpty(groupId)) {
+                this.groupId = groupId;
+            }
+            if (this.artifactId == null && StringUtils.isNotEmpty(artifactId)) {
+                this.artifactId = artifactId;
+            }
+            if (this.version == null && StringUtils.isNotEmpty(version)) {
+                this.version = version;
+            }
+            if (this.type == null && StringUtils.isNotEmpty(groupId)) {
+                this.type = type;
+            }
+            if (this.classifier == null && StringUtils.isNotEmpty(classifier)) {
+                this.classifier = classifier;
+            }
+            if (this.startLevel == 0) {
+                this.startLevel = startLevel;
+            }
+        } else {
+            for (ArtifactDefinition bundle : this.bundles) {
+                bundle.initDefaults(groupId, artifactId, version, type, classifier, startLevel);
+            }
         }
     }
 
-    public Bundle toBundle() {
-        Bundle bnd = new Bundle();
-        bnd.setArtifactId(artifactId);
-        bnd.setGroupId(groupId);
-        bnd.setVersion(version);
-        if (type != null) {
-            bnd.setType(type);
+    public List<Bundle> toBundleList() {
+        ArrayList<Bundle> bundleList = new ArrayList<Bundle>();
+
+        if (bundles == null) {
+            Bundle bnd = new Bundle();
+            bnd.setArtifactId(artifactId);
+            bnd.setGroupId(groupId);
+            bnd.setVersion(version);
+            if (type != null) {
+                bnd.setType(type);
+            }
+            bnd.setClassifier(classifier);
+            bnd.setStartLevel(startLevel);
+            bundleList.add(bnd);
+        } else {
+            for (ArtifactDefinition bundle : bundles) {
+                bundleList.addAll(bundle.toBundleList());
+            }
         }
-        bnd.setClassifier(classifier);
-        bnd.setStartLevel(startLevel);
-        return bnd;
-    }
-
-    public Dependency toDependency(String scope) {
-        Dependency dep = new Dependency();
-        dep.setArtifactId(artifactId);
-        dep.setGroupId(groupId);
-        dep.setVersion(version);
-        if (type != null) {
-            dep.setType(type);
+
+        return bundleList;
+    }
+
+    public List<Dependency> toDependencyList(String scope) {
+        ArrayList<Dependency> depList = new ArrayList<Dependency>();
+
+        if (bundles == null) {
+            Dependency dep = new Dependency();
+            dep.setArtifactId(artifactId);
+            dep.setGroupId(groupId);
+            dep.setVersion(version);
+            if (type != null) {
+                dep.setType(type);
+            }
+            dep.setClassifier(classifier);
+            dep.setScope(scope);
+            depList.add(dep);
+        } else {
+            for (ArtifactDefinition bundle : bundles) {
+                depList.addAll(bundle.toDependencyList(scope));
+            }
         }
-        dep.setClassifier(classifier);
-        dep.setScope(scope);
-        return dep;
+
+        return depList;
     }
 
-    public static Dependency toDependency(Bundle bundle, String scope) {
-        return new ArtifactDefinition(bundle, 0).toDependency(scope);
+    public static List<Dependency> toDependencyList(Bundle bundle, String scope) {
+        return new ArtifactDefinition(bundle, 0).toDependencyList(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 57dd147..b7dc8d1 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.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
@@ -50,7 +50,7 @@ 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
@@ -100,43 +100,43 @@ public class LaunchpadPluginLifecycleParticipant extends AbstractMavenLifecycleP
 
         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(PROVIDED));
+                    project.getDependencies().addAll(defaultBundleList.toDependencyList(PROVIDED));
                 }
 
                 if (hasJarPackagingExecution()) {
                     log.debug(String.format("adding jar web support (%s) to dependencies of project %s", jarWebSupport, project));
-                    project.getDependencies().add(jarWebSupport.toDependency(PROVIDED));
+                    project.getDependencies().addAll(jarWebSupport.toDependencyList(PROVIDED));
                 }
             }
         }
 
         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());
+                    bundleList.add(def.toBundleList());
                 }
             }
-            
+
             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, PROVIDED));
+                    project.getDependencies().addAll(ArtifactDefinition.toDependencyList(bundle, PROVIDED));
                 }
             }
         }
@@ -161,10 +161,10 @@ public class LaunchpadPluginLifecycleParticipant extends AbstractMavenLifecycleP
                 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) {
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 521472d..e5c3612 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -136,7 +136,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
     @Override
     protected void initBundleList(BundleList bundleList) {
         if (packaging.equals(JAR)) {
-            bundleList.add(jarWebSupport.toBundle());
+            bundleList.add(jarWebSupport.toBundleList());
         }
     }
 
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 1c7bc56..230aa49 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
@@ -39,16 +39,19 @@ public abstract class BaseBundleList {
         return null;
     }
 
-    public boolean remove(Bundle bundle, boolean compareVersions) {
-        for (StartLevel sl : getStartLevels()) {
-            if (sl.removeBundle(bundle, compareVersions)) {
-                return true;
+    public boolean remove(List<Bundle> bundles, boolean compareVersions) {
+        boolean result = false;
+        for (Bundle bundle : bundles) {
+            for (StartLevel sl : getStartLevels()) {
+                if (sl.removeBundle(bundle, compareVersions)) {
+                    result = true;
+                    break;
+                }
             }
         }
-        return false;
+        return result;
     }
 
-
     /**
      * Merge the current bundle list with an additional list.
      * @see #add(Bundle)
@@ -69,8 +72,10 @@ public abstract class BaseBundleList {
      *
      * @param newBnd the bundle to add
      */
-    public void add(Bundle newBnd) {
-       add(null, newBnd);
+    public void add(List<Bundle> newBnd) {
+        for (Bundle bundle : newBnd) {
+            add(null, bundle);
+        }
     }
 
     /**

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

[sling-maven-launchpad-plugin] 01/37: SLING-2978 - Create tooling top-level directory and move maven and ide under it

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit ee750e02032bcf6b7cd7d4f67fdf5c6d9c109d38
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Jul 24 18:13:22 2013 +0000

    SLING-2978 - Create tooling top-level directory and move maven and ide
    under it
    
    * moved the maven directory under tooling maven
    * adjusted module paths in pom.xml
    * updated the scm information in the pom.xml files
    * updated the scm information in the README.txt files
    
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1506645 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt                                         |  27 +
 pom.xml                                            | 224 +++++++++
 .../projectsupport/AbstractBundleListMojo.java     | 259 ++++++++++
 .../AbstractLaunchpadFrameworkMojo.java            | 115 +++++
 .../AbstractLaunchpadStartingMojo.java             | 352 +++++++++++++
 .../AbstractUsingBundleListMojo.java               | 552 +++++++++++++++++++++
 .../maven/projectsupport/ArtifactDefinition.java   | 229 +++++++++
 .../maven/projectsupport/AttachBundleListMojo.java | 156 ++++++
 .../AttachPartialBundleListMojo.java               | 191 +++++++
 .../maven/projectsupport/BundleListUtils.java      | 154 ++++++
 .../CheckBundleListForSnapshotsMojo.java           |  74 +++
 .../maven/projectsupport/ControlListener.java      | 212 ++++++++
 .../maven/projectsupport/CreateBundleJarMojo.java  | 187 +++++++
 .../CreateKarafFeatureDescriptorMojo.java          | 109 ++++
 .../CreatePaxRunnerBundleProvisionFileMojo.java    |  77 +++
 .../projectsupport/DisplayBundleUpdatesMojo.java   | 254 ++++++++++
 .../LaunchpadPluginLifecycleParticipant.java       | 232 +++++++++
 .../maven/projectsupport/OutputBundleListMojo.java |  45 ++
 .../maven/projectsupport/PreparePackageMojo.java   | 352 +++++++++++++
 .../projectsupport/PrepareTestWebAppMojo.java      |  92 ++++
 .../apache/sling/maven/projectsupport/RunMojo.java | 101 ++++
 .../sling/maven/projectsupport/StartMojo.java      |  67 +++
 .../sling/maven/projectsupport/StatusMojo.java     |  49 ++
 .../sling/maven/projectsupport/StopMojo.java       |  49 ++
 .../projectsupport/bundlelist/BaseBundle.java      |  39 ++
 .../projectsupport/bundlelist/BaseBundleList.java  | 115 +++++
 .../projectsupport/bundlelist/BaseStartLevel.java  |  91 ++++
 src/main/mdo/bundle-list.xml                       | 118 +++++
 src/main/resources/META-INF/plexus/components.xml  |  53 ++
 .../maven/projectsupport/dependencies.properties   |  20 +
 .../sling/maven/projectsupport/drools-globals.drl  |  24 +
 .../projectsupport/PreparePackageMojoTest.java     | 110 ++++
 32 files changed, 4729 insertions(+)

diff --git a/README.txt b/README.txt
new file mode 100644
index 0000000..0df89ae
--- /dev/null
+++ b/README.txt
@@ -0,0 +1,27 @@
+Apache Sling Maven Plugin
+
+Maven Plugin supporting the Sling Launchpad framework.
+
+Getting Started
+===============
+
+This component uses a Maven 2 (http://maven.apache.org/) build
+environment. It requires a Java 5 JDK (or higher) and Maven (http://maven.apache.org/)
+2.0.7 or later. We recommend to use the latest Maven version.
+
+If you have Maven 2 installed, you can compile and
+package the jar using the following command:
+
+    mvn package
+
+See the Maven 2 documentation for other build features.
+
+The latest source code for this component is available in the
+Subversion (http://subversion.tigris.org/) source repository of
+the Apache Software Foundation. If you have Subversion installed,
+you can checkout the latest source using the following command:
+
+    svn checkout http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin
+
+See the Subversion documentation for other source control features.
+
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..3c8a4b6
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,224 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+    <!--
+        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.
+    -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>17</version>
+        <relativePath>../../parent/pom.xml</relativePath>
+    </parent>
+
+    <artifactId>maven-launchpad-plugin</artifactId>
+    <version>2.2.1-SNAPSHOT</version>
+    <packaging>maven-plugin</packaging>
+
+    <name>Apache Sling Launchpad Maven Plugin</name>
+    <description>
+        Maven Plugin supporting Sling Launchpad
+    </description>
+
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-launchpad-plugin</url>
+    </scm>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.modello</groupId>
+                <artifactId>modello-maven-plugin</artifactId>
+                <version>1.1</version>
+                <executions>
+                    <execution>
+                        <id>bundle-manifest.xml</id>
+                        <goals>
+                            <goal>java</goal>
+                            <goal>xpp3-reader</goal>
+                            <goal>xpp3-writer</goal>
+                        </goals>
+                        <configuration>
+                            <version>1.0.0</version>
+                            <models>
+                                <model>src/main/mdo/bundle-list.xml
+                                </model>
+                            </models>
+                        </configuration>
+                    </execution>
+                </executions>
+                <configuration>
+                    <packageWithVersion>true</packageWithVersion>
+                    <useJava5>true</useJava5>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>emma-maven-plugin</artifactId>
+                <configuration>
+                    <filters>
+                        <filter>-*</filter>
+                    </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>
+
+    <reporting>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-plugin-plugin</artifactId>
+                <version>2.5.1</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-javadoc-plugin</artifactId>
+                <configuration>
+                    <!-- No javadocs -->
+                    <excludePackageNames>
+                        org.apache.sling
+                    </excludePackageNames>
+                </configuration>
+            </plugin>
+        </plugins>
+    </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>3.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-archiver</artifactId>
+            <version>1.0-alpha-9</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.codehaus.plexus</groupId>
+                    <artifactId>plexus-container-default</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.codehaus.plexus</groupId>
+                    <artifactId>plexus-component-api</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        <dependency>
+            <groupId>org.codehaus.plexus</groupId>
+            <artifactId>plexus-utils</artifactId>
+            <version>1.5.15</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>2.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.jdom</groupId>
+            <artifactId>jdom</artifactId>
+            <version>1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.launchpad.api</artifactId>
+            <version>1.0.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.launchpad.base</artifactId>
+            <version>2.4.0</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.launchpad.base</artifactId>
+            <version>2.4.0</version>
+            <classifier>app</classifier>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>4.2.0</version>
+        </dependency>
+        <dependency>
+            <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>
+            <artifactId>drools-compiler</artifactId>
+            <version>5.3.1.Final</version>
+        </dependency>
+        <dependency>
+            <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>
+</project>
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
new file mode 100644
index 0000000..a2f5566
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -0,0 +1,259 @@
+/*
+ * 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.FileFilter;
+import java.io.IOException;
+import java.util.List;
+
+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.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectHelper;
+import org.codehaus.plexus.util.SelectorUtils;
+import org.codehaus.plexus.util.StringUtils;
+
+public abstract class AbstractBundleListMojo extends AbstractMojo {
+
+    /**
+     * Partial Bundle List type
+     */
+    protected static final String PARTIAL = "partialbundlelist";
+
+    /**
+     * @parameter default-value="${basedir}/src/main/bundles/list.xml"
+     */
+    protected File bundleListFile;
+
+    /**
+     * The Maven project.
+     *
+     * @parameter expression="${project}"
+     * @required
+     * @readonly
+     */
+    protected MavenProject project;
+
+    /**
+     * @component
+     */
+    protected MavenProjectHelper projectHelper;
+
+    /**
+     * @parameter expression="${configDirectory}"
+     *            default-value="src/main/config"
+     */
+    private File configDirectory;
+
+    /**
+     * @parameter expression="${commonSlingProps}"
+     *            default-value="src/main/sling/common.properties"
+     */
+    protected File commonSlingProps;
+
+    /**
+     * @parameter expression="${commonSlingBootstrap}"
+     *            default-value="src/main/sling/common.bootstrap.txt"
+     */
+    protected File commonSlingBootstrap;
+
+    /**
+     * @parameter expression="${webappSlingProps}"
+     *            default-value="src/main/sling/webapp.properties"
+     */
+    protected File webappSlingProps;
+
+    /**
+     * @parameter expression="${webappSlingBootstrap}"
+     *            default-value="src/main/sling/webapp.bootstrap.txt"
+     */
+    protected File webappSlingBootstrap;
+
+    /**
+     * @parameter expression="${standaloneSlingProps}"
+     *            default-value="src/main/sling/standalone.properties"
+     */
+    protected File standaloneSlingProps;
+
+    /**
+     * @parameter expression="${standaloneSlingBootstrap}"
+     *            default-value="src/main/sling/standalone.bootstrap.txt"
+     */
+    protected File standaloneSlingBootstrap;
+
+    /**
+     * @parameter expression="${ignoreBundleListConfig}"
+     *            default-value="false"
+     */
+    protected boolean ignoreBundleListConfig;
+
+    /**
+     * @parameter expression="${session}
+     * @required
+     * @readonly
+     */
+    protected MavenSession mavenSession;
+
+    /**
+     * 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<ArtifactRepository> remoteRepos;
+
+    /**
+     * Used to look up Artifacts in the remote repository.
+     *
+     * @component
+     */
+    private ArtifactResolver resolver;
+
+    protected File getConfigDirectory() {
+        return this.configDirectory;
+    }
+
+    /**
+     * 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<ArtifactVersion> 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;
+            }
+
+    /**
+     * Helper method to copy a whole directory
+     */
+    protected void copyDirectory(final File source, final File target, final String[] includes, final String[] excludes)
+    throws IOException {
+        final String prefix = source.getAbsolutePath() + File.separatorChar;
+        final int prefixLength = prefix.length();
+        org.apache.commons.io.FileUtils.copyDirectory(source, target, new FileFilter() {
+
+            public boolean accept(final File file) {
+                final String path = file.getAbsolutePath().substring(prefixLength).replace(File.separatorChar, '/');
+                if ( includes != null ) {
+                    boolean matched = false;
+                    for(int i = 0; i<includes.length && !matched; i++) {
+                        if ( SelectorUtils.matchPath(includes[i], path)) {
+                            matched = true;
+                        }
+                    }
+                    if ( !matched ) {
+                        return false;
+                    }
+                }
+                if ( excludes != null ) {
+                    for(final String pattern:excludes) {
+                        if ( SelectorUtils.matchPath(pattern, path)) {
+                            return false;
+                        }
+                    }
+                }
+                return true;
+            }
+        });
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
new file mode 100644
index 0000000..23d16d0
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
@@ -0,0 +1,115 @@
+/*
+ * 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.IOException;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+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.FileUtils;
+
+/**
+ * This class contains the Launchpad-framework specific utility methods.
+ *
+ */
+public abstract class AbstractLaunchpadFrameworkMojo extends AbstractUsingBundleListMojo {
+
+    /**
+     * The name of the directory within the output directory into which the base
+     * JAR should be installed.
+     *
+     * @parameter default-value="resources"
+     */
+    protected String baseDestination;
+
+    /**
+     * The directory which contains the start-level bundle directories.
+     *
+     * @parameter default-value="bundles"
+     */
+    private String bundlesDirectory;
+
+    /**
+     * The directory which contains the bootstrap bundle directories.
+     *
+     * @parameter
+     */
+    private String bootDirectory;
+
+    protected String getPathForArtifact(final int startLevel, final String artifactName, final String runModes) {
+        final Set<String> runModesList = new TreeSet<String>();
+        if (runModes != null ) {
+            for(final String mode : runModes.split(",")) {
+                if ( mode.trim().length() > 0 ) {
+                    runModesList.add(mode);
+                }
+            }
+        }
+        final String runModeExt;
+        if ( runModesList.size() == 0 ) {
+            runModeExt = "";
+        } else {
+            final StringBuilder sb = new StringBuilder();
+            for(final String n : runModesList ) {
+                sb.append('.');
+                sb.append(n);
+            }
+            runModeExt = sb.toString();
+        }
+        if ( startLevel == -1 && bootDirectory != null ) {
+            return String.format("%s/%s%s/1/%s", baseDestination, bootDirectory,
+                    runModeExt,
+                    artifactName);
+        }
+        return String.format("%s/%s%s/%s/%s", baseDestination, bundlesDirectory,
+                runModeExt,
+                (startLevel == -1 ? 1 : startLevel),
+                artifactName, runModeExt);
+    }
+
+    protected void copyBundles(BundleList bundles, File outputDirectory) throws MojoExecutionException {
+        for (StartLevel startLevel : bundles.getStartLevels()) {
+            for (Bundle bundle : startLevel.getBundles()) {
+                copy(new ArtifactDefinition(bundle, startLevel.getStartLevel()), outputDirectory);
+            }
+        }
+    }
+
+    protected void copy(ArtifactDefinition additionalBundle, File outputDirectory) throws MojoExecutionException {
+        Artifact artifact = getArtifact(additionalBundle);
+        copy(artifact.getFile(), additionalBundle.getStartLevel(), additionalBundle.getRunModes(), outputDirectory);
+    }
+
+    protected void copy(File file, int startLevel, String runModes, File outputDirectory) throws MojoExecutionException {
+        File destination = new File(outputDirectory, getPathForArtifact(startLevel, file.getName().replace('/', File.separatorChar), runModes));
+        if (shouldCopy(file, destination)) {
+            getLog().info(String.format("Copying bundle from %s to %s", file.getPath(), destination.getPath()));
+            try {
+                FileUtils.copyFile(file, destination);
+            } catch (IOException e) {
+                throw new MojoExecutionException("Unable to copy bundle from " + file.getPath(), e);
+            }
+        }
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
new file mode 100644
index 0000000..bb27287
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -0,0 +1,352 @@
+/*
+ * 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.felix.framework.util.FelixConstants.LOG_LEVEL_PROP;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.felix.framework.Logger;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.shared.filtering.MavenFilteringException;
+import org.apache.maven.shared.filtering.PropertyUtils;
+import org.apache.sling.launchpad.api.LaunchpadContentProvider;
+import org.apache.sling.launchpad.base.impl.Sling;
+import org.apache.sling.launchpad.base.shared.Notifiable;
+import org.apache.sling.launchpad.base.shared.SharedConstants;
+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.BundleException;
+
+public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleListMojo implements Notifiable {
+
+    /** Default log level setting if no set on command line (value is "INFO"). */
+    private static final int DEFAULT_LOG_LEVEL = Logger.LOG_INFO;
+
+    /** Mapping between log level numbers and names */
+    private static final String[] logLevels = { "FATAL", "ERROR", "WARN", "INFO", "DEBUG" };
+
+    /**
+     * The configuration property setting the port on which the HTTP service
+     * listens
+     */
+    private static final String PROP_PORT = "org.osgi.service.http.port";
+
+    /** Return the log level code for the string */
+    private static int toLogLevelInt(String level, int defaultLevel) {
+        for (int i = 0; i < logLevels.length; i++) {
+            if (logLevels[i].equalsIgnoreCase(level)) {
+                return i;
+            }
+        }
+
+        return defaultLevel;
+    }
+
+    /**
+     * @parameter expression="${http.port}" default-value="8080"
+     */
+    private int httpPort;
+
+    /**
+     * The definition of the package to be included to provide web support for
+     * JAR-packaged projects (i.e. pax-web).
+     *
+     * @parameter
+     */
+    private ArtifactDefinition jarWebSupport;
+
+    /**
+     * @parameter expression="${felix.log.level}"
+     */
+    private String logLevel;
+
+    /**
+     * @parameter expression="${propertiesFile}"
+     *            default-value="src/test/config/sling.properties"
+     */
+    private File propertiesFile;
+
+    /**
+     * @parameter expression="${resourceProviderRoot}"
+     *            default-value="src/test/resources"
+     */
+    private File resourceProviderRoot;
+
+    private LaunchpadContentProvider resourceProvider = new LaunchpadContentProvider() {
+
+        public Iterator<String> getChildren(String path) {
+            if (path.equals(BUNDLE_PATH_PREFIX)) {
+                final Set<String> levels = new HashSet<String>();
+                for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+                    // we treat the boot level as level 1
+                    if ( level.getStartLevel() == -1 ) {
+                        levels.add(BUNDLE_PATH_PREFIX + "/1/");
+                    } else {
+                        levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
+                    }
+                }
+                return levels.iterator();
+            } else if (path.equals("resources/corebundles")) {
+                List<String> empty = Collections.emptyList();
+                return empty.iterator();
+            } else if (path.equals(CONFIG_PATH_PREFIX)) {
+                if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
+                    File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
+
+                        public boolean accept(File file) {
+                            return file.isFile();
+                        }
+                    });
+
+                    List<String> fileNames = new ArrayList<String>();
+                    for (File cfgFile : configFiles) {
+                        if (cfgFile.isFile()) {
+                            fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
+                        }
+                    }
+
+                    return fileNames.iterator();
+
+                } else {
+                    List<String> empty = Collections.emptyList();
+                    return empty.iterator();
+                }
+            } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
+                final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
+                try {
+                    final int startLevel = Integer.parseInt(startLevelInfo);
+
+                    final List<String> bundles = new ArrayList<String>();
+                    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);
+                                try {
+                                    final Artifact artifact = getArtifact(d);
+                                    bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
+                                } catch (Exception e) {
+                                    getLog().error("Unable to resolve artifact ", e);
+                                }
+                            }
+                        }
+                    }
+                    return bundles.iterator();
+
+                } catch (NumberFormatException e) {
+                    // we ignore this
+                }
+            } else if (path.equals("resources") ) {
+                final Set<String> subDirs = new HashSet<String>();
+                subDirs.add(BUNDLE_PATH_PREFIX);
+                subDirs.add(CONFIG_PATH_PREFIX);
+                subDirs.add("resources/corebundles");
+                return subDirs.iterator();
+            }
+
+            getLog().warn("un-handlable path " + path);
+            return null;
+        }
+
+        public URL getResource(String path) {
+            if (path.startsWith(CONFIG_PATH_PREFIX)) {
+                File configFile = new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
+                if (configFile.exists()) {
+                    try {
+                        return configFile.toURI().toURL();
+                    } catch (MalformedURLException e) {
+                        // ignore this one
+                    }
+                }
+            }
+
+            File resourceFile = new File(resourceProviderRoot, path);
+            if (resourceFile.exists()) {
+                try {
+                    return resourceFile.toURI().toURL();
+                } catch (MalformedURLException e) {
+                    getLog().error("Unable to create URL for file", e);
+                    return null;
+                }
+            } else {
+                URL fromClasspath = getClass().getResource("/" + path);
+                if (fromClasspath != null) {
+                    return fromClasspath;
+                }
+
+                try {
+                    return new URL(path);
+                } catch (MalformedURLException e) {
+                    return null;
+                }
+            }
+
+        }
+
+        public InputStream getResourceAsStream(String path) {
+            URL res = this.getResource(path);
+            if (res != null) {
+                try {
+                    return res.openStream();
+                } catch (IOException ioe) {
+                    // ignore this one
+                }
+            }
+
+            // no resource
+            return null;
+
+        }
+    };
+
+    private Sling sling;
+
+    /**
+     * @parameter expression="${sling.home}" default-value="${basedir}/sling"
+     */
+    private String slingHome;
+
+    /**
+     * @parameter default-value="true"
+     */
+    private boolean forceBundleLoad;
+
+    public void stopped() {
+        sling = null;
+    }
+
+    public void updated(File updateFile) {
+        // clear the reference to the framework
+        sling = null;
+
+        if (updateFile != null) {
+            getLog().warn("Maven Launchpad Plugin doesn't support updating the framework bundle.");
+        }
+
+        getLog().info("Restarting Framework and Sling");
+
+        try {
+            executeWithArtifacts();
+        } catch (MojoExecutionException e) {
+            getLog().error("Unable to restart Framework and Sling", e);
+            System.exit(1);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected void executeWithArtifacts() throws MojoExecutionException {
+        try {
+            final Map<String, String> props = new HashMap<String, String>();
+
+            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");
+            }
+
+            // set up and configure Felix Logger
+            int logLevelNum;
+            if (logLevel == null) {
+                logLevelNum = DEFAULT_LOG_LEVEL;
+            } else {
+                logLevelNum = toLogLevelInt(logLevel, DEFAULT_LOG_LEVEL);
+            }
+            props.put(LOG_LEVEL_PROP, String.valueOf(logLevelNum));
+            // Display port number on console, in case HttpService doesn't
+            getLog().info("HTTP server port: " + httpPort);
+            props.put(PROP_PORT, String.valueOf(httpPort));
+
+            // prevent tons of needless WARN from the framework
+            Logger logger = new Logger();
+            logger.setLogLevel(Logger.LOG_ERROR);
+
+            if (propertiesFile.exists()) {
+                File tmp = null;
+                try {
+                    tmp = File.createTempFile("sling", "props");
+                    mavenFileFilter.copyFile(propertiesFile, tmp, true, project, null, true,
+                            System.getProperty("file.encoding"), mavenSession);
+                    Properties loadedProps = PropertyUtils.loadPropertyFile(tmp, null);
+                    for (Object key : loadedProps.keySet()) {
+                        props.put((String) key, (String) loadedProps.get(key));
+                    }
+                } catch (IOException e) {
+                    throw new MojoExecutionException("Unable to create filtered properties file", e);
+                } catch (MavenFilteringException e) {
+                    throw new MojoExecutionException("Unable to create filtered properties file", e);
+                } finally {
+                    if (tmp != null) {
+                        tmp.delete();
+                    }
+                }
+            }
+
+            sling = startSling(resourceProvider, props, logger);
+
+        } catch (BundleException be) {
+            getLog().error("Failed to Start OSGi framework", be);
+        }
+
+    }
+
+    protected abstract Sling startSling(LaunchpadContentProvider resourceProvider, Map<String, String> props,
+            Logger logger) throws BundleException;
+
+    protected void stopSling() {
+        if (sling != null) {
+            sling.destroy();
+        }
+    }
+
+    @Override
+    protected void initArtifactDefinitions(Properties dependencies) {
+        if (jarWebSupport == null) {
+            jarWebSupport = new ArtifactDefinition();
+        }
+        jarWebSupport.initDefaults(dependencies.getProperty("jarWebSupport"));
+    }
+
+    /**
+     * Add the JAR Web Support bundle to the bundle list.
+     */
+    @Override
+    protected void initBundleList(BundleList bundleList) {
+        bundleList.add(jarWebSupport.toBundle());
+    }
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
new file mode 100644
index 0000000..41e45a4
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -0,0 +1,552 @@
+/*
+ * 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.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.util.Enumeration;
+import java.util.Properties;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+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;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+import org.drools.KnowledgeBase;
+import org.drools.KnowledgeBaseFactory;
+import org.drools.builder.KnowledgeBuilder;
+import org.drools.builder.KnowledgeBuilderError;
+import org.drools.builder.KnowledgeBuilderFactory;
+import org.drools.builder.ResourceType;
+import org.drools.io.ResourceFactory;
+import org.drools.runtime.StatefulKnowledgeSession;
+
+public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo {
+
+    /**
+     * JAR Packaging type.
+     */
+    protected static final String JAR = "jar";
+
+    /**
+     * WAR Packaging type.
+     */
+    protected static final String WAR = "war";
+
+    protected static final String CONFIG_PATH_PREFIX = "resources/config";
+
+    protected static final String BUNDLE_PATH_PREFIX = "resources/bundles";
+
+    protected static boolean shouldCopy(File source, File dest) {
+        if (!dest.exists()) {
+            return true;
+        }
+        return source.lastModified() > dest.lastModified();
+    }
+
+    /**
+     * The definition of the defaultBundleList artifact.
+     *
+     * @parameter
+     */
+    protected ArtifactDefinition defaultBundleList;
+
+    /**
+     * Any additional bundles to include in the project's bundles directory.
+     *
+     * @parameter
+     */
+    private ArtifactDefinition[] additionalBundles;
+
+    private BundleList initializedBundleList;
+
+    /**
+     * Bundles which should be removed from the project's bundles directory.
+     *
+     * @parameter
+     */
+    private ArtifactDefinition[] bundleExclusions;
+
+    /**
+     * If true, include the default bundles.
+     *
+     * @parameter expression="${includeDefaultBundles}" default-value="true"
+     */
+    private boolean includeDefaultBundles;
+
+    /**
+     * @parameter
+     */
+    private File[] rewriteRuleFiles;
+
+    /**
+     * The list of tokens to include when copying configs
+     * from partial bundle lists.
+     *
+     * @parameter default-value="**"
+     */
+    private String[] configIncludes;
+
+    /**
+     * The list of tokens to exclude when copying the configs
+     * from partial bundle lists.
+     *
+     * @parameter
+     */
+    private String[] configExcludes;
+
+    /**
+     * The list of names to exclude when copying properties
+     * from partial bundle lists.
+     *
+     * @parameter
+     */
+    private String[] propertiesExcludes;
+
+    /**
+     * @component
+     */
+    protected MavenFileFilter mavenFileFilter;
+
+    /**
+     * The zip unarchiver.
+     *
+     * @component role="org.codehaus.plexus.archiver.UnArchiver" roleHint="zip"
+     */
+    private ZipUnArchiver zipUnarchiver;
+
+    private Properties slingProperties;
+
+    private Properties slingWebappProperties;
+
+    private Properties slingStandaloneProperties;
+
+    private String slingBootstrapCommand;
+
+    private String slingWebappBootstrapCommand;
+
+    private String slingStandaloneBootstrapCommand;
+
+    /**
+     * @parameter default-value="${project.build.directory}/tmpBundleListconfig"
+     */
+    private File tmpOutputDir;
+
+    /**
+     * @parameter default-value="${project.build.directory}/tmpConfigDir"
+     */
+    private File tempConfigDir;
+
+    private File overlayConfigDir;
+
+    public final void execute() throws MojoFailureException, MojoExecutionException {
+        try {
+            initBundleList();
+            extractConfigurations();
+        } catch (MojoExecutionException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new MojoExecutionException("Unable to load dependency information from properties file.", e);
+        }
+        executeWithArtifacts();
+
+    }
+
+    @Override
+    protected File getConfigDirectory() {
+        if ( this.overlayConfigDir != null ) {
+            return this.overlayConfigDir;
+        }
+        return super.getConfigDirectory();
+    }
+
+    /**
+     * Execute the logic of the plugin after the default artifacts have been
+     * initialized.
+     */
+    protected abstract void executeWithArtifacts() throws MojoExecutionException, MojoFailureException;
+
+    protected BundleList getInitializedBundleList() {
+        return initializedBundleList;
+    }
+
+    /**
+     * Hook methods for subclasses to initialize any additional artifact
+     * definitions.
+     *
+     * @param dependencies the dependency properties loaded from the JAR file
+     */
+    protected void initArtifactDefinitions(Properties dependencies) {
+    }
+
+    /**
+     * Hook methods for subclasses to initialize the bundle list.
+     */
+    protected void initBundleList(BundleList bundleList) {
+    }
+
+    /**
+     * Initialize the artifact definitions using defaults inside the plugin JAR.
+     *
+     * @throws IOException if the default properties can't be read
+     * @throws XmlPullParserException
+     * @throws MojoExecutionException
+     */
+    private final void initArtifactDefinitions() throws IOException {
+        BundleListUtils.initArtifactDefinitions(getClass().getClassLoader(), new ArtifactDefinitionsCallback() {
+
+            public void initArtifactDefinitions(Properties dependencies) {
+                if (defaultBundleList == null) {
+                    defaultBundleList = new ArtifactDefinition();
+                }
+                defaultBundleList.initDefaults(dependencies.getProperty("defaultBundleList"));
+
+                AbstractUsingBundleListMojo.this.initArtifactDefinitions(dependencies);
+            }
+        });
+    }
+
+    private final void initBundleList() throws IOException, XmlPullParserException, MojoExecutionException {
+        initArtifactDefinitions();
+        if (BundleListUtils.isCurrentArtifact(project, defaultBundleList)) {
+            initializedBundleList = readBundleList(bundleListFile);
+        } else {
+            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());
+                initializedBundleList = readBundleList(defBndListArtifact.getFile());
+            }
+
+            if (bundleListFile.exists()) {
+                initializedBundleList.merge(readBundleList(bundleListFile));
+            }
+        }
+        // add additional bundles
+        if (additionalBundles != null) {
+            for (ArtifactDefinition def : additionalBundles) {
+                initializedBundleList.add(def.toBundle());
+            }
+        }
+
+        // check for partial bundle lists
+        final Set<Artifact> dependencies = project.getDependencyArtifacts();
+        for (Artifact artifact : dependencies) {
+            if (PARTIAL.equals(artifact.getType())) {
+                getLog().info(
+                        String.format("Merging partial bundle list %s:%s:%s", artifact.getGroupId(),
+                                artifact.getArtifactId(), artifact.getVersion()));
+                initializedBundleList.merge(readBundleList(artifact.getFile()));
+            }
+        }
+
+        // handle exclusions
+        if (bundleExclusions != null) {
+            for (ArtifactDefinition def : bundleExclusions) {
+                initializedBundleList.remove(def.toBundle(), false);
+            }
+        }
+
+        initBundleList(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())) {
+                extractConfiguration(artifact);
+            }
+        }
+        // copy own config files
+        if ( this.overlayConfigDir != null && super.getConfigDirectory().exists() ) {
+            copyDirectory(super.getConfigDirectory(), this.overlayConfigDir, null, FileUtils.getDefaultExcludes());
+        }
+    }
+
+    private void extractConfiguration(final 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 settings from partial bundle list %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
+                final File configDir = new File(this.tmpOutputDir, "config");
+                if ( configDir.exists() ) {
+                    if ( this.overlayConfigDir == null ) {
+                        this.tempConfigDir.mkdirs();
+                        this.overlayConfigDir = this.tempConfigDir;
+                    }
+                    final String[] defaultExcludes = FileUtils.getDefaultExcludes();
+                    String[] excludes;
+                    if ( this.configExcludes != null ) {
+                        excludes = new String[defaultExcludes.length + this.configExcludes.length];
+                        System.arraycopy(defaultExcludes, 0, excludes, 0, defaultExcludes.length);
+                        System.arraycopy(this.configExcludes, 0, excludes, defaultExcludes.length, this.configExcludes.length);
+                    } else {
+                        excludes = defaultExcludes;
+                    }
+                    String[] includes = null;
+                    if ( this.configIncludes != null ) {
+                        includes = this.configIncludes;
+                    }
+                    copyDirectory(configDir, this.overlayConfigDir,
+                                    includes, excludes);
+                }
+            } 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);
+            StatefulKnowledgeSession session = knowledgeBase.newStatefulKnowledgeSession();
+            try {
+                session.setGlobal("mavenSession", mavenSession);
+                session.setGlobal("mavenProject", project);
+                session.insert(bundleList);
+                session.fireAllRules();
+            } finally {
+                session.dispose();
+            }
+        }
+    }
+
+    private KnowledgeBase createKnowledgeBase(File[] files) throws MojoExecutionException {
+        KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
+        builder.add(ResourceFactory.newClassPathResource("drools-globals.drl", getClass()), ResourceType.DRL);
+        for (File file : files) {
+            getLog().info("Parsing rule file " + file.getAbsolutePath());
+            builder.add(ResourceFactory.newFileResource(file), ResourceType.DRL);
+        }
+        if (builder.hasErrors()) {
+            getLog().error("Rule errors:");
+            for (KnowledgeBuilderError error : builder.getErrors()) {
+                getLog().error(error.toString());
+            }
+            throw new MojoExecutionException("Unable to create rules. See log for details.");
+        }
+
+        KnowledgeBase base = KnowledgeBaseFactory.newKnowledgeBase();
+        base.addKnowledgePackages(builder.getKnowledgePackages());
+        return base;
+    }
+
+    private void copyProperties(final Properties source, final Properties dest) {
+        final Enumeration<Object> keys = source.keys();
+        while ( keys.hasMoreElements() ) {
+            final Object key = keys.nextElement();
+            dest.put(key, source.get(key));
+        }
+    }
+
+    private void readSlingProperties(final File propsFile, final int mode) throws MojoExecutionException {
+        if (propsFile.exists()) {
+            File tmp = null;
+            try {
+                tmp = File.createTempFile("sling", "props");
+                mavenFileFilter.copyFile(propsFile, tmp, true, project, null, true,
+                        System.getProperty("file.encoding"), mavenSession);
+                final Properties loadedProps = PropertyUtils.loadPropertyFile(tmp, null);
+                if ( mode == 0 ) {
+                    if ( this.slingProperties == null ) {
+                        this.slingProperties = loadedProps;
+                    } else {
+                        this.copyProperties(loadedProps, this.slingProperties);
+                    }
+                    filterProperties(this.slingProperties);
+                } else if ( mode == 1 ) {
+                    if ( this.slingWebappProperties == null ) {
+                        this.slingWebappProperties = loadedProps;
+                    } else {
+                        this.copyProperties(loadedProps, this.slingWebappProperties);
+                    }
+                    filterProperties(this.slingWebappProperties);
+                } else {
+                    if ( this.slingStandaloneProperties == null ) {
+                        this.slingStandaloneProperties = loadedProps;
+                    } else {
+                        this.copyProperties(loadedProps, this.slingStandaloneProperties);
+                    }
+                    filterProperties(this.slingStandaloneProperties);
+                }
+            } catch (IOException e) {
+                throw new MojoExecutionException("Unable to create filtered properties file", e);
+            } catch (MavenFilteringException e) {
+                throw new MojoExecutionException("Unable to create filtered properties file", e);
+            } finally {
+                if (tmp != null) {
+                    tmp.delete();
+                }
+            }
+        }
+    }
+
+    /**
+     * Filter properties by removing excluded properties
+     */
+    private void filterProperties(final Properties props) {
+        if ( this.propertiesExcludes != null ) {
+            for(final String name : this.propertiesExcludes) {
+                props.remove(name.trim());
+            }
+        }
+    }
+
+    protected Properties getSlingProperties(final boolean standalone) throws MojoExecutionException {
+        readSlingProperties(this.commonSlingProps, 0);
+        final Properties additionalProps = (standalone ? this.slingStandaloneProperties : this.slingWebappProperties);
+        if ( this.slingProperties == null) {
+            return additionalProps;
+        }
+        if ( additionalProps != null ) {
+            final Properties combinedProps = new Properties();
+            this.copyProperties(this.slingProperties, combinedProps);
+            this.copyProperties(additionalProps, combinedProps);
+            return combinedProps;
+        }
+        return this.slingProperties;
+    }
+
+    /**
+     * Try to read the bootstrap command file
+     * The filter is copied to a tmp location to apply filtering.
+     * @throws MojoExecutionException
+     */
+    private void readSlingBootstrap(final File bootstrapFile, final int mode) throws MojoExecutionException {
+        if (bootstrapFile.exists()) {
+            File tmp = null;
+            Reader reader = null;
+            try {
+                tmp = File.createTempFile("sling", "bootstrap");
+                mavenFileFilter.copyFile(bootstrapFile, tmp, true, project, null, true,
+                        System.getProperty("file.encoding"), mavenSession);
+                reader = new FileReader(tmp);
+                final StringBuilder sb = new StringBuilder();
+                if ( mode == 0 ) {
+                    if ( this.slingBootstrapCommand != null ) {
+                        sb.append(this.slingBootstrapCommand);
+                    }
+                } else if ( mode == 1 ) {
+                    if ( this.slingWebappBootstrapCommand != null ) {
+                        sb.append(this.slingWebappBootstrapCommand);
+                    }
+                } else {
+                    if ( this.slingStandaloneBootstrapCommand != null ) {
+                        sb.append(this.slingStandaloneBootstrapCommand);
+                    }
+                }
+                final char[] buffer = new char[2048];
+                int l;
+                while ( (l = reader.read(buffer, 0, buffer.length) ) != -1 ) {
+                    sb.append(buffer, 0, l);
+                }
+                sb.append('\n');
+                if ( mode == 0 ) {
+                    this.slingBootstrapCommand = sb.toString();
+                } else if ( mode == 1 ) {
+                    this.slingWebappBootstrapCommand = sb.toString();
+                } else {
+                    this.slingStandaloneBootstrapCommand = sb.toString();
+                }
+            } catch (final IOException e) {
+                throw new MojoExecutionException("Unable to create filtered bootstrap file", e);
+            } catch (final MavenFilteringException e) {
+                throw new MojoExecutionException("Unable to create filtered bootstrap file", e);
+            } finally {
+                if (tmp != null) {
+                    tmp.delete();
+                }
+                if ( reader != null ) {
+                    try {
+                        reader.close();
+                    } catch (final IOException ignore) {}
+                }
+            }
+        }
+    }
+
+    /**
+     * Try to read the bootstrap command file and return its content
+     * The filter is copied to a tmp location to apply filtering.
+     * @return The contents are <code>null</code>
+     * @throws MojoExecutionException
+     */
+    protected String getSlingBootstrap(final boolean standalone) throws MojoExecutionException {
+        this.readSlingBootstrap(this.commonSlingBootstrap, 0);
+        final String addCmds = (standalone ? this.slingStandaloneBootstrapCommand : this.slingWebappBootstrapCommand);
+        if ( this.slingBootstrapCommand == null ) {
+            return addCmds;
+        }
+        if ( addCmds != null ) {
+            final StringBuilder builder = new StringBuilder(this.slingBootstrapCommand);
+            builder.append('\n');
+            builder.append(addCmds);
+            return builder.toString();
+        }
+        return this.slingBootstrapCommand;
+    }
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
new file mode 100644
index 0000000..2183c2e
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -0,0 +1,229 @@
+/*
+ * 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.nodeValue;
+
+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;
+
+/**
+ * The definition of an artifact.
+ */
+public class ArtifactDefinition {
+
+    /** The artifactId */
+    private String artifactId;
+
+    /** The classifier */
+    private String classifier;
+
+    /** The groupId */
+    private String groupId;
+
+    /** The start level at which this artifact should be started */
+    private int startLevel;
+
+    /** The artifact type */
+    private String type;
+
+    /** The artifact version */
+    private String version;
+
+    /** The artifact run modes */
+    private String runModes;
+
+    public ArtifactDefinition() {
+    }
+
+    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;
+        this.runModes = bundle.getRunModes();
+    }
+
+    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);
+        this.runModes = nodeValue(config, "runModes", null);
+    }
+
+    public String getArtifactId() {
+        return artifactId;
+    }
+
+    public String getClassifier() {
+        return classifier;
+    }
+
+    public String getGroupId() {
+        return groupId;
+    }
+
+    public int getStartLevel() {
+        return startLevel;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public String getVersion() {
+        return version;
+    }
+
+    public String getRunModes() {
+        return runModes;
+    }
+
+    public void setArtifactId(String artifactId) {
+        this.artifactId = artifactId;
+    }
+
+    public void setClassifier(String classifier) {
+        this.classifier = classifier;
+    }
+
+    public void setGroupId(String groupId) {
+        this.groupId = groupId;
+    }
+
+    public void setStartLevel(int startLevel) {
+        this.startLevel = startLevel;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public void setVersion(String version) {
+        this.version = version;
+    }
+
+    @Override
+    public String toString() {
+        return "ArtifactDefinition [artifactId=" + artifactId + ", classifier="
+                + classifier + ", groupId=" + groupId + ", startLevel="
+                + startLevel + ", type=" + type + ", version=" + version
+                + ", runModes=" + runModes + "]";
+    }
+
+    /**
+     * Initialize this ArtifactDefinition with a set of default values from a
+     * comma-delimited string. This string must have 6 items in it:
+     * [groupId],[artifactId],[version],[type],[classifier],[startLevel]
+     *
+     * The only required parameter is the last one, which must be parseable as
+     * an integer.
+     *
+     * @param commaDelimitedList
+     *            the comma-delimited list
+     */
+    public void initDefaults(String commaDelimitedList) {
+        String[] values = commaDelimitedList.split(",");
+        if (values.length != 6) {
+            throw new IllegalArgumentException(
+                    String
+                            .format(
+                                    "The string %s does not have the correct number of items (6).",
+                                    commaDelimitedList));
+        }
+        initDefaults(values[0], values[1], values[2], values[3], values[4],
+                Integer.valueOf(values[5]));
+    }
+
+    /**
+     * Initialize this ArtifactDefinition with a set of default values. If the
+     * corresponding field in this object is null (or 0 in the case of start
+     * level) and the parameter is non-null, the parameter value will be used.
+     *
+     * @param groupId
+     *            the groupId
+     * @param artifactId
+     *            the artifactId
+     * @param version
+     *            the version
+     * @param type
+     *            the artifact type
+     * @param classifier
+     *            the artifact classified
+     * @param startLevel
+     *            the start level
+     */
+    public void initDefaults(String groupId, String artifactId, String version,
+            String type, String classifier, int startLevel) {
+        if (this.groupId == null && StringUtils.isNotEmpty(groupId)) {
+            this.groupId = groupId;
+        }
+        if (this.artifactId == null && StringUtils.isNotEmpty(artifactId)) {
+            this.artifactId = artifactId;
+        }
+        if (this.version == null && StringUtils.isNotEmpty(version)) {
+            this.version = version;
+        }
+        if (this.type == null && StringUtils.isNotEmpty(groupId)) {
+            this.type = type;
+        }
+        if (this.classifier == null && StringUtils.isNotEmpty(classifier)) {
+            this.classifier = classifier;
+        }
+        if (this.startLevel == 0) {
+            this.startLevel = startLevel;
+        }
+    }
+
+    public Bundle toBundle() {
+        Bundle bnd = new Bundle();
+        bnd.setArtifactId(artifactId);
+        bnd.setGroupId(groupId);
+        bnd.setVersion(version);
+        if (type != null) {
+            bnd.setType(type);
+        }
+        bnd.setClassifier(classifier);
+        bnd.setStartLevel(startLevel);
+        return bnd;
+    }
+
+    public Dependency toDependency(String scope) {
+        Dependency dep = new Dependency();
+        dep.setArtifactId(artifactId);
+        dep.setGroupId(groupId);
+        dep.setVersion(version);
+        if (type != null) {
+            dep.setType(type);
+        }
+        dep.setClassifier(classifier);
+        dep.setScope(scope);
+        return dep;
+    }
+
+    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/AttachBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
new file mode 100644
index 0000000..fe9d538
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
@@ -0,0 +1,156 @@
+/*
+ * 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.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.
+ *
+ * @goal attach-bundle-list
+ * @phase package
+ * @requiresDependencyResolution test
+ * @description attach the bundle list as a project artifact
+ */
+public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
+
+    /**
+     * @parameter default-value="${project.build.directory}/bundleList.xml"
+     */
+    private File outputFile;
+
+    /**
+     * @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 {
+        FileWriter fw = null;
+        try {
+            this.outputFile.getParentFile().mkdirs();
+            fw = new FileWriter(outputFile);
+            writer.write(fw, getInitializedBundleList());
+            projectHelper.attachArtifact(project, AttachPartialBundleListMojo.TYPE, AttachPartialBundleListMojo.CLASSIFIER, outputFile);
+        } catch (IOException e) {
+            throw new MojoExecutionException("Unable to output effective bundle list", e);
+        } finally {
+            if (fw != null) {
+                try {
+                    fw.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+        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();
+            copyDirectory(this.getConfigDirectory(), configDir,
+                    null, FileUtils.getDefaultExcludes());
+        }
+        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);
+    }
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
new file mode 100644
index 0000000..2f4caf5
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -0,0 +1,191 @@
+/*
+ * 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.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.
+ *
+ * @goal attach-partial-bundle-list
+ * @phase package
+ * @requiresDependencyResolution test
+ * @description attach the partial bundle list as a project artifact
+ */
+public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
+
+    public static final String CONFIG_CLASSIFIER = "bundlelistconfig";
+
+    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";
+
+    public static final String SLING_WEBAPP_PROPS = "webapp.properties";
+
+    public static final String SLING_WEBAPP_BOOTSTRAP = "webapp.bootstrap.txt";
+
+    public static final String SLING_STANDALONE_PROPS = "standalone.properties";
+
+    public static final String SLING_STANDALONE_BOOTSTRAP = "standalone.bootstrap.txt";
+
+    /**
+     * @parameter default-value="${project.build.directory}/bundleListconfig"
+     */
+    private File configOutputDir;
+
+    /**
+     * @parameter default-value="${project.build.directory}/list.xml"
+     */
+    private File bundleListOutput;
+
+    /**
+     * The zip archiver.
+     *
+     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="zip"
+     */
+    private ZipArchiver zipArchiver;
+
+    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 {
+            throw new MojoFailureException(String.format("Bundle list file %s does not exist.", bundleListFile.getAbsolutePath()));
+        }
+
+        interpolateProperties(initializedBundleList, this.project, this.mavenSession);
+
+        final BundleListXpp3Writer writer = new BundleListXpp3Writer();
+        try {
+            this.bundleListOutput.getParentFile().mkdirs();
+            writer.write(new FileWriter(bundleListOutput), initializedBundleList);
+        } catch (IOException e) {
+            throw new MojoExecutionException("Unable to write bundle list", e);
+        }
+
+        // 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 {
+            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.checkFile(this.commonSlingBootstrap);
+        hasConfigs |= this.checkFile(this.commonSlingProps);
+        hasConfigs |= this.checkFile(this.webappSlingBootstrap);
+        hasConfigs |= this.checkFile(this.webappSlingProps);
+        hasConfigs |= this.checkFile(this.standaloneSlingBootstrap);
+        hasConfigs |= this.checkFile(this.standaloneSlingProps);
+
+        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.checkFile(this.commonSlingBootstrap) ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            FileUtils.copyFile(this.commonSlingBootstrap, new File(slingDir, SLING_COMMON_BOOTSTRAP));
+        }
+        if ( this.checkFile(this.commonSlingProps) ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            FileUtils.copyFile(this.commonSlingProps, new File(slingDir, SLING_COMMON_PROPS));
+        }
+        if ( this.checkFile(this.webappSlingBootstrap) ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            FileUtils.copyFile(this.webappSlingBootstrap, new File(slingDir, SLING_WEBAPP_BOOTSTRAP));
+        }
+        if ( this.checkFile(this.webappSlingProps) ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            FileUtils.copyFile(this.webappSlingProps, new File(slingDir, SLING_WEBAPP_PROPS));
+        }
+        if ( this.checkFile(this.standaloneSlingBootstrap) ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            FileUtils.copyFile(this.standaloneSlingBootstrap, new File(slingDir, SLING_STANDALONE_BOOTSTRAP));
+        }
+        if ( this.checkFile(this.standaloneSlingProps) ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            FileUtils.copyFile(this.standaloneSlingProps, new File(slingDir, SLING_STANDALONE_PROPS));
+        }
+        if ( this.checkFile(this.getConfigDirectory()) ) {
+            final File configDir = new File(this.configOutputDir, "config");
+            configDir.mkdirs();
+            copyDirectory(this.getConfigDirectory(), configDir,
+                    null, FileUtils.getDefaultExcludes());
+        }
+        final File destFile = new File(this.configOutputDir.getParent(), this.configOutputDir.getName() + ".zip");
+        zipArchiver.setDestFile(destFile);
+        zipArchiver.addDirectory(this.configOutputDir);
+        zipArchiver.createArchive();
+
+        projectHelper.attachArtifact(project, CONFIG_TYPE, CONFIG_CLASSIFIER, destFile);
+    }
+}
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/CheckBundleListForSnapshotsMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
new file mode 100644
index 0000000..59e92cf
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
@@ -0,0 +1,74 @@
+/*
+ * 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.util.ArrayList;
+import java.util.List;
+
+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;
+
+/**
+ * Validate that the bundle list file (if it exists) does not contain references
+ * to SNAPSHOT versions.
+ *
+ * @goal check-bundle-list-for-snapshots
+ * @requiresDependencyResolution test
+ *
+ */
+public class CheckBundleListForSnapshotsMojo extends AbstractUsingBundleListMojo {
+
+    /**
+     * True if the build should be failed if a snapshot is found.
+     *
+     * @parameter default-value="true"
+     */
+    private boolean failOnSnapshot;
+
+    @Override
+    protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
+        List<Bundle> snapshots = new ArrayList<Bundle>();
+        BundleList bundleList = getInitializedBundleList();
+        for (StartLevel level : bundleList.getStartLevels()) {
+            for (Bundle bundle : level.getBundles()) {
+                if (isSnapshot(bundle)) {
+                    snapshots.add(bundle);
+                }
+            }
+        }
+        if (!snapshots.isEmpty()) {
+            getLog().error("The following entries in the bundle list file are SNAPSHOTs:");
+            for (Bundle bundle : snapshots) {
+                getLog().error(
+                        String
+                                .format("     %s:%s:%s", bundle.getGroupId(), bundle.getArtifactId(), bundle
+                                        .getVersion()));
+            }
+            if (failOnSnapshot) {
+                throw new MojoFailureException("SNAPSHOTs were found in the bundle list. See log.");
+            }
+        }
+    }
+
+    private boolean isSnapshot(Bundle bundle) {
+        return bundle.getVersion().endsWith("SNAPSHOT");
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ControlListener.java b/src/main/java/org/apache/sling/maven/projectsupport/ControlListener.java
new file mode 100644
index 0000000..3e3dba5
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ControlListener.java
@@ -0,0 +1,212 @@
+/*
+ * 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.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.net.ConnectException;
+import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.ServerSocket;
+import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.UnknownHostException;
+
+import org.apache.maven.plugin.logging.Log;
+
+/**
+ * This class is adapted from org.apache.sling.launchpad.app.ControlListener.
+ */
+class ControlListener implements Runnable {
+    // command sent by the client to cause Sling to shutdown
+    static final String COMMAND_STOP = "stop";
+
+    // command sent by the client to check for the status of the server
+    static final String COMMAND_STATUS = "status";
+
+    // the response sent by the server if the command executed successfully
+    private static final String RESPONSE_OK = "OK";
+
+    // The default port to listen on and to connect to
+    private static final int DEFAULT_LISTEN_PORT = 63000;
+
+    /** The mojo */
+    private AbstractLaunchpadStartingMojo mojo;
+
+    /** The log object */
+    private final Log log;
+
+    /** The socket address used for control communication */
+    private final SocketAddress socketAddress;
+
+    ControlListener(AbstractLaunchpadStartingMojo mojo, Log log, String host, int port) {
+        this.mojo = mojo;
+        this.log = log;
+        this.socketAddress = getSocketAddress(host, port);
+    }
+
+    /**
+     * Implements the server side of the control connection starting a thread
+     * listening on the host and port configured on setup of this instance.
+     */
+    void listen() {
+        if (socketAddress != null) {
+            Thread listener = new Thread(this);
+            listener.setDaemon(true);
+            listener.setName("Sling Control Listener@" + socketAddress);
+            listener.start();
+        } else {
+            log.info("No socket address to listen to");
+        }
+    }
+
+    /**
+     * Implements the client side of the control connection sending the command
+     * to shutdown Sling.
+     */
+    void shutdownServer() {
+        sendCommand(COMMAND_STOP);
+    }
+
+    /**
+     * Implements the client side of the control connection sending the command
+     * to check whether Sling is active.
+     */
+    void statusServer() {
+        sendCommand(COMMAND_STATUS);
+    }
+
+    // ---------- Runnable interface
+
+    /**
+     * Implements the server thread receiving commands from clients and acting
+     * upon them.
+     */
+    public void run() {
+        ServerSocket server = null;
+        try {
+            server = new ServerSocket();
+            server.bind(socketAddress);
+            log.info("Sling Control Server started on " + socketAddress.toString());
+        } catch (IOException ioe) {
+            log.error("Failed to start Sling Control Server", ioe);
+            return;
+        }
+
+        try {
+            while (true) {
+
+                Socket s = server.accept();
+                try {
+                    String command = readLine(s);
+                    log.info(s.getRemoteSocketAddress() + ">" + command);
+
+                    if (COMMAND_STOP.equals(command)) {
+                        if (mojo != null) {
+                            mojo.stopSling();
+                        }
+                        writeLine(s, RESPONSE_OK);
+
+                        log.info("Sling shut down, stopping Sling.");
+                        mojo.stopSling();
+
+                    } else if (COMMAND_STATUS.equals(command)) {
+                        writeLine(s, RESPONSE_OK);
+
+                    } else {
+                        writeLine(s, "ERR:" + command);
+
+                    }
+                } finally {
+                    try {
+                        s.close();
+                    } catch (IOException ignore) {
+                    }
+                }
+            }
+        } catch (IOException ioe) {
+            log.error("Failure reading from client", ioe);
+        } finally {
+            try {
+                server.close();
+            } catch (IOException ignore) {
+            }
+        }
+    }
+
+    // ---------- socket support
+
+    private SocketAddress getSocketAddress(String host, int port) {
+        try {
+            if (port == -1) {
+                port = DEFAULT_LISTEN_PORT;
+            }
+
+            if (host != null) {
+                return new InetSocketAddress(host, port);
+            } else {
+
+                return new InetSocketAddress(InetAddress.getLocalHost(), port);
+            }
+        } catch (UnknownHostException uhe) {
+            log.error("Unknown host in '" + host + "': " + uhe.getMessage(), null);
+        }
+
+        return null;
+    }
+
+    private void sendCommand(String command) {
+        if (socketAddress != null) {
+            Socket socket = null;
+            try {
+                socket = new Socket();
+                socket.connect(socketAddress);
+                writeLine(socket, command);
+                String result = readLine(socket);
+                log.info("Sent '" + command + "' to " + socketAddress + ": " + result, null);
+            } catch (ConnectException ce) {
+                log.info("No Sling running at " + socketAddress, null);
+            } catch (IOException ioe) {
+                log.error("Failed sending '" + command + "' to " + socketAddress, ioe);
+            } finally {
+                if (socket != null) {
+                    try {
+                        socket.close();
+                    } catch (IOException ignore) {
+                    }
+                }
+            }
+        } else {
+            log.info("No socket address to send '" + command + "' to", null);
+        }
+    }
+
+    private String readLine(Socket socket) throws IOException {
+        BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream(), "UTF-8"));
+        return br.readLine();
+    }
+
+    private void writeLine(Socket socket, String line) throws IOException {
+        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), "UTF-8"));
+        bw.write(line);
+        bw.write("\r\n");
+        bw.flush();
+    }
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
new file mode 100644
index 0000000..c46da9b
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
@@ -0,0 +1,187 @@
+/*
+ * 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.IOException;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.model.Resource;
+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.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.jar.JarArchiver;
+import org.codehaus.plexus.util.DirectoryScanner;
+
+/**
+ * Create and attach a JAR file containing the resolved artifacts from the
+ * bundle list.
+ *
+ * @goal create-bundle-jar
+ * @requiresDependencyResolution test
+ * @phase package
+ *
+ */
+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 = 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(), bundle.getRunModes(), 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
+     */
+    private static String[] getFilesToCopy(Resource resource) {
+        DirectoryScanner scanner = new DirectoryScanner();
+        scanner.setBasedir(resource.getDirectory());
+        if (resource.getIncludes() != null && !resource.getIncludes().isEmpty()) {
+            scanner.setIncludes(resource.getIncludes().toArray(
+                    new String[resource.getIncludes().size()]));
+        } else {
+            scanner.setIncludes(DEFAULT_INCLUDES);
+        }
+        if (resource.getExcludes() != null && !resource.getExcludes().isEmpty()) {
+            scanner.setExcludes(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
new file mode 100644
index 0000000..504d9cd
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
@@ -0,0 +1,109 @@
+/*
+ * 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.FileOutputStream;
+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.jdom.Document;
+import org.jdom.Element;
+import org.jdom.output.Format;
+import org.jdom.output.XMLOutputter;
+
+/**
+ * Create and attach a karaf feature descriptor XML file.
+ *
+ * @goal create-karaf-descriptor
+ * @phase package
+ * @description create a karaf feature descriptor
+ * @requiresDependencyResolution test
+ */
+public class CreateKarafFeatureDescriptorMojo extends AbstractUsingBundleListMojo {
+
+    private static final String CLASSIFIER = "features";
+
+    private static final String TYPE = "xml";
+
+    /**
+     * @parameter default-value="sling"
+     */
+    private String featureName;
+
+    /**
+     * @parameter default-value="sling-2.0"
+     */
+    private String featuresName;
+
+    /**
+     * @parameter default-value="${project.version}"
+     */
+    private String featureVersion;
+
+    /**
+     * The output directory.
+     *
+     * @parameter default-value="${project.build.directory}/features.xml"
+     */
+    private File outputFile;
+
+    @Override
+    protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
+        Document doc = new Document();
+
+        Element features = new Element("features");
+        doc.setRootElement(features);
+        features.setAttribute("name", featuresName);
+
+        Element feature = new Element("feature");
+        features.addContent(feature);
+        feature.setAttribute("name", featureName);
+        feature.setAttribute("version", featureVersion);
+
+        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
+                        .getVersion());
+                feature.addContent(new Element("bundle").setText(bundleRef));
+            }
+        }
+
+        FileOutputStream out = null;
+        try {
+            out = new FileOutputStream(outputFile);
+            new XMLOutputter(Format.getPrettyFormat().setEncoding("UTF-8")).output(doc, out);
+            projectHelper.attachArtifact(project, TYPE, CLASSIFIER, outputFile);
+        } catch (IOException e) {
+            throw new MojoExecutionException("Unable to write features.xml", e);
+        } finally {
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java
new file mode 100644
index 0000000..9e98997
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java
@@ -0,0 +1,77 @@
+/*
+ * 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.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.Bundle;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
+
+/**
+ * Create and attach a Pax Runner bundle provision file.
+ * 
+ * @goal create-paxrunner-provision-file
+ * @phase package
+ * @description create a Pax Runner bundle provision file
+ * @requiresDependencyResolution test
+ */
+public class CreatePaxRunnerBundleProvisionFileMojo extends AbstractUsingBundleListMojo {
+
+    private static final String CLASSIFIER = "bundles";
+
+    private static final String TYPE = "pax";
+
+    /**
+     * The output directory.
+     * 
+     * @parameter default-value="${project.build.directory}/bundles-pax"
+     */
+    private File outputFile;
+
+    @Override
+    protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
+        FileWriter out = null;
+        try {
+            out = new FileWriter(outputFile);
+
+            BundleList bundleList = getInitializedBundleList();
+            for (StartLevel level : bundleList.getStartLevels()) {
+                for (Bundle bundle : level.getBundles()) {
+                    String line = String.format("mvn:%s/%s/%s@%d\n", bundle.getGroupId(), bundle.getArtifactId(),
+                            bundle.getVersion(), level.getStartLevel());
+                    out.write(line);
+                }
+            }
+
+            projectHelper.attachArtifact(project, TYPE, CLASSIFIER, outputFile);
+        } catch (IOException e) {
+            throw new MojoExecutionException("Unable to write " + outputFile.getName(), e);
+        } finally {
+            if (out != null) {
+                try {
+                    out.close();
+                } catch (IOException e) {
+                }
+            }
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
new file mode 100644
index 0000000..7f11573
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
@@ -0,0 +1,254 @@
+/*
+ * 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.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.maven.artifact.ArtifactUtils;
+import org.apache.maven.artifact.manager.WagonManager;
+import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.versioning.ArtifactVersion;
+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.plugin.MojoFailureException;
+import org.apache.maven.project.path.PathTranslator;
+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.mojo.versions.api.ArtifactVersions;
+import org.codehaus.mojo.versions.api.DefaultVersionsHelper;
+import org.codehaus.mojo.versions.api.UpdateScope;
+import org.codehaus.mojo.versions.api.VersionsHelper;
+import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+/**
+ * Displays all bundles that have newer versions available. Highly based upon the
+ * display-dependency-updates goal from the Versions plugin.
+ *
+ * @since 2.0.8
+ * @goal display-bundle-updates
+ *
+ */
+public class DisplayBundleUpdatesMojo extends AbstractMojo {
+
+    /**
+     * The width to pad info messages.
+     */
+    private static final int INFO_PAD_SIZE = 72;
+
+    /**
+     * @component
+     */
+    private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory;
+
+    /**
+     * The artifact metadata source to use.
+     *
+     * @component
+     * @required
+     * @readonly
+     */
+    private ArtifactMetadataSource artifactMetadataSource;
+
+    /**
+     * @parameter expression="${project.remoteArtifactRepositories}"
+     * @readonly
+     */
+    private List<ArtifactRepository> remoteArtifactRepositories;
+
+    /**
+     * @parameter expression="${project.pluginArtifactRepositories}"
+     * @readonly
+     */
+    private List<ArtifactRepository> remotePluginRepositories;
+
+    /**
+     * @parameter expression="${localRepository}"
+     * @readonly
+     */
+    private ArtifactRepository localRepository;
+
+    /**
+     * @component
+     */
+    private WagonManager wagonManager;
+
+    /**
+     * @parameter expression="${settings}"
+     * @readonly
+     */
+    private Settings settings;
+
+    /**
+     * settings.xml's server id for the URL. This is used when wagon needs extra
+     * authentication information.
+     *
+     * @parameter expression="${maven.version.rules.serverId}"
+     *            default-value="serverId";
+     */
+    private String serverId;
+
+    /**
+     * The Wagon URI of a ruleSet file containing the rules that control how to
+     * compare version numbers.
+     *
+     * @parameter expression="${maven.version.rules}"
+     */
+    private String rulesUri;
+
+    /**
+     * The Maven Session.
+     *
+     * @parameter expression="${session}"
+     * @required
+     * @readonly
+     */
+    private MavenSession session;
+
+    /**
+     * @component
+     */
+    private PathTranslator pathTranslator;
+
+    /**
+     * @parameter default-value="${basedir}/src/main/bundles/list.xml"
+     */
+    private File bundleListFile;
+
+    /**
+     * Whether to allow snapshots when searching for the latest version of an
+     * artifact.
+     *
+     * @parameter expression="${allowSnapshots}" default-value="false"
+     */
+    private boolean allowSnapshots;
+
+    /**
+     * Our versions helper.
+     */
+    private VersionsHelper helper;
+
+    @SuppressWarnings("unchecked")
+    public void execute() throws MojoExecutionException, MojoFailureException {
+        try {
+            BundleList bundleList = readBundleList(bundleListFile);
+
+            Set<Dependency> bundlesAsDependencies = new HashSet<Dependency>();
+
+            for (StartLevel startLevel : bundleList.getStartLevels()) {
+                for (Bundle bundle : startLevel.getBundles()) {
+                    bundlesAsDependencies.add(asDependency(bundle));
+                }
+            }
+
+            logUpdates(getHelper().lookupDependenciesUpdates(bundlesAsDependencies, false));
+        } catch (Exception e) {
+            throw new MojoExecutionException("Unable to read bundle list.", e);
+        }
+
+    }
+
+    private Dependency asDependency(Bundle bundle) {
+        Dependency dep = new Dependency();
+        dep.setGroupId(bundle.getGroupId());
+        dep.setArtifactId(bundle.getArtifactId());
+        dep.setClassifier(bundle.getClassifier());
+        dep.setVersion(bundle.getVersion());
+        dep.setType(bundle.getType());
+
+        return dep;
+    }
+
+    private VersionsHelper getHelper() throws MojoExecutionException {
+        if (helper == null) {
+            helper = new DefaultVersionsHelper(artifactFactory, artifactMetadataSource, remoteArtifactRepositories,
+                    remotePluginRepositories, localRepository, wagonManager, settings, serverId, rulesUri, getLog(),
+                    session, pathTranslator);
+        }
+        return helper;
+    }
+
+    private void logUpdates(Map<Dependency, ArtifactVersions> updates) {
+        List<String> withUpdates = new ArrayList<String>();
+        List<String> usingCurrent = new ArrayList<String>();
+        for (ArtifactVersions versions : updates.values()) {
+            String left = "  " + ArtifactUtils.versionlessKey(versions.getArtifact()) + " ";
+            final String current = versions.isCurrentVersionDefined() ? versions.getCurrentVersion().toString()
+                    : versions.getArtifact().getVersionRange().toString();
+            ArtifactVersion latest = versions.getNewestUpdate(UpdateScope.ANY, Boolean.TRUE.equals(allowSnapshots));
+            if (latest != null && !versions.isCurrentVersionDefined()) {
+                if (versions.getArtifact().getVersionRange().containsVersion(latest)) {
+                    latest = null;
+                }
+            }
+            String right = " " + (latest == null ? current : current + " -> " + latest.toString());
+            List<String> t = latest == null ? usingCurrent : withUpdates;
+            if (right.length() + left.length() + 3 > INFO_PAD_SIZE) {
+                t.add(left + "...");
+                t.add(StringUtils.leftPad(right, INFO_PAD_SIZE));
+
+            } else {
+                t.add(StringUtils.rightPad(left, INFO_PAD_SIZE - right.length(), ".") + right);
+            }
+        }
+
+        if (usingCurrent.isEmpty() && !withUpdates.isEmpty()) {
+            getLog().info("No bundles are using the newest version.");
+            getLog().info("");
+        } else if (!usingCurrent.isEmpty()) {
+            getLog().info("The following bundles are using the newest version:");
+            for (String str : usingCurrent) {
+                getLog().info(str);
+            }
+            getLog().info("");
+        }
+        if (withUpdates.isEmpty() && !usingCurrent.isEmpty()) {
+            getLog().info("No bundles have newer versions.");
+            getLog().info("");
+        } else if (!withUpdates.isEmpty()) {
+            getLog().info("The following bundles have newer versions:");
+            for (String str : withUpdates) {
+                getLog().info(str);
+            }
+            getLog().info("");
+        }
+    }
+
+    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();
+        }
+    }
+
+}
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..57dd147
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java
@@ -0,0 +1,232 @@
+/*
+ * 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";
+    
+    private static final String PROVIDED = "provided";
+
+    @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(PROVIDED));
+                }
+
+                if (hasJarPackagingExecution()) {
+                    log.debug(String.format("adding jar web support (%s) to dependencies of project %s", jarWebSupport, project));
+                    project.getDependencies().add(jarWebSupport.toDependency(PROVIDED));
+                }
+            }
+        }
+
+        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, PROVIDED));
+                }
+            }
+        }
+
+        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/OutputBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
new file mode 100644
index 0000000..31d0523
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
@@ -0,0 +1,45 @@
+/*
+ * 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 java.io.OutputStreamWriter;
+
+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;
+
+/**
+ * Output the bundle list back to the console.
+ * 
+ * @goal output-bundle-list
+ * @requiresDependencyResolution test
+ * 
+ */
+public class OutputBundleListMojo extends AbstractUsingBundleListMojo {
+
+    @Override
+    protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
+        BundleListXpp3Writer writer = new BundleListXpp3Writer();
+        try {
+            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
new file mode 100644
index 0000000..a221434
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -0,0 +1,352 @@
+/*
+ * 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.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.Properties;
+
+import org.apache.maven.artifact.Artifact;
+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.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.UnArchiver;
+import org.codehaus.plexus.archiver.jar.JarArchiver;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
+import org.codehaus.plexus.util.FileUtils;
+
+/**
+ * Initialize a Sling application project by extracting bundles into the correct
+ * locations.
+ *
+ * @goal prepare-package
+ * @requiresDependencyResolution test
+ * @phase process-sources
+ * @description initialize a Sling application project
+ */
+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 temp directory (i.e. target/maven-launchpad-plugintmp).
+     *
+     * @parameter expression="${project.build.directory}/maven-launchpad-plugintmp"
+     * @readonly
+     */
+    private File tempDirectory;
+
+    /**
+     * To look up Archiver/UnArchiver implementations
+     *
+     * @component
+     */
+    private ArchiverManager archiverManager;
+
+    /**
+     * The Jar archiver.
+     *
+     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
+     */
+    private JarArchiver jarArchiver;
+
+    @Override
+    public void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
+        copyBaseArtifact();
+        copyBundles(getInitializedBundleList(), getOutputDirectory());
+        copyConfigurationFiles();
+        if (JAR.equals(packaging)) {
+            unpackBaseArtifact();
+        }
+    }
+
+    @Override
+    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"));
+    }
+
+    /**
+     * Add the JAR Web Support bundle to the bundle list.
+     */
+    @Override
+    protected void initBundleList(BundleList bundleList) {
+        if (packaging.equals(JAR)) {
+            bundleList.add(jarWebSupport.toBundle());
+        }
+    }
+
+    /**
+     * Patch the sling properties
+     */
+    private void patchSlingProperties(final File dest, final Properties additionalProps)
+    throws MojoExecutionException {
+        final File origSlingProps = new File(dest, "sling.properties");
+        if ( !origSlingProps.exists() ) {
+            throw new MojoExecutionException("sling.properties not found at " + origSlingProps);
+        }
+
+        // read original properties
+        final Properties orig = new Properties();
+        FileInputStream fis = null;
+        try {
+            fis = new FileInputStream(origSlingProps);
+            orig.load(fis);
+        } catch (final IOException ioe) {
+            throw new MojoExecutionException("Unable to read " + origSlingProps, ioe);
+        } finally {
+            if ( fis != null ) {
+                try { fis.close(); } catch (final IOException ignore) {}
+            }
+        }
+
+        // patch
+        final Enumeration<Object> keys = additionalProps.keys();
+        if ( keys.hasMoreElements() ) {
+            getLog().info("Patching sling.properties");
+        }
+        while ( keys.hasMoreElements() ) {
+            final Object key = keys.nextElement();
+            orig.put(key, additionalProps.get(key));
+        }
+
+        /// and save
+        FileOutputStream fos = null;
+        try {
+            fos = new FileOutputStream(origSlingProps);
+            orig.store(fos, null);
+        } catch (final IOException ioe) {
+            throw new MojoExecutionException("Unable to save " + origSlingProps, ioe);
+        } finally {
+            if ( fis != null ) {
+                try { fis.close(); } catch (final IOException ignore) {}
+            }
+        }
+    }
+
+    /**
+     * Patch the sling bootstrap command file
+     */
+    private void patchSlingBootstrap(final File dest, final String additionalCmd)
+    throws MojoExecutionException {
+        getLog().info("Patching sling_bootstrap.txt");
+        final File origSlingCmd = new File(dest, "sling_bootstrap.txt");
+        FileWriter writer = null;
+
+        /// and write
+        try {
+            writer = new FileWriter(origSlingCmd);
+
+            writer.write(additionalCmd);
+        } catch (final IOException ioe) {
+            throw new MojoExecutionException("Unable to save " + origSlingCmd, ioe);
+        } finally {
+            if ( writer != null ) {
+                try { writer.close(); } catch (final IOException ignore) {}
+            }
+        }
+    }
+
+    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
+                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 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()));
+        }
+        unpack(artifact.getFile(), buildOutputDirectory);
+    }
+
+    private void copyConfigurationFiles() throws MojoExecutionException {
+        final File configDir = this.getConfigDirectory();
+        if (configDir.exists() ) {
+            try {
+                copyDirectory(configDir, new File(getOutputDirectory(), CONFIG_PATH_PREFIX), null, FileUtils.getDefaultExcludes());
+            } catch (IOException e) {
+                throw new MojoExecutionException("Unable to copy configuration files", e);
+            }
+        }
+    }
+
+    private void unpack(File source, File destination)
+            throws MojoExecutionException {
+        getLog().info("Unpacking " + source.getPath() + " to\n  " + destination.getPath());
+        try {
+            destination.mkdirs();
+
+            UnArchiver unArchiver = archiverManager.getUnArchiver(source);
+
+            unArchiver.setSourceFile(source);
+            unArchiver.setDestDirectory(destination);
+
+            unArchiver.extract();
+        } catch (NoSuchArchiverException e) {
+            throw new MojoExecutionException("Unable to find archiver for " + source.getPath(), e);
+        } catch (ArchiverException e) {
+            throw new MojoExecutionException("Unable to unpack " + source.getPath(), e);
+        }
+    }
+
+    private void pack(File sourceDir, File destination)
+    throws MojoExecutionException {
+        getLog().info("Packing " + sourceDir.getPath() + " to\n  " + destination.getPath());
+        try {
+            destination.getParentFile().mkdirs();
+
+            jarArchiver.setDestFile(destination);
+            jarArchiver.addDirectory(sourceDir);
+            jarArchiver.setManifest(new File(sourceDir, "META-INF/MANIFEST.MF".replace('/', File.separatorChar)));
+            jarArchiver.createArchive();
+        } catch (IOException e) {
+            throw new MojoExecutionException("Unable to pack " + sourceDir.getPath(), e);
+        } catch (ArchiverException e) {
+            throw new MojoExecutionException("Unable to pack " + sourceDir.getPath(), e);
+        }
+    }
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
new file mode 100644
index 0000000..d38d1cf
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
@@ -0,0 +1,92 @@
+/*
+ * 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 org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * Initialize a Sling integration test webapp by extracting bundles into the
+ * correct locations, including the current artifact.
+ *
+ * @goal prepare-test-webapp
+ * @requiresDependencyResolution test
+ * @phase package
+ */
+public class PrepareTestWebAppMojo extends PreparePackageMojo {
+
+    /**
+     * The project's build directory (i.e. target).
+     *
+     * @parameter expression="${project.build.directory}"
+     * @readonly
+     */
+    private File buildDirectory;
+
+    /**
+     * The start level for the current artifact.
+     *
+     * @parameter default-value="16"
+     */
+    private int startLevel;
+
+    /**
+     * The output directory for bundles.
+     *
+     * @parameter default-value="${project.build.directory}/launchpad-bundles"
+     */
+    private File outputDirectory;
+
+    /**
+     * @component
+     */
+    private ArtifactHandlerManager artifactHandlerManager;
+
+    @Override
+    public void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
+        super.executeWithArtifacts();
+        copy(getPrimaryArtifact(), startLevel, null, getOutputDirectory());
+    }
+
+    @Override
+    protected File getOutputDirectory() {
+        return outputDirectory;
+    }
+
+
+    @Override
+    protected void unpackBaseArtifact() throws MojoExecutionException {
+        // No-op. This is JAR-specific.
+    }
+
+    private File getPrimaryArtifact() throws MojoExecutionException {
+        ArtifactHandler handler = artifactHandlerManager.getArtifactHandler(project.getPackaging());
+
+        String artifactName = project.getBuild().getFinalName() + "." + handler.getExtension();
+
+        File file = new File(buildDirectory, artifactName);
+        if (!file.exists()) {
+            throw new MojoExecutionException("Project's primary artifact (" + file.getPath() + ") doesn't exist.");
+        }
+        return file;
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java
new file mode 100644
index 0000000..feaecd5
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java
@@ -0,0 +1,101 @@
+/*
+ * 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.util.Map;
+
+import org.apache.felix.framework.Logger;
+import org.apache.sling.launchpad.api.LaunchpadContentProvider;
+import org.apache.sling.launchpad.base.impl.Sling;
+import org.osgi.framework.BundleException;
+
+/**
+ * Run a Launchpad application.
+ *
+ * @goal run
+ * @requiresDependencyResolution test
+ *
+ */
+public class RunMojo extends AbstractLaunchpadStartingMojo {
+
+
+
+    private Thread shutdown = new Thread() {
+        /**
+         * Called when the Java VM is being terminiated, for example because the
+         * KILL signal has been sent to the process. This method calls stop on
+         * the launched Sling instance to terminate the framework before
+         * returning.
+         */
+        @Override
+        public void run() {
+            getLog().info("Java VM is shutting down", null);
+            shutdown();
+        }
+
+        // ---------- Shutdown support for control listener and shutdown hook
+
+        void shutdown() {
+            // remove the shutdown hook, will fail if called from the
+            // shutdown hook itself. Otherwise this prevents shutdown
+            // from being called again
+            try {
+                Runtime.getRuntime().removeShutdownHook(this);
+            } catch (Throwable t) {
+                // don't care for problems removing the hook
+            }
+
+            stopSling();
+        }
+    };
+    
+    private boolean registeredHook = false;
+
+    protected Sling startSling(LaunchpadContentProvider resourceProvider, final Map<String, String> props, Logger logger)
+            throws BundleException {
+        if (!registeredHook) {
+            Runtime.getRuntime().addShutdownHook(shutdown);
+            registeredHook = true;
+        }
+        
+        // creating the instance launches the framework and we are done here
+        Sling mySling = new Sling(this, logger, resourceProvider, props) {
+
+            // overwrite the loadPropertiesOverride method to inject the
+            // mojo arguments unconditionally. These will not be persisted
+            // in any properties file, though
+            protected void loadPropertiesOverride(
+                    Map<String, String> properties) {
+                if (props != null) {
+                    properties.putAll(props);
+                }
+            }
+        };
+
+        // TODO this seems hacky!
+        try {
+            while (mySling != null) {
+                Thread.sleep(100);
+            }
+        } catch (InterruptedException e) {
+        }
+
+        return mySling;
+    }
+
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java
new file mode 100644
index 0000000..4a48571
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java
@@ -0,0 +1,67 @@
+/*
+ * 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.util.Map;
+
+import org.apache.felix.framework.Logger;
+import org.apache.sling.launchpad.api.LaunchpadContentProvider;
+import org.apache.sling.launchpad.base.impl.Sling;
+import org.osgi.framework.BundleException;
+
+/**
+ * Start a Launchpad application.
+ *
+ * @goal start
+ * @requiresDependencyResolution test
+ *
+ */
+public class StartMojo extends AbstractLaunchpadStartingMojo {
+
+    /**
+     * @parameter expression="${sling.control.port}" default-value="63000"
+     */
+    private int controlPort;
+
+    /**
+     * @parameter expression="${sling.control.host}"
+     */
+    private String controlHost;
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    protected Sling startSling(LaunchpadContentProvider resourceProvider, final Map<String, String> props, Logger logger)
+            throws BundleException {
+        new ControlListener(this, getLog(), controlHost, controlPort).listen();
+
+        return new Sling(this, logger, resourceProvider, props) {
+
+            // overwrite the loadPropertiesOverride method to inject the
+            // mojo arguments unconditionally. These will not be persisted
+            // in any properties file, though
+            protected void loadPropertiesOverride(
+                    Map<String, String> properties) {
+                if (props != null) {
+                    properties.putAll(props);
+                }
+            }
+        };
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java
new file mode 100644
index 0000000..95388e5
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java
@@ -0,0 +1,49 @@
+/*
+ * 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.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * Gets the status a running Launchpad standalone application.
+ *
+ * @goal status
+ * @requiresProject false
+ *
+ */
+public class StatusMojo extends AbstractMojo {
+
+    /**
+     * @parameter expression="${sling.control.port}" default-value="63000"
+     */
+    private int controlPort;
+
+    /**
+     * @parameter expression="${sling.control.host}" default-value="localhost"
+     */
+    private String controlHost;
+
+    /**
+     * {@inheritDoc}
+     */
+    public void execute() throws MojoExecutionException, MojoFailureException {
+        new ControlListener(null, getLog(), controlHost, controlPort).statusServer();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java
new file mode 100644
index 0000000..8fe3a8f
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java
@@ -0,0 +1,49 @@
+/*
+ * 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.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * Stop a running Launchpad standalone application.
+ *
+ * @goal stop
+ * @requiresProject false
+ *
+ */
+public class StopMojo extends AbstractMojo {
+
+    /**
+     * @parameter expression="${sling.control.port}" default-value="63000"
+     */
+    private int controlPort;
+
+    /**
+     * @parameter expression="${sling.control.host}" default-value="localhost"
+     */
+    private String controlHost;
+
+    /**
+     * {@inheritDoc}
+     */
+    public void execute() throws MojoExecutionException, MojoFailureException {
+        new ControlListener(null, getLog(), controlHost, controlPort).shutdownServer();
+    }
+
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundle.java b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundle.java
new file mode 100644
index 0000000..9ae1f8d
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundle.java
@@ -0,0 +1,39 @@
+/*
+ * 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.bundlelist;
+
+public abstract class BaseBundle {
+
+    public abstract String getArtifactId();
+
+    public abstract String getClassifier();
+
+    public abstract String getGroupId();
+
+    public abstract int getStartLevel();
+
+    public abstract String getType();
+
+    public abstract String getVersion();
+
+    @Override
+    public String toString() {
+        return "Bundle [artifactId=" + getArtifactId() + ", classifier="
+                + getClassifier() + ", groupId=" + getGroupId() + ", startLevel="
+                + getStartLevel() + ", type=" + getType() + ", version=" + getVersion() + "]";
+    }
+}
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
new file mode 100644
index 0000000..1c7bc56
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
@@ -0,0 +1,115 @@
+/*
+ * 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.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 {
+
+    public abstract List<StartLevel> getStartLevels();
+
+    public Bundle get(Bundle bundle, boolean compareVersions) {
+        for (StartLevel sl : getStartLevels()) {
+            Bundle foundBundle = sl.getBundle(bundle, compareVersions);
+            if (foundBundle != null) {
+                return foundBundle;
+            }
+        }
+        return null;
+    }
+
+    public boolean remove(Bundle bundle, boolean compareVersions) {
+        for (StartLevel sl : getStartLevels()) {
+            if (sl.removeBundle(bundle, compareVersions)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+
+    /**
+     * Merge the current bundle list with an additional list.
+     * @see #add(Bundle)
+     *
+     * @param bundleList the new bundle list
+     */
+    public void merge(BundleList bundleList) {
+        for (StartLevel sl : bundleList.getStartLevels()) {
+            for (Bundle bnd : sl.getBundles()) {
+                add(sl, bnd);
+            }
+        }
+    }
+
+    /**
+     * Add an artifact definition. If it already exists, update the version, but
+     * do not change the start level.
+     *
+     * @param newBnd the bundle to add
+     */
+    public void add(Bundle newBnd) {
+       add(null, newBnd);
+    }
+
+    /**
+     * Merge bundle into a start level using the supplied level if present.
+     * @param mergeStartLevel
+     * @param newBnd
+     */
+    private void add(StartLevel mergeStartLevel, Bundle newBnd) {
+        Bundle current = get(newBnd, false);
+        if (current != null) {
+            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) {
+                startLevel = getOrCreateStartLevel(newBnd.getStartLevel());
+            } else {
+                startLevel = getOrCreateStartLevel(mergeStartLevel.getStartLevel());
+            }
+            startLevel.getBundles().add(newBnd);
+        }
+    }
+
+    private StartLevel getOrCreateStartLevel(int startLevel) {
+        for (StartLevel sl : getStartLevels()) {
+            if (sl.getStartLevel() == startLevel) {
+                return sl;
+            }
+        }
+
+        StartLevel sl = new StartLevel();
+        getStartLevels().add(sl);
+        sl.setRawLevel(startLevel);
+        return sl;
+    }
+}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseStartLevel.java b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseStartLevel.java
new file mode 100644
index 0000000..8e541d0
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseStartLevel.java
@@ -0,0 +1,91 @@
+/*
+ * 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.bundlelist;
+
+import java.util.List;
+import java.util.ListIterator;
+
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
+
+public abstract class BaseStartLevel {
+
+    private static final String BOOT_MARKER = "boot";
+
+    public abstract List<Bundle> getBundles();
+
+    private int startLevel;
+
+    public boolean removeBundle(Bundle bundle, boolean compareVersions) {
+        for (ListIterator<Bundle> it = getBundles().listIterator(); it.hasNext();) {
+            if (isSameArtifact(bundle, it.next(), compareVersions)) {
+                it.remove();
+                return true;
+            }
+        }
+        return false;
+    }
+
+    public boolean containsBundle(Bundle bundle, boolean compareVersions) {
+        for (Bundle compare : getBundles()) {
+            return isSameArtifact(bundle, compare, compareVersions);
+        }
+        return false;
+    }
+
+    public Bundle getBundle(Bundle bundle, boolean compareVersions) {
+        for (Bundle compare : getBundles()) {
+            if (isSameArtifact(bundle, compare, compareVersions)) {
+                return compare;
+            }
+        }
+        return null;
+    }
+
+    private boolean isSameArtifact(Bundle bundle1, Bundle bundle2, boolean compareVersions) {
+        boolean result = compareVersions ? bundle1.getVersion().equals(bundle2) : true;
+        return result && bundle1.getArtifactId().equals(bundle2.getArtifactId())
+                && bundle1.getGroupId().equals(bundle2.getGroupId()) && bundle1.getType().equals(bundle2.getType());
+    }
+
+    /**
+     * Set the level field.
+     *
+     * @param level
+     */
+    public void setLevel( final String level ) {
+        if ( BOOT_MARKER.equalsIgnoreCase(level) ) {
+            this.startLevel = -1;
+        } else {
+            this.startLevel = Integer.valueOf(level);
+            if ( this.startLevel < 0 ) {
+                throw new IllegalArgumentException("Start level must either be '" + BOOT_MARKER + "' or non-negative: " + level);
+            }
+        }
+    }
+
+    public void setRawLevel( final int level ) {
+        this.startLevel = level;
+    }
+
+    public String getLevel() {
+        return (this.startLevel == -1 ? BOOT_MARKER : String.valueOf(this.startLevel));
+    }
+
+    public int getStartLevel() {
+        return this.startLevel;
+    }
+}
diff --git a/src/main/mdo/bundle-list.xml b/src/main/mdo/bundle-list.xml
new file mode 100644
index 0000000..0bb9d5c
--- /dev/null
+++ b/src/main/mdo/bundle-list.xml
@@ -0,0 +1,118 @@
+<?xml version="1.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.
+-->
+<model xmlns="http://modello.codehaus.org/MODELLO/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.0.0 http://modello.codehaus.org/xsd/modello-1.0.0.xsd">
+    <id>bundle-list</id>
+    <name>BundleList</name>
+    <description>
+        <![CDATA[Model of a bundle list.]]>
+    </description>
+    <defaults>
+        <default>
+            <key>package</key>
+            <value>org.apache.sling.maven.projectsupport.bundlelist</value>
+        </default>
+    </defaults>
+    <classes>
+        <class rootElement="true" xml.tagName="bundles">
+            <name>BundleList</name>
+            <description>List of bundles.</description>
+            <version>1.0.0</version>
+            <superClass>org.apache.sling.maven.projectsupport.bundlelist.BaseBundleList</superClass>
+            <fields>
+                <field>
+                    <name>startLevels</name>
+                    <version>1.0.0</version>
+                    <association xml.itemsStyle="flat">
+                        <type>StartLevel</type>
+                        <multiplicity>*</multiplicity>
+                    </association>
+                </field>
+            </fields>
+        </class>
+        <class xml.tagName="startLevel">
+        	<name>StartLevel</name>
+            <version>1.0.0</version>
+            <superClass>org.apache.sling.maven.projectsupport.bundlelist.BaseStartLevel</superClass>
+            <fields>
+            	<field xml.attribute="true" java.setter="false" java.getter="false">
+            		<name>level</name>
+            		<version>1.0.0</version>
+            		<type>String</type>
+            	</field>
+                <field>
+                    <name>bundles</name>
+                    <version>1.0.0</version>
+                    <association xml.itemsStyle="flat">
+                        <type>Bundle</type>
+                        <multiplicity>*</multiplicity>
+                    </association>
+                </field>
+            </fields>
+        </class>
+        <class xml.tagName="bundle">
+            <name>Bundle</name>
+            <description>A bundle.</description>
+            <superClass>org.apache.sling.maven.projectsupport.bundlelist.BaseBundle</superClass>
+            <fields>
+                <field>
+                    <name>groupId</name>
+                    <version>1.0.0</version>
+                    <type>String</type>
+                    <required>true</required>
+                </field>
+                <field>
+                    <name>artifactId</name>
+                    <version>1.0.0</version>
+                    <type>String</type>
+                    <required>true</required>
+                </field>
+                <field>
+                    <name>version</name>
+                    <version>1.0.0</version>
+                    <type>String</type>
+                    <required>true</required>
+                </field>
+                <field>
+                    <name>type</name>
+                    <version>1.0.0</version>
+                    <type>String</type>
+                    <defaultValue>jar</defaultValue>
+                </field>
+                <field>
+                    <name>classifier</name>
+                    <version>1.0.0</version>
+                    <type>String</type>
+                </field>
+                <field>
+                    <name>startLevel</name>
+                    <version>1.0.0</version>
+                    <type>int</type>
+                    <required>true</required>
+                </field>
+                <field>
+                    <name>runModes</name>
+                    <version>1.0.0</version>
+                    <type>String</type>
+                </field>
+            </fields>
+        </class>
+    </classes>
+</model>
diff --git a/src/main/resources/META-INF/plexus/components.xml b/src/main/resources/META-INF/plexus/components.xml
new file mode 100644
index 0000000..d6fd19c
--- /dev/null
+++ b/src/main/resources/META-INF/plexus/components.xml
@@ -0,0 +1,53 @@
+<!--
+ 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.
+-->
+<component-set>
+  <components>
+    <component>
+      <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role>
+      <role-hint>partialbundlelist</role-hint>
+      <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation>
+      <configuration>
+        <lifecycles>
+          <lifecycle>
+            <id>default</id>
+            <!-- START SNIPPET: bundle-lifecycle -->
+            <phases>
+              <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>
+            </phases>
+            <!-- END SNIPPET: bundle-lifecycle -->
+          </lifecycle>
+        </lifecycles>
+      </configuration>
+    </component>
+    <component>
+      <role>org.apache.maven.artifact.handler.ArtifactHandler</role>
+      <role-hint>partialbundlelist</role-hint>
+      <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation>
+      <configuration>
+        <type>partialbundlelist</type>
+        <includesDependencies>false</includesDependencies>
+        <language>xml</language>
+        <extension>xml</extension>
+        <addedToClasspath>false</addedToClasspath>
+      </configuration>
+    </component>
+  </components>
+</component-set>
diff --git a/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties b/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties
new file mode 100644
index 0000000..d8102e3
--- /dev/null
+++ b/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties
@@ -0,0 +1,20 @@
+#  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.
+base=org.apache.sling,org.apache.sling.launchpad.base,,jar,,0
+defaultBundles=org.apache.sling,org.apache.sling.launchpad,RELEASE,jar,bundles,0
+defaultBundleList=org.apache.sling,org.apache.sling.launchpad,RELEASE,xml,bundlelist,0
+jarWebSupport=org.apache.felix,org.apache.felix.http.jetty,RELEASE,jar,,-1
diff --git a/src/main/resources/org/apache/sling/maven/projectsupport/drools-globals.drl b/src/main/resources/org/apache/sling/maven/projectsupport/drools-globals.drl
new file mode 100644
index 0000000..58a5d6c
--- /dev/null
+++ b/src/main/resources/org/apache/sling/maven/projectsupport/drools-globals.drl
@@ -0,0 +1,24 @@
+# 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.
+
+# this file ensures that the globals are always defined, even if they're not needed
+
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.MavenProject;
+
+global MavenSession mavenSession
+global MavenProject mavenProject
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java b/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
new file mode 100644
index 0000000..2a2fff3
--- /dev/null
+++ b/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
@@ -0,0 +1,110 @@
+/*
+ * 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.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+
+import org.junit.Test;
+
+/**
+ * Tests of PreparePageMojo
+ */
+public class PreparePackageMojoTest {
+
+	@Test
+	public void testInitArtifactDefinitionsAllDefaults() throws Exception {
+		PreparePackageMojo mojo = new PreparePackageMojo();
+		invokeInitArtifactDefinitions(mojo);
+
+		makeArtifactAssertions(mojo, "base", "org.apache.sling",
+				"org.apache.sling.launchpad.base", null, "jar", null, 0);
+
+		//makeArtifactAssertions(mojo, "defaultBundles", "org.apache.sling",
+		//		"org.apache.sling.launchpad", "RELEASE", "jar", "bundles", 0);
+
+		makeArtifactAssertions(mojo, "defaultBundleList", "org.apache.sling",
+		        "org.apache.sling.launchpad", "RELEASE", "xml", "bundlelist", 0);
+
+		makeArtifactAssertions(mojo, "jarWebSupport", "org.apache.felix",
+				"org.apache.felix.http.jetty", "RELEASE", "jar", null, -1);
+
+	}
+
+	private void makeArtifactAssertions(PreparePackageMojo mojo, String name,
+			String groupId, String artifactId, String version, String type,
+			String classifier, int startLevel) throws Exception {
+		ArtifactDefinition def = getArtifactDefinition(mojo, name);
+
+		assertNotNull(def);
+		assertEquals(groupId, def.getGroupId());
+		assertEquals(artifactId, def.getArtifactId());
+		assertEquals(version, def.getVersion());
+		assertEquals(type, def.getType());
+		assertEquals(classifier, def.getClassifier());
+		assertEquals(startLevel, def.getStartLevel());
+	}
+
+	private void invokeInitArtifactDefinitions(PreparePackageMojo mojo)
+			throws Exception {
+		Method method = findMethod(mojo.getClass(), "initArtifactDefinitions");
+		method.setAccessible(true);
+		method.invoke(mojo);
+		method.setAccessible(false);
+	}
+
+	private Method findMethod(Class<?> clazz, String name, Class<?>... args)
+			throws NoSuchMethodException {
+		while (clazz != Object.class) {
+			try {
+				return clazz.getDeclaredMethod(name, args);
+			} catch (SecurityException e) {
+			} catch (NoSuchMethodException e) {
+			}
+			clazz = clazz.getSuperclass();
+		}
+
+		throw new NoSuchMethodException("Could not find method " + name);
+	}
+
+	private Field findField(Class<?> clazz, String name)
+			throws NoSuchFieldException {
+		while (clazz != Object.class) {
+			try {
+				return clazz.getDeclaredField(name);
+			} catch (SecurityException e) {
+			} catch (NoSuchFieldException e) {
+			}
+			clazz = clazz.getSuperclass();
+		}
+
+		throw new NoSuchFieldException("Could not find field " + name);
+	}
+
+	private ArtifactDefinition getArtifactDefinition(PreparePackageMojo mojo,
+			String name) throws Exception {
+		Field field = findField(mojo.getClass(), name);
+		field.setAccessible(true);
+		ArtifactDefinition def = (ArtifactDefinition) field.get(mojo);
+		field.setAccessible(false);
+		return def;
+	}
+
+}

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

[sling-maven-launchpad-plugin] 36/37: SLING-7167 Adjust READMEs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fd4088adfd9a01ecd1753b38565fb34069b85e56
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Oct 2 16:25:29 2017 +0000

    SLING-7167 Adjust READMEs
    
    switch from plain text to Markdown
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810552 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt => README.md | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/README.txt b/README.md
similarity index 100%
rename from README.txt
rename to README.md

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

[sling-maven-launchpad-plugin] 10/37: SLING-3401 : Support multiple bundles for jarWebSupport Add support for reading multiple bundles when directly reading the maven xml (lifecycle participant) and add support to define several bundles in the dependencies.properties file

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit fbb241f72593a14e9f9291aed367d8d8f024ed9c
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Feb 20 12:58:47 2014 +0000

    SLING-3401 : Support multiple bundles for jarWebSupport
    Add support for reading multiple bundles when directly reading the maven xml (lifecycle participant) and add support to define several bundles in the dependencies.properties file
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1570178 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/projectsupport/ArtifactDefinition.java   | 40 +++++++++++++++-------
 1 file changed, 28 insertions(+), 12 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 10285dc..29930a5 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -67,14 +67,22 @@ public class ArtifactDefinition {
         this.runModes = bundle.getRunModes();
     }
 
-    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);
-        this.runModes = nodeValue(config, "runModes", null);
+    public ArtifactDefinition(final Xpp3Dom config) {
+        if ( config.getChild("bundles") != null ) {
+            final Xpp3Dom[] children = config.getChild("bundles").getChildren("bundle");
+            this.bundles = new ArtifactDefinition[children.length];
+            for(int i=0; i<this.bundles.length; i++) {
+                this.bundles[i] = new ArtifactDefinition(children[i]);
+            }
+        } else {
+            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);
+            this.runModes = nodeValue(config, "runModes", null);
+        }
     }
 
     public String getArtifactId() {
@@ -150,15 +158,23 @@ public class ArtifactDefinition {
      */
     public void initDefaults(String commaDelimitedList) {
         String[] values = commaDelimitedList.split(",");
-        if (values.length != 6) {
+        if (values.length == 0 || values.length % 6 != 0 ) {
             throw new IllegalArgumentException(
                     String
                             .format(
-                                    "The string %s does not have the correct number of items (6).",
+                                    "The string %s does not have the correct number of items (a multiple of 6).",
                                     commaDelimitedList));
         }
-        initDefaults(values[0], values[1], values[2], values[3], values[4],
-                Integer.valueOf(values[5]));
+        if ( values.length == 6 ) {
+            initDefaults(values[0], values[1], values[2], values[3], values[4],
+                    Integer.valueOf(values[5]));
+        }
+        this.bundles = new ArtifactDefinition[values.length / 6];
+        for(int i=0; i<values.length / 6; i++) {
+            this.bundles[i] = new ArtifactDefinition();
+            this.bundles[i].initDefaults(values[i*6 + 0], values[i*6 + 1], values[i*6 + 2], values[i*6 + 3], values[i*6 + 4],
+                    Integer.valueOf(values[i*6 + 5]));
+        }
     }
 
     /**

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

[sling-maven-launchpad-plugin] 19/37: Updated to parent version 20

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e57f56e5e39dea5161956304ac546e77482f1400
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Aug 1 19:16:26 2014 +0000

    Updated to parent version 20
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1615208 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 8159897..666c513 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>19</version>
+        <version>20</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] 32/37: [maven-release-plugin] prepare release maven-launchpad-plugin-2.3.4

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d7a362f13e69fa6b4ae92173aa49c6f0eb410d85
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Oct 21 11:39:42 2015 +0000

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

diff --git a/pom.xml b/pom.xml
index a12e40f..9f96dd9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,11 +18,11 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>25</version>
-        <relativePath/>
+        <relativePath />
     </parent>
 
     <artifactId>maven-launchpad-plugin</artifactId>
-    <version>2.3.3-SNAPSHOT</version>
+    <version>2.3.4</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/tooling/maven/maven-launchpad-plugin</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-launchpad-plugin</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.4</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.4</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.4</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] 26/37: SLING-4698 - Set parent.relativePath to empty for all modules

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 60a63937ec4149a1c6f7464d26133c06262baebd
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu May 7 10:14:40 2015 +0000

    SLING-4698 - Set parent.relativePath to empty for all modules
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1678154 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 4b77d1f..9f407d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
         <version>22</version>
-        <relativePath>../../parent/pom.xml</relativePath>
+        <relativePath/>
     </parent>
 
     <artifactId>maven-launchpad-plugin</artifactId>

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

[sling-maven-launchpad-plugin] 18/37: SLING-3681 - Enable the maven-launchpad-plugin to generate the XSD for bundles list XML document

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e8b4a1065a46336e573fd627fe9e2bfe114455d3
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jul 3 12:22:18 2014 +0000

    SLING-3681 - Enable the maven-launchpad-plugin to generate the XSD for bundles list XML document
    
    Update the target namespace.
    
    Submitted by: Simone Tripodi
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1607605 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/mdo/bundle-list.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/mdo/bundle-list.xml b/src/main/mdo/bundle-list.xml
index c82f9fc..f0f5414 100644
--- a/src/main/mdo/bundle-list.xml
+++ b/src/main/mdo/bundle-list.xml
@@ -19,7 +19,7 @@
 -->
 <model xmlns="http://modello.codehaus.org/MODELLO/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.0.0 http://modello.codehaus.org/xsd/modello-1.0.0.xsd"
- xsd.namespace="http://sling.apache.org/maven/1.0.0">
+ xsd.namespace="http://sling.apache.org/bundles/1.0.0">
     <id>bundle-list</id>
     <name>BundleList</name>
     <description>

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

[sling-maven-launchpad-plugin] 02/37: SLING-3011 - Bind the launchpad:prepare-package goal to the prepare-package lifecycle phase

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 993da3ecfeb95e7a10703e74384b32d8b4d3a331
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Aug 12 11:42:02 2013 +0000

    SLING-3011 - Bind the launchpad:prepare-package goal to the
    prepare-package lifecycle phase
    
    Changed the phase from process-sources to prepare-package.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1513114 13f79535-47bb-0310-9956-ffa450edef68
---
 .../java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 a221434..521472d 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -41,7 +41,7 @@ import org.codehaus.plexus.util.FileUtils;
  *
  * @goal prepare-package
  * @requiresDependencyResolution test
- * @phase process-sources
+ * @phase prepare-package
  * @description initialize a Sling application project
  */
 public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {

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

[sling-maven-launchpad-plugin] 12/37: SLING-3401 : Support multiple bundles for jarWebSupport Fix init method

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 29d76777d902abcd69197893783af0297c194902
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Feb 20 15:42:38 2014 +0000

    SLING-3401 : Support multiple bundles for jarWebSupport
    Fix init method
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1570236 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/maven/projectsupport/ArtifactDefinition.java      | 13 +++++++------
 1 file changed, 7 insertions(+), 6 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 f9f6ab3..d8e38f1 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -190,12 +190,13 @@ public class ArtifactDefinition {
         if ( values.length == 6 ) {
             initDefaults(values[0], values[1], values[2], values[3], values[4],
                     Integer.valueOf(values[5]));
-        }
-        this.bundles = new ArtifactDefinition[values.length / 6];
-        for(int i=0; i<values.length / 6; i++) {
-            this.bundles[i] = new ArtifactDefinition();
-            this.bundles[i].initDefaults(values[i*6 + 0], values[i*6 + 1], values[i*6 + 2], values[i*6 + 3], values[i*6 + 4],
-                    Integer.valueOf(values[i*6 + 5]));
+        } else {
+            this.bundles = new ArtifactDefinition[values.length / 6];
+            for(int i=0; i<values.length / 6; i++) {
+                this.bundles[i] = new ArtifactDefinition();
+                this.bundles[i].initDefaults(values[i*6 + 0], values[i*6 + 1], values[i*6 + 2], values[i*6 + 3], values[i*6 + 4],
+                        Integer.valueOf(values[i*6 + 5]));
+            }
         }
     }
 

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

[sling-maven-launchpad-plugin] 03/37: Update to parent pom 18

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 43d12a10a7b62bd4cfe357478dd5266179f7e61b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 6 12:15:57 2013 +0000

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

diff --git a/pom.xml b/pom.xml
index 3c8a4b6..11ff2af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>17</version>
+        <version>18</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/37: SLING-3205 - factor out BundleListContentProvider to make it easier to test, and add tests. No functional changes so far

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0a673309c82f87de538340ab05d6c54bf81cc7f1
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Oct 24 14:22:15 2013 +0000

    SLING-3205 - factor out BundleListContentProvider to make it easier to test, and add tests. No functional changes so far
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1535390 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            |   6 +
 .../AbstractLaunchpadStartingMojo.java             | 147 ++----------
 .../projectsupport/BundleListContentProvider.java  | 183 ++++++++++++++
 .../BundleListContentProviderTest.java             | 265 +++++++++++++++++++++
 src/test/resources/test-bundle-list.xml            |  76 ++++++
 5 files changed, 547 insertions(+), 130 deletions(-)

diff --git a/pom.xml b/pom.xml
index 11ff2af..90eb8f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -220,5 +220,11 @@
                 </exclusion>
             </exclusions>
         </dependency>
+        <dependency>
+            <groupId>org.mockito</groupId>
+            <artifactId>mockito-core</artifactId>
+            <version>1.9.5</version>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 </project>
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 2b45cc6..3c5e22b 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -19,33 +19,23 @@ package org.apache.sling.maven.projectsupport;
 import static org.apache.felix.framework.util.FelixConstants.LOG_LEVEL_PROP;
 
 import java.io.File;
-import java.io.FileFilter;
 import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
 import java.util.Map;
 import java.util.Properties;
-import java.util.Set;
 
 import org.apache.felix.framework.Logger;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
 import org.apache.maven.shared.filtering.MavenFilteringException;
 import org.apache.maven.shared.filtering.PropertyUtils;
 import org.apache.sling.launchpad.api.LaunchpadContentProvider;
 import org.apache.sling.launchpad.base.impl.Sling;
 import org.apache.sling.launchpad.base.shared.Notifiable;
 import org.apache.sling.launchpad.base.shared.SharedConstants;
-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.BundleException;
 
 public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleListMojo implements Notifiable {
@@ -103,129 +93,26 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
      */
     private File resourceProviderRoot;
 
-    private LaunchpadContentProvider resourceProvider = new LaunchpadContentProvider() {
-
-        public Iterator<String> getChildren(String path) {
-            if (path.equals(BUNDLE_PATH_PREFIX)) {
-                final Set<String> levels = new HashSet<String>();
-                for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
-                    // we treat the boot level as level 1
-                    if ( level.getStartLevel() == -1 ) {
-                        levels.add(BUNDLE_PATH_PREFIX + "/1/");
-                    } else {
-                        levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
-                    }
-                }
-                return levels.iterator();
-            } else if (path.equals("resources/corebundles")) {
-                List<String> empty = Collections.emptyList();
-                return empty.iterator();
-            } else if (path.equals(CONFIG_PATH_PREFIX)) {
-                if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
-                    File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
-
-                        public boolean accept(File file) {
-                            return file.isFile();
-                        }
-                    });
-
-                    List<String> fileNames = new ArrayList<String>();
-                    for (File cfgFile : configFiles) {
-                        if (cfgFile.isFile()) {
-                            fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
-                        }
-                    }
-
-                    return fileNames.iterator();
-
-                } else {
-                    List<String> empty = Collections.emptyList();
-                    return empty.iterator();
-                }
-            } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
-                final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
-                try {
-                    final int startLevel = Integer.parseInt(startLevelInfo);
-
-                    final List<String> bundles = new ArrayList<String>();
-                    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);
-                                try {
-                                    final Artifact artifact = getArtifact(d);
-                                    bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
-                                } catch (Exception e) {
-                                    getLog().error("Unable to resolve artifact ", e);
-                                }
-                            }
-                        }
-                    }
-                    return bundles.iterator();
+    private LaunchpadContentProvider resourceProvider = new BundleListContentProvider(resourceProviderRoot) {
 
-                } catch (NumberFormatException e) {
-                    // we ignore this
-                }
-            } else if (path.equals("resources") ) {
-                final Set<String> subDirs = new HashSet<String>();
-                subDirs.add(BUNDLE_PATH_PREFIX);
-                subDirs.add(CONFIG_PATH_PREFIX);
-                subDirs.add("resources/corebundles");
-                return subDirs.iterator();
-            }
-
-            getLog().warn("un-handlable path " + path);
-            return null;
+        @Override
+        BundleList getInitializedBundleList() {
+            return AbstractLaunchpadStartingMojo.this.getInitializedBundleList();
         }
 
-        public URL getResource(String path) {
-            if (path.startsWith(CONFIG_PATH_PREFIX)) {
-                File configFile = new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
-                if (configFile.exists()) {
-                    try {
-                        return configFile.toURI().toURL();
-                    } catch (MalformedURLException e) {
-                        // ignore this one
-                    }
-                }
-            }
-
-            File resourceFile = new File(resourceProviderRoot, path);
-            if (resourceFile.exists()) {
-                try {
-                    return resourceFile.toURI().toURL();
-                } catch (MalformedURLException e) {
-                    getLog().error("Unable to create URL for file", e);
-                    return null;
-                }
-            } else {
-                URL fromClasspath = getClass().getResource("/" + path);
-                if (fromClasspath != null) {
-                    return fromClasspath;
-                }
-
-                try {
-                    return new URL(path);
-                } catch (MalformedURLException e) {
-                    return null;
-                }
-            }
-
+        @Override
+        File getConfigDirectory() {
+            return AbstractLaunchpadStartingMojo.this.getConfigDirectory();
         }
-
-        public InputStream getResourceAsStream(String path) {
-            URL res = this.getResource(path);
-            if (res != null) {
-                try {
-                    return res.openStream();
-                } catch (IOException ioe) {
-                    // ignore this one
-                }
-            }
-
-            // no resource
-            return null;
-
+        
+        @Override
+        Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException {
+            return AbstractLaunchpadStartingMojo.this.getArtifact(def);
+        }
+        
+        @Override
+        Log getLog() {
+            return AbstractLaunchpadStartingMojo.this.getLog();
         }
     };
 
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
new file mode 100644
index 0000000..cfe1c46
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
@@ -0,0 +1,183 @@
+/*
+ * 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.AbstractUsingBundleListMojo.BUNDLE_PATH_PREFIX;
+import static org.apache.sling.maven.projectsupport.AbstractUsingBundleListMojo.CONFIG_PATH_PREFIX;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.sling.launchpad.api.LaunchpadContentProvider;
+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;
+
+/** LaunchpadContentProvider that provides resources based on a BundleList
+ *  and other resources specific to this module.
+ */
+abstract class BundleListContentProvider implements LaunchpadContentProvider {
+    
+    private final File resourceProviderRoot;
+    
+    BundleListContentProvider(File resourceProviderRoot) {
+        this.resourceProviderRoot = resourceProviderRoot;
+    }
+
+    public Iterator<String> getChildren(String path) {
+        if (path.equals(BUNDLE_PATH_PREFIX)) {
+            final Set<String> levels = new HashSet<String>();
+            for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+                // we treat the boot level as level 1
+                if ( level.getStartLevel() == -1 ) {
+                    levels.add(BUNDLE_PATH_PREFIX + "/1/");
+                } else {
+                    levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
+                }
+            }
+            return levels.iterator();
+        } else if (path.equals("resources/corebundles")) {
+            List<String> empty = Collections.emptyList();
+            return empty.iterator();
+        } else if (path.equals(CONFIG_PATH_PREFIX)) {
+            if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
+                File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
+
+                    public boolean accept(File file) {
+                        return file.isFile();
+                    }
+                });
+
+                List<String> fileNames = new ArrayList<String>();
+                for (File cfgFile : configFiles) {
+                    if (cfgFile.isFile()) {
+                        fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
+                    }
+                }
+
+                return fileNames.iterator();
+
+            } else {
+                List<String> empty = Collections.emptyList();
+                return empty.iterator();
+            }
+        } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
+            final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
+            try {
+                final int startLevel = Integer.parseInt(startLevelInfo);
+
+                final List<String> bundles = new ArrayList<String>();
+                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);
+                            try {
+                                final Artifact artifact = getArtifact(d);
+                                bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
+                            } catch (Exception e) {
+                                getLog().error("Unable to resolve artifact ", e);
+                            }
+                        }
+                    }
+                }
+                return bundles.iterator();
+
+            } catch (NumberFormatException e) {
+                // we ignore this
+            }
+        } else if (path.equals("resources") ) {
+            final Set<String> subDirs = new HashSet<String>();
+            subDirs.add(BUNDLE_PATH_PREFIX);
+            subDirs.add(CONFIG_PATH_PREFIX);
+            subDirs.add("resources/corebundles");
+            return subDirs.iterator();
+        }
+
+        getLog().warn("un-handlable path " + path);
+        return null;
+    }
+
+    public URL getResource(String path) {
+        if (path.startsWith(CONFIG_PATH_PREFIX)) {
+            File configFile = new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
+            if (configFile.exists()) {
+                try {
+                    return configFile.toURI().toURL();
+                } catch (MalformedURLException e) {
+                    // ignore this one
+                }
+            }
+        }
+
+        File resourceFile = new File(resourceProviderRoot, path);
+        if (resourceFile.exists()) {
+            try {
+                return resourceFile.toURI().toURL();
+            } catch (MalformedURLException e) {
+                getLog().error("Unable to create URL for file", e);
+                return null;
+            }
+        } else {
+            URL fromClasspath = getClass().getResource("/" + path);
+            if (fromClasspath != null) {
+                return fromClasspath;
+            }
+
+            try {
+                return new URL(path);
+            } catch (MalformedURLException e) {
+                return null;
+            }
+        }
+
+    }
+
+    public InputStream getResourceAsStream(String path) {
+        URL res = this.getResource(path);
+        if (res != null) {
+            try {
+                return res.openStream();
+            } catch (IOException ioe) {
+                // ignore this one
+            }
+        }
+
+        // no resource
+        return null;
+    }
+    
+    abstract BundleList getInitializedBundleList();
+    
+    abstract File getConfigDirectory();
+    
+    abstract Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException;
+    
+    abstract Log getLog();
+}
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
new file mode 100644
index 0000000..7cd9039
--- /dev/null
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -0,0 +1,265 @@
+/*
+ * 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.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.sling.launchpad.api.LaunchpadContentProvider;
+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.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.mockito.Mockito;
+
+/** Test the BundleListContentProvider */
+public class BundleListContentProviderTest {
+    private static BundleList bundleList;
+    
+    public static final String TEST_BUNDLE_LIST = "test-bundle-list.xml";
+    public static final int BUNDLES_IN_TEST_BUNDLE_LIST = 11;
+    
+    private LaunchpadContentProvider provider;
+    private File resourceProviderRoot;
+    private File resourceProviderFile;
+    
+    @Rule
+    public TemporaryFolder tempFolder = new TemporaryFolder();
+    
+    private static final String [] CONFIG_FILES = {
+        "file1.txt",
+        "file2.cfg",
+        "someFile.properties"
+    };
+    
+    @BeforeClass
+    public static void parseBundleList() throws Exception {
+        final BundleListXpp3Reader reader = new BundleListXpp3Reader();
+        final InputStream is = BundleListContentProviderTest.class.getClassLoader().getResourceAsStream(TEST_BUNDLE_LIST);
+        assertNotNull("Expecting " + TEST_BUNDLE_LIST + " to be found", is);
+        try {
+            bundleList = reader.read(is);
+        } finally {
+            is.close();
+        }
+    }
+    
+    @Before
+    public void setupTemporaryFiles() throws IOException {
+        for(String filename: CONFIG_FILES) {
+            final File f = getConfigFile(filename);
+            f.createNewFile();
+            assertTrue("Expecting temporary config file to have been created: " + f.getAbsolutePath(), f.exists());
+        }
+        
+        resourceProviderRoot = new File(tempFolder.getRoot(), "RESOURCE_PROVIDER_ROOT");
+        resourceProviderRoot.mkdirs();
+        resourceProviderFile = new File(resourceProviderRoot, "RP_FILE_" + System.currentTimeMillis());
+        resourceProviderFile.createNewFile();
+    }
+    
+    private File getConfigFile(String name) {
+        return new File(tempFolder.getRoot(), name);
+    }
+    
+    @Before
+    public void setupProvider() {
+        final Log log = Mockito.mock(Log.class);
+        provider = new BundleListContentProvider(resourceProviderRoot) {
+
+            @Override
+            BundleList getInitializedBundleList() {
+                return bundleList;
+            }
+
+            @Override
+            File getConfigDirectory() {
+                return tempFolder.getRoot();
+            }
+
+            @Override
+            Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException {
+                final Artifact a = Mockito.mock(Artifact.class);
+                final String fakeName = new StringBuilder()
+                .append("/")
+                .append(def.getArtifactId())
+                .append("/")
+                .append(def.getStartLevel())
+                .append("/")
+                .append(def.getRunModes())
+                .toString();
+                Mockito.when(a.getFile()).thenReturn(new File(fakeName));
+                return a;
+            }
+
+            @Override
+            Log getLog() {
+                return log;
+            }
+        };
+    }
+    
+    private void assertChildren(String path, String ...expected) {
+        final List<String> kids = new ArrayList<String>();
+        final Iterator<String> it = provider.getChildren(path);
+        if(expected.length == 0) {
+           assertTrue("Expecting no children for " + path, it == null || !it.hasNext()); 
+        } else {
+            while(it.hasNext()) {
+                kids.add(it.next());
+            }
+            for(String exp : expected) {
+                assertTrue("Expecting " + exp + " in children of " + path + " (result=" + kids + ")", kids.contains(exp));
+            }
+        }
+        assertEquals("Expecting the correct number of children for " + path, expected.length, kids.size());
+    }
+    
+    @Test
+    public void testParsedBundlesCount() {
+        int counter = 0;
+        for(StartLevel level : bundleList.getStartLevels()) {
+            counter += level.getBundles().size();
+        }
+        assertEquals(BUNDLES_IN_TEST_BUNDLE_LIST, counter);
+    }
+    
+    @Test
+    public void testRoot() {
+        assertChildren("resources", 
+                "resources/bundles", 
+                "resources/corebundles", 
+                "resources/config");
+    }
+    
+    @Test
+    public void testBundles() {
+        assertChildren("resources/bundles", 
+                "resources/bundles/0/", 
+                "resources/bundles/1/", 
+                "resources/bundles/5/", 
+                "resources/bundles/15/"); 
+    }
+    
+    @Test
+    public void testCoreBundles() {
+        assertChildren("resources/corebundles"); 
+    }
+    
+    @Test
+    public void testConfig() {
+        assertChildren("resources/config", 
+                "resources/config/file1.txt", 
+                "resources/config/file2.cfg", 
+                "resources/config/someFile.properties"); 
+    }
+    
+    @Test
+    public void testBundles0() {
+        assertChildren("resources/bundles/0", 
+                "file:/commons-io/0/null", 
+                "file:/commons-fileupload/0/null", 
+                "file:/commons-collections/0/null", 
+                "file:/org.apache.sling.installer.provider.jcr/0/test,dev"); 
+    }
+    
+    @Test
+    public void testBundles1() {
+        assertChildren("resources/bundles/1", 
+                "file:/slf4j-api/1/null", 
+                "file:/org.apache.sling.commons.log/1/null"); 
+    }
+    
+    @Test
+    public void testBundles5() {
+        assertChildren("resources/bundles/5", 
+                "file:/org.apache.sling.extensions.webconsolebranding/5/dev", 
+                "file:/org.apache.sling.extensions.webconsolesecurityprovider/5/test"); 
+    }
+    
+    @Test
+    public void testBundles15() {
+        assertChildren("resources/bundles/15", 
+                "file:/org.apache.sling.jcr.oak.server/15/oak", 
+                "file:/guava/15/jackrabbit", 
+                "file:/jsr305/15/oak,jackrabbit"); 
+    }
+    
+    @Test
+    public void testConfigResource() throws Exception {
+        final URL url = provider.getResource("resources/config/file1.txt");
+        assertNotNull("Expecting config resource to be found", url);
+        assertEquals(getConfigFile("file1.txt").toURI().toURL().toExternalForm(), url.toExternalForm());
+    }
+    
+    @Test
+    public void testResourceProviderResource() throws Exception {
+        final URL url = provider.getResource(resourceProviderFile.getName());
+        assertNotNull("Expecting resource provider file to be found", url);
+        assertEquals(resourceProviderFile.toURI().toURL().toExternalForm(), url.toExternalForm());
+    }
+    
+    @Test
+    public void testClasspathResource() throws Exception {
+        final URL url = provider.getResource(TEST_BUNDLE_LIST);
+        assertNotNull("Expecting classpath resource to be found", url);
+        assertTrue(url.toExternalForm().endsWith(TEST_BUNDLE_LIST));
+    }
+    
+    @Test
+    public void testClasspathResourceAsStream() throws Exception {
+        final InputStream is = provider.getResourceAsStream(TEST_BUNDLE_LIST);
+        assertNotNull("Expecting classpath resource stream to be found", is);
+        is.close();
+    }
+    
+    @Test
+    public void testNotFoundStream() throws Exception {
+        final InputStream is = provider.getResourceAsStream("resources/config/NOT_HERE.txt");
+        assertNull("Expecting null stream for non-existent resource", is);
+    }
+    
+    @Test
+    public void testURLResource() throws Exception {
+        final String urlStr = "http://www.perdu.com";
+        final URL url = provider.getResource(urlStr);
+        assertNotNull("Expecting URL resource to be found", url);
+        assertEquals(new URL(urlStr), url);
+    }
+    
+    @Test
+    public void testNullResult() {
+        assertNull(provider.getChildren("/FOO/bar"));
+    }
+}
diff --git a/src/test/resources/test-bundle-list.xml b/src/test/resources/test-bundle-list.xml
new file mode 100644
index 0000000..8c3b87c
--- /dev/null
+++ b/src/test/resources/test-bundle-list.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<bundles>
+    <startLevel level="boot">
+        <!-- bootstrap bundles, must allow the installer core to start -->
+        <bundle>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>1.6.4</version>
+        </bundle>
+        <bundle>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.commons.log</artifactId>
+            <version>3.0.3-SNAPSHOT</version>
+        </bundle>
+    </startLevel>
+    
+    <startLevel level="0">
+        <bundle>
+            <groupId>commons-io</groupId>
+            <artifactId>commons-io</artifactId>
+            <version>1.4</version>
+        </bundle>
+        <bundle>
+            <groupId>commons-fileupload</groupId>
+            <artifactId>commons-fileupload</artifactId>
+            <version>1.2.2</version>
+        </bundle>
+        <bundle>
+            <groupId>commons-collections</groupId>
+            <artifactId>commons-collections</artifactId>
+            <version>3.2.1</version>
+        </bundle>
+        <bundle>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.installer.provider.jcr</artifactId>
+            <version>3.1.6</version>
+            <runModes>test,dev</runModes>
+        </bundle>
+    </startLevel>
+    
+    <startLevel level="5">
+        <bundle>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.extensions.webconsolebranding</artifactId>
+            <version>1.0.0</version>
+            <runModes>dev</runModes>
+        </bundle>
+        <bundle>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.extensions.webconsolesecurityprovider</artifactId>
+            <version>1.0.0</version>
+            <runModes>test</runModes>
+        </bundle>
+    </startLevel>
+   
+    <startLevel level="15">
+        <bundle>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.jcr.oak.server</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+            <runModes>oak</runModes>
+        </bundle>
+        <bundle>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+            <version>14.0.1</version>
+            <runModes>jackrabbit</runModes>
+        </bundle>
+        <bundle>
+            <groupId>com.google.code.findbugs</groupId>
+            <artifactId>jsr305</artifactId>
+            <version>2.0.0</version>
+            <runModes>oak,jackrabbit</runModes>
+        </bundle>
+    </startLevel>
+</bundles>

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

[sling-maven-launchpad-plugin] 14/37: [maven-release-plugin] prepare release maven-launchpad-plugin-2.3.0

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit be66d6e3306eb23f100f236e042babe643858b4e
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 3 07:30:20 2014 +0000

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

diff --git a/pom.xml b/pom.xml
index 90eb8f2..f1bdc66 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     </parent>
 
     <artifactId>maven-launchpad-plugin</artifactId>
-    <version>2.2.1-SNAPSHOT</version>
+    <version>2.3.0</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/tooling/maven/maven-launchpad-plugin</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-launchpad-plugin</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.0</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.0</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.0</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] 35/37: SLING-7167 Adjust READMEs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9239126b4c4bf59c55fb93619b397ee5ebeeb780
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Mon Oct 2 15:05:30 2017 +0000

    SLING-7167 Adjust READMEs
    
    remove outdated information
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810445 13f79535-47bb-0310-9956-ffa450edef68
---
 README.txt | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/README.txt b/README.txt
index 0df89ae..b635658 100644
--- a/README.txt
+++ b/README.txt
@@ -1,27 +1,3 @@
 Apache Sling Maven Plugin
 
 Maven Plugin supporting the Sling Launchpad framework.
-
-Getting Started
-===============
-
-This component uses a Maven 2 (http://maven.apache.org/) build
-environment. It requires a Java 5 JDK (or higher) and Maven (http://maven.apache.org/)
-2.0.7 or later. We recommend to use the latest Maven version.
-
-If you have Maven 2 installed, you can compile and
-package the jar using the following command:
-
-    mvn package
-
-See the Maven 2 documentation for other build features.
-
-The latest source code for this component is available in the
-Subversion (http://subversion.tigris.org/) source repository of
-the Apache Software Foundation. If you have Subversion installed,
-you can checkout the latest source using the following command:
-
-    svn checkout http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin
-
-See the Subversion documentation for other source control features.
-

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

[sling-maven-launchpad-plugin] 16/37: Update to parent pom v19

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4fcf0e7044ec4b4d0901c3886db991310ce520a5
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 31 14:39:20 2014 +0000

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

diff --git a/pom.xml b/pom.xml
index 88d9aad..2444327 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>18</version>
+        <version>19</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] 06/37: SLING-3205 - refactor if statement into more readable methods

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d70e8279cd26efa58df71718a26c393500b2b743
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Oct 24 14:34:35 2013 +0000

    SLING-3205 - refactor if statement into more readable methods
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1535392 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/BundleListContentProvider.java  | 136 ++++++++++++---------
 .../BundleListContentProviderTest.java             |  11 +-
 2 files changed, 87 insertions(+), 60 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
index cfe1c46..472ec6c 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
@@ -46,82 +46,100 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
 abstract class BundleListContentProvider implements LaunchpadContentProvider {
     
     private final File resourceProviderRoot;
+    private final static List<String> EMPTY_STRING_LIST = Collections.emptyList();
     
     BundleListContentProvider(File resourceProviderRoot) {
         this.resourceProviderRoot = resourceProviderRoot;
     }
-
-    public Iterator<String> getChildren(String path) {
-        if (path.equals(BUNDLE_PATH_PREFIX)) {
-            final Set<String> levels = new HashSet<String>();
-            for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
-                // we treat the boot level as level 1
-                if ( level.getStartLevel() == -1 ) {
-                    levels.add(BUNDLE_PATH_PREFIX + "/1/");
-                } else {
-                    levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
-                }
+    
+    private Iterator<String> handleBundlePathRoot(String path) {
+        final Set<String> levels = new HashSet<String>();
+        for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+            // we treat the boot level as level 1
+            if ( level.getStartLevel() == -1 ) {
+                levels.add(BUNDLE_PATH_PREFIX + "/1/");
+            } else {
+                levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
             }
-            return levels.iterator();
-        } else if (path.equals("resources/corebundles")) {
-            List<String> empty = Collections.emptyList();
-            return empty.iterator();
-        } else if (path.equals(CONFIG_PATH_PREFIX)) {
-            if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
-                File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
+        }
+        return levels.iterator();
+    }
+    
+    private Iterator<String> handleConfigPath() {
+        if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
+            File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
 
-                    public boolean accept(File file) {
-                        return file.isFile();
-                    }
-                });
+                public boolean accept(File file) {
+                    return file.isFile();
+                }
+            });
 
-                List<String> fileNames = new ArrayList<String>();
-                for (File cfgFile : configFiles) {
-                    if (cfgFile.isFile()) {
-                        fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
-                    }
+            List<String> fileNames = new ArrayList<String>();
+            for (File cfgFile : configFiles) {
+                if (cfgFile.isFile()) {
+                    fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
                 }
+            }
 
-                return fileNames.iterator();
+            return fileNames.iterator();
 
-            } else {
-                List<String> empty = Collections.emptyList();
-                return empty.iterator();
-            }
-        } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
-            final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
-            try {
-                final int startLevel = Integer.parseInt(startLevelInfo);
-
-                final List<String> bundles = new ArrayList<String>();
-                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);
-                            try {
-                                final Artifact artifact = getArtifact(d);
-                                bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
-                            } catch (Exception e) {
-                                getLog().error("Unable to resolve artifact ", e);
-                            }
+        } else {
+            return EMPTY_STRING_LIST.iterator();
+        }
+    }
+    
+    private Iterator<String> handleBundlePathFolder(String path) {
+        final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
+        try {
+            final int startLevel = Integer.parseInt(startLevelInfo);
+
+            final List<String> bundles = new ArrayList<String>();
+            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);
+                        try {
+                            final Artifact artifact = getArtifact(d);
+                            bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
+                        } catch (Exception e) {
+                            getLog().error("Unable to resolve artifact ", e);
                         }
                     }
                 }
-                return bundles.iterator();
-
-            } catch (NumberFormatException e) {
-                // we ignore this
             }
+            return bundles.iterator();
+
+        } catch (NumberFormatException e) {
+            // we ignore this
+        }
+        return null;
+    }
+    
+    private Iterator<String> handleResourcesRoot() {
+        final Set<String> subDirs = new HashSet<String>();
+        subDirs.add(BUNDLE_PATH_PREFIX);
+        subDirs.add(CONFIG_PATH_PREFIX);
+        subDirs.add("resources/corebundles");
+        return subDirs.iterator();
+    }
+
+    public Iterator<String> getChildren(String path) {
+        Iterator<String> result = null;
+        if (path.equals(BUNDLE_PATH_PREFIX)) {
+            result = handleBundlePathRoot(path);
+        } else if (path.equals("resources/corebundles")) {
+            result = EMPTY_STRING_LIST.iterator();
+        } else if (path.equals(CONFIG_PATH_PREFIX)) {
+            result = handleConfigPath();
+        } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
+            result = handleBundlePathFolder(path);
         } else if (path.equals("resources") ) {
-            final Set<String> subDirs = new HashSet<String>();
-            subDirs.add(BUNDLE_PATH_PREFIX);
-            subDirs.add(CONFIG_PATH_PREFIX);
-            subDirs.add("resources/corebundles");
-            return subDirs.iterator();
+            result = handleResourcesRoot();
+        } else {
+            getLog().warn("un-handlable " + getClass().getSimpleName() + " path: " + path);
         }
 
-        getLog().warn("un-handlable path " + path);
-        return null;
+        return result;
     }
 
     public URL getResource(String path) {
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
index 7cd9039..b4c3905 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -53,6 +53,7 @@ public class BundleListContentProviderTest {
     private LaunchpadContentProvider provider;
     private File resourceProviderRoot;
     private File resourceProviderFile;
+    private File configDirectory;
     
     @Rule
     public TemporaryFolder tempFolder = new TemporaryFolder();
@@ -82,6 +83,7 @@ public class BundleListContentProviderTest {
             f.createNewFile();
             assertTrue("Expecting temporary config file to have been created: " + f.getAbsolutePath(), f.exists());
         }
+        configDirectory = tempFolder.getRoot();
         
         resourceProviderRoot = new File(tempFolder.getRoot(), "RESOURCE_PROVIDER_ROOT");
         resourceProviderRoot.mkdirs();
@@ -105,7 +107,7 @@ public class BundleListContentProviderTest {
 
             @Override
             File getConfigDirectory() {
-                return tempFolder.getRoot();
+                return configDirectory;
             }
 
             @Override
@@ -186,6 +188,12 @@ public class BundleListContentProviderTest {
     }
     
     @Test
+    public void testNonExistentConfigDirectory() {
+        configDirectory = new File("/NON_EXISTENT_" + System.currentTimeMillis());
+        assertChildren("resources/config");
+    }
+
+    @Test
     public void testBundles0() {
         assertChildren("resources/bundles/0", 
                 "file:/commons-io/0/null", 
@@ -262,4 +270,5 @@ public class BundleListContentProviderTest {
     public void testNullResult() {
         assertNull(provider.getChildren("/FOO/bar"));
     }
+    
 }

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

[sling-maven-launchpad-plugin] 22/37: [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 branch master
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git

commit c3794dff8ba7a7884ed979663266eb7d00faf451
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 12 06:15:27 2014 +0000

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

diff --git a/pom.xml b/pom.xml
index eef98d0..193133e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     </parent>
 
     <artifactId>maven-launchpad-plugin</artifactId>
-    <version>2.3.2</version>
+    <version>2.3.3-SNAPSHOT</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/tags/maven-launchpad-plugin-2.3.2</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.2</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.2</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/tooling/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] 28/37: set parent version to 24 and add empty relativePath where missing

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 033e1fcc9a2a3ceb58ce048149ea83f9f333fd11
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jul 7 08:09:17 2015 +0000

    set parent version to 24 and add empty relativePath where missing
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1689593 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 00c0ad8..3dd72a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>23</version>
+        <version>24</version>
         <relativePath/>
     </parent>
 

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

[sling-maven-launchpad-plugin] 15/37: [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 branch master
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git

commit 199ecafc7120bf08e0f8621e88d2b485d3ccc746
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 3 07:30:35 2014 +0000

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

diff --git a/pom.xml b/pom.xml
index f1bdc66..88d9aad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     </parent>
 
     <artifactId>maven-launchpad-plugin</artifactId>
-    <version>2.3.0</version>
+    <version>2.3.1-SNAPSHOT</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/tags/maven-launchpad-plugin-2.3.0</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.0</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.0</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/tooling/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] 29/37: Update the main reactor to parent 25

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 36ea42a0c5ff54a8b052ade3a88dca1c0167f58f
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Oct 5 10:03:45 2015 +0000

    Update the main reactor to parent 25
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1706780 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 3dd72a4..f0eafe7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>24</version>
+        <version>25</version>
         <relativePath/>
     </parent>
 

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

[sling-maven-launchpad-plugin] 24/37: SLING-4284 - Support nested config path in BundleListContentProvider

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit e7bad3a8885aeeeae855d9b221604767550b8268
Author: Chetan Mehrotra <ch...@apache.org>
AuthorDate: Tue Jan 6 10:19:53 2015 +0000

    SLING-4284 - Support nested config path in BundleListContentProvider
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1649770 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/BundleListContentProvider.java  | 29 ++++++------
 .../BundleListContentProviderTest.java             | 52 ++++++++++++++++++----
 2 files changed, 60 insertions(+), 21 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
index 64442fc..e2fdbbe 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
@@ -33,6 +33,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.commons.io.FilenameUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.logging.Log;
@@ -71,18 +72,11 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
     
     private Iterator<String> handleConfigPath() {
         if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
-            File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
-
-                public boolean accept(File file) {
-                    return file.isFile();
-                }
-            });
+            File[] configFiles = getConfigDirectory().listFiles();
 
             List<String> fileNames = new ArrayList<String>();
             for (File cfgFile : configFiles) {
-                if (cfgFile.isFile()) {
                     fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
-                }
             }
 
             return fileNames.iterator();
@@ -223,18 +217,27 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
     }
     
     private Iterator<String> handleConfigSubpath(String path) {
-        // We don't handle config subpaths for now, but do not 
-        // warn if we're asked for the children of a file, just
-        // return empty in that case
         final File f = getConfigFile(path);
         if(!f.exists()) {
             getLog().warn("BundleListContentProvider cannot get children of config path: " + path);
+            return EMPTY_STRING_LIST.iterator();
+        }
+
+        if (f.isFile()){
+            return EMPTY_STRING_LIST.iterator();
         }
-        return EMPTY_STRING_LIST.iterator();
+
+        File[] configFiles = f.listFiles();
+        List<String> fileNames = new ArrayList<String>();
+        for (File cfgFile : configFiles) {
+            fileNames.add(path + "/" + cfgFile.getName());
+        }
+
+        return fileNames.iterator();
     }
     
     private File getConfigFile(String path) {
-        return new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
+        return new File(FilenameUtils.concat(getConfigDirectory().getAbsolutePath(), path.substring(CONFIG_PATH_PREFIX.length() + 1)));
     }
 
     public Iterator<String> getChildren(String path) {
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
index 8041a56..6d5e66f 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -31,6 +31,7 @@ import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.commons.io.FilenameUtils;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.logging.Log;
@@ -68,7 +69,9 @@ public class BundleListContentProviderTest {
     private static final String [] CONFIG_FILES = {
         "file1.txt",
         "file2.cfg",
-        "someFile.properties"
+        "someFile.properties",
+        "dir1/file1.txt",
+        "dir1/dir2/file1.txt",
     };
     
     @BeforeClass
@@ -85,12 +88,14 @@ public class BundleListContentProviderTest {
     
     @Before
     public void setupTemporaryFiles() throws IOException {
+        TemporaryFolder configRoot = new TemporaryFolder(tempFolder.getRoot());
+        configRoot.create();
         for(String filename: CONFIG_FILES) {
-            final File f = getConfigFile(filename);
+            final File f = getConfigFile(configRoot, filename);
             f.createNewFile();
             assertTrue("Expecting temporary config file to have been created: " + f.getAbsolutePath(), f.exists());
         }
-        configDirectory = tempFolder.getRoot();
+        configDirectory = configRoot.getRoot();
 
         resourceProviderRoot = new File(tempFolder.getRoot(), "RESOURCE_PROVIDER_ROOT");
         resourceProviderRoot.mkdirs();
@@ -98,9 +103,19 @@ public class BundleListContentProviderTest {
         resourceProviderFile.createNewFile();
         fakeBundlePath = getFakeBundlePath();
     }
+
+    private File getConfigFile(File configRoot, String name) throws IOException {
+        return new File(FilenameUtils.concat(configRoot.getAbsolutePath(), name));
+    }
     
-    private File getConfigFile(String name) {
-        return new File(tempFolder.getRoot(), name);
+    private File getConfigFile(TemporaryFolder configRoot, String name) throws IOException {
+        File parentFolder = configRoot.getRoot();
+        if (name.contains("/")){
+            String parentPath = name.substring(0, name.lastIndexOf('/'));
+            name = name.substring(name.lastIndexOf('/') + 1);
+            parentFolder = configRoot.newFolder(parentPath.split("/"));
+        }
+        return new File(parentFolder, name);
     }
 
     private String getFakeBundlePath() {
@@ -252,14 +267,28 @@ public class BundleListContentProviderTest {
         assertChildren("resources/config", 
                 "resources/config/file1.txt", 
                 "resources/config/file2.cfg", 
-                "resources/config/someFile.properties"); 
+                "resources/config/someFile.properties",
+                "resources/config/dir1");
     }
-    
+
+    @Test
+    public void testNestedConfig() {
+        assertChildren("resources/config/dir1",
+                "resources/config/dir1/file1.txt",
+                "resources/config/dir1/dir2");
+    }
+
     @Test
     public void testConfigFile() {
         assertChildren("resources/config/file1.txt");
         assertEquals("Expecting no warnings", 0, logWarningsCount);
     }
+
+    @Test
+    public void testNestedConfigFile() {
+        assertChildren("resources/config/dir1/file1.txt");
+        assertEquals("Expecting no warnings", 0, logWarningsCount);
+    }
     
     @Test
     public void testConfigSubpath() {
@@ -342,7 +371,14 @@ public class BundleListContentProviderTest {
     public void testConfigResource() throws Exception {
         final URL url = provider.getResource("resources/config/file1.txt");
         assertNotNull("Expecting config resource to be found", url);
-        assertEquals(getConfigFile("file1.txt").toURI().toURL().toExternalForm(), url.toExternalForm());
+        assertEquals(getConfigFile(configDirectory, "file1.txt").toURI().toURL().toExternalForm(), url.toExternalForm());
+    }
+
+    @Test
+    public void testNestedConfigResource() throws Exception {
+        final URL url = provider.getResource("resources/config/dir1/file1.txt");
+        assertNotNull("Expecting config resource to be found", url);
+        assertEquals(getConfigFile(configDirectory, "dir1/file1.txt").toURI().toURL().toExternalForm(), url.toExternalForm());
     }
     
     @Test

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

[sling-maven-launchpad-plugin] 30/37: SLING-5107 - Switch to Java annotations for Maven plugins

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit dbff9591ade58e05a478aac87db803d9850e9837
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Oct 7 07:58:15 2015 +0000

    SLING-5107 - Switch to Java annotations for Maven plugins
    
    Switch to Java annotations for the maven-launchpad-plugin
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1707200 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 29 ++++++--
 .../projectsupport/AbstractBundleListMojo.java     | 86 +++++-----------------
 .../AbstractLaunchpadFrameworkMojo.java            | 10 +--
 .../AbstractLaunchpadStartingMojo.java             | 18 ++---
 .../AbstractUsingBundleListMojo.java               | 43 ++++-------
 .../maven/projectsupport/AttachBundleListMojo.java | 23 +++---
 .../AttachPartialBundleListMojo.java               | 21 +++---
 .../CheckBundleListForSnapshotsMojo.java           | 11 ++-
 .../maven/projectsupport/CreateBundleJarMojo.java  | 25 +++----
 .../CreateKarafFeatureDescriptorMojo.java          | 28 +++----
 .../CreatePaxRunnerBundleProvisionFileMojo.java    | 13 ++--
 .../projectsupport/DisplayBundleUpdatesMojo.java   | 61 +++++----------
 .../maven/projectsupport/OutputBundleListMojo.java |  7 +-
 .../maven/projectsupport/PreparePackageMojo.java   | 38 ++++------
 .../projectsupport/PrepareTestWebAppMojo.java      | 24 +++---
 .../apache/sling/maven/projectsupport/RunMojo.java |  7 +-
 .../sling/maven/projectsupport/StartMojo.java      | 16 ++--
 .../sling/maven/projectsupport/StatusMojo.java     | 15 ++--
 .../sling/maven/projectsupport/StopMojo.java       | 15 ++--
 19 files changed, 182 insertions(+), 308 deletions(-)

diff --git a/pom.xml b/pom.xml
index f0eafe7..a12e40f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,6 +39,23 @@
     <build>
         <plugins>
             <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-plugin-plugin</artifactId>
+                 <executions>
+                    <execution>
+                        <id>default-descriptor</id>
+                        <phase>process-classes</phase>
+                    </execution>
+                    <execution>
+                        <id>help-goal</id>
+                        <goals>
+                            <goal>helpmojo</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>        
+        
+            <plugin>
                 <groupId>org.codehaus.modello</groupId>
                 <artifactId>modello-maven-plugin</artifactId>
                 <version>1.8.1</version>
@@ -96,11 +113,6 @@
         <plugins>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-plugin-plugin</artifactId>
-                <version>2.5.1</version>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-javadoc-plugin</artifactId>
                 <configuration>
                     <!-- No javadocs -->
@@ -227,5 +239,12 @@
             <version>1.9.5</version>
             <scope>test</scope>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.maven.plugin-tools</groupId>
+            <artifactId>maven-plugin-annotations</artifactId>
+            <version>3.4</version>
+            <scope>provided</scope>
+        </dependency>         
     </dependencies>
 </project>
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 a2f5566..17e548c 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -35,6 +35,8 @@ import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
 import org.codehaus.plexus.util.SelectorUtils;
@@ -47,117 +49,67 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
      */
     protected static final String PARTIAL = "partialbundlelist";
 
-    /**
-     * @parameter default-value="${basedir}/src/main/bundles/list.xml"
-     */
+    @Parameter(defaultValue = "${basedir}/src/main/bundles/list.xml")
     protected File bundleListFile;
 
     /**
      * The Maven project.
-     *
-     * @parameter expression="${project}"
-     * @required
-     * @readonly
      */
+    @Parameter(defaultValue = "${project}", readonly = true)
     protected MavenProject project;
 
-    /**
-     * @component
-     */
+    @Component
     protected MavenProjectHelper projectHelper;
 
-    /**
-     * @parameter expression="${configDirectory}"
-     *            default-value="src/main/config"
-     */
+    @Parameter(property = "configDirectory", defaultValue = "src/main/config")
     private File configDirectory;
 
-    /**
-     * @parameter expression="${commonSlingProps}"
-     *            default-value="src/main/sling/common.properties"
-     */
+    @Parameter(property = "commonSlingProps", defaultValue = "src/main/sling/common.properties")
     protected File commonSlingProps;
 
-    /**
-     * @parameter expression="${commonSlingBootstrap}"
-     *            default-value="src/main/sling/common.bootstrap.txt"
-     */
+    @Parameter(property = "commonSlingBootstrap", defaultValue = "src/main/sling/common.bootstrap.txt")
     protected File commonSlingBootstrap;
 
-    /**
-     * @parameter expression="${webappSlingProps}"
-     *            default-value="src/main/sling/webapp.properties"
-     */
+    @Parameter(property = "webappSlingProps", defaultValue = "src/main/sling/webapp.properties")
     protected File webappSlingProps;
 
-    /**
-     * @parameter expression="${webappSlingBootstrap}"
-     *            default-value="src/main/sling/webapp.bootstrap.txt"
-     */
+    @Parameter(property = "webappSlingBootstrap", defaultValue = "src/main/sling/webapp.bootstrap.txt")
     protected File webappSlingBootstrap;
 
-    /**
-     * @parameter expression="${standaloneSlingProps}"
-     *            default-value="src/main/sling/standalone.properties"
-     */
+    @Parameter(property = "standaloneSlingProps", defaultValue = "src/main/sling/standalone.properties")    
     protected File standaloneSlingProps;
 
-    /**
-     * @parameter expression="${standaloneSlingBootstrap}"
-     *            default-value="src/main/sling/standalone.bootstrap.txt"
-     */
+    @Parameter(property = "standaloneSlingBootstrap", defaultValue = "src/main/sling/standalone.bootstrap.txt")
     protected File standaloneSlingBootstrap;
 
-    /**
-     * @parameter expression="${ignoreBundleListConfig}"
-     *            default-value="false"
-     */
+    @Parameter(property="ignoreBundleListConfig", defaultValue = "false")
     protected boolean ignoreBundleListConfig;
 
-    /**
-     * @parameter expression="${session}
-     * @required
-     * @readonly
-     */
+    @Parameter(defaultValue = "${session}", readonly = true)
     protected MavenSession mavenSession;
 
     /**
      * Used to look up Artifacts in the remote repository.
-     *
-     * @component
      */
+    @Component
     private ArtifactFactory factory;
 
     /**
      * Used to look up Artifacts in the remote repository.
-     *
-     * @component hint="maven"
      */
+    @Component(hint = "maven")
     private ArtifactMetadataSource metadataSource;
 
     /**
      * Location of the local repository.
-     *
-     * @parameter expression="${localRepository}"
-     * @readonly
-     * @required
      */
+    @Parameter( defaultValue = "${localRepository}", readonly = true, required = true)
     private ArtifactRepository local;
 
-    /**
-     * List of Remote Repositories used by the resolver.
-     *
-     * @parameter expression="${project.remoteArtifactRepositories}"
-     * @readonly
-     * @required
-     */
+    @Parameter( defaultValue = "${project.remoteArtifactRepositories}", readonly = true, required = true)
     private List<ArtifactRepository> remoteRepos;
 
-    /**
-     * Used to look up Artifacts in the remote repository.
-     *
-     * @component
-     */
+    @Component
     private ArtifactResolver resolver;
 
     protected File getConfigDirectory() {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
index 23d16d0..551b665 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
@@ -23,6 +23,7 @@ import java.util.TreeSet;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Parameter;
 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;
@@ -37,23 +38,20 @@ public abstract class AbstractLaunchpadFrameworkMojo extends AbstractUsingBundle
     /**
      * The name of the directory within the output directory into which the base
      * JAR should be installed.
-     *
-     * @parameter default-value="resources"
      */
+    @Parameter(defaultValue = "resources")
     protected String baseDestination;
 
     /**
      * The directory which contains the start-level bundle directories.
-     *
-     * @parameter default-value="bundles"
      */
+    @Parameter(defaultValue = "bundles")
     private String bundlesDirectory;
 
     /**
      * The directory which contains the bootstrap bundle directories.
-     *
-     * @parameter
      */
+    @Parameter
     private String bootDirectory;
 
     protected String getPathForArtifact(final int startLevel, final String artifactName, final String runModes) {
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 636a470..9c64df0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -29,6 +29,7 @@ import org.apache.felix.framework.Logger;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.shared.filtering.MavenFilteringException;
 import org.apache.maven.shared.filtering.PropertyUtils;
 import org.apache.sling.launchpad.api.LaunchpadContentProvider;
@@ -71,26 +72,17 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
     /**
      * The definition of the package to be included to provide web support for
      * JAR-packaged projects (i.e. pax-web).
-     *
-     * @parameter
      */
+    @Parameter
     private ArtifactDefinition jarWebSupport;
 
-    /**
-     * @parameter expression="${felix.log.level}"
-     */
+    @Parameter(property = "felix.log.level")
     private String logLevel;
 
-    /**
-     * @parameter expression="${propertiesFile}"
-     *            default-value="src/test/config/sling.properties"
-     */
+    @Parameter(property = "propertiesFile", defaultValue = "src/test/config/sling.properties")
     private File propertiesFile;
 
-    /**
-     * @parameter expression="${resourceProviderRoot}"
-     *            default-value="src/test/resources"
-     */
+    @Parameter(property = "resourceProviderRoot", defaultValue = "src/test/resources")
     private File resourceProviderRoot;
 
     private LaunchpadContentProvider resourceProvider = new BundleListContentProvider(resourceProviderRoot) {
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 4605275..b8ded24 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -31,12 +31,15 @@ import java.util.Set;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
 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.UnArchiver;
 import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -74,73 +77,61 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
 
     /**
      * The definition of the defaultBundleList artifact.
-     *
-     * @parameter
      */
+    @Parameter
     protected ArtifactDefinition defaultBundleList;
 
     /**
      * Any additional bundles to include in the project's bundles directory.
-     *
-     * @parameter
      */
+    @Parameter
     private ArtifactDefinition[] additionalBundles;
 
     private BundleList initializedBundleList;
 
     /**
      * Bundles which should be removed from the project's bundles directory.
-     *
-     * @parameter
      */
+    @Parameter
     private ArtifactDefinition[] bundleExclusions;
 
     /**
      * If true, include the default bundles.
-     *
-     * @parameter expression="${includeDefaultBundles}" default-value="true"
      */
+    @Parameter( property = "includeDefaultBundles", defaultValue = "true")
     private boolean includeDefaultBundles;
 
-    /**
-     * @parameter
-     */
+    @Parameter
     private File[] rewriteRuleFiles;
 
     /**
      * The list of tokens to include when copying configs
      * from partial bundle lists.
-     *
-     * @parameter default-value="**"
      */
+    @Parameter( defaultValue = "**")
     private String[] configIncludes;
 
     /**
      * The list of tokens to exclude when copying the configs
      * from partial bundle lists.
-     *
-     * @parameter
      */
+    @Parameter
     private String[] configExcludes;
 
     /**
      * The list of names to exclude when copying properties
      * from partial bundle lists.
-     *
-     * @parameter
      */
+    @Parameter
     private String[] propertiesExcludes;
 
-    /**
-     * @component
-     */
+    @Component
     protected MavenFileFilter mavenFileFilter;
 
     /**
      * The zip unarchiver.
-     *
-     * @component role="org.codehaus.plexus.archiver.UnArchiver" roleHint="zip"
      */
+    @Component(role = UnArchiver.class, hint = "zip")
     private ZipUnArchiver zipUnarchiver;
 
     private Properties slingProperties;
@@ -155,14 +146,10 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
 
     private String slingStandaloneBootstrapCommand;
 
-    /**
-     * @parameter default-value="${project.build.directory}/tmpBundleListconfig"
-     */
+    @Parameter(defaultValue = "${project.build.directory}/tmpBundleListconfig")
     private File tmpOutputDir;
 
-    /**
-     * @parameter default-value="${project.build.directory}/tmpConfigDir"
-     */
+    @Parameter(defaultValue = "${project.build.directory}/tmpConfigDir")
     private File tempConfigDir;
 
     private File overlayConfigDir;
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 fe9d538..4e1529f 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
@@ -23,36 +23,33 @@ import java.io.IOException;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Writer;
 import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.UnArchiver;
 import org.codehaus.plexus.archiver.zip.ZipArchiver;
 import org.codehaus.plexus.util.FileUtils;
 
 /**
  * Attaches the bundle list as a project artifact.
- *
- * @goal attach-bundle-list
- * @phase package
- * @requiresDependencyResolution test
- * @description attach the bundle list as a project artifact
  */
+@Mojo(name = "attach-bundle-list", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
 public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
 
-    /**
-     * @parameter default-value="${project.build.directory}/bundleList.xml"
-     */
+    @Parameter(defaultValue = "${project.build.directory}/bundleList.xml")
     private File outputFile;
 
-    /**
-     * @parameter default-value="${project.build.directory}/bundleListconfig"
-     */
+    @Parameter(defaultValue = "${project.build.directory}/bundleListconfig")
     private File configOutputDir;
 
     /**
      * The zip archiver.
-     *
-     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="zip"
      */
+    @Component(role = UnArchiver.class, hint = "zip")
     private ZipArchiver zipArchiver;
 
     private final BundleListXpp3Writer writer = new BundleListXpp3Writer();
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 2f4caf5..5719068 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -25,21 +25,23 @@ import java.io.IOException;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 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.UnArchiver;
 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.
- *
- * @goal attach-partial-bundle-list
- * @phase package
- * @requiresDependencyResolution test
- * @description attach the partial bundle list as a project artifact
  */
+@Mojo( name = "attach-partial-bundle-list", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
 public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
 
     public static final String CONFIG_CLASSIFIER = "bundlelistconfig";
@@ -62,14 +64,10 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
 
     public static final String SLING_STANDALONE_BOOTSTRAP = "standalone.bootstrap.txt";
 
-    /**
-     * @parameter default-value="${project.build.directory}/bundleListconfig"
-     */
+    @Parameter( defaultValue = "${project.build.directory}/bundleListconfig")
     private File configOutputDir;
 
-    /**
-     * @parameter default-value="${project.build.directory}/list.xml"
-     */
+    @Parameter( defaultValue = "${project.build.directory}/list.xml")
     private File bundleListOutput;
 
     /**
@@ -77,6 +75,7 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
      *
      * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="zip"
      */
+    @Component(role = UnArchiver.class, hint = "zip")
     private ZipArchiver zipArchiver;
 
     public void execute() throws MojoExecutionException, MojoFailureException {
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 59e92cf..8bd6c17 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
@@ -21,6 +21,9 @@ import java.util.List;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 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;
@@ -28,18 +31,14 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
 /**
  * Validate that the bundle list file (if it exists) does not contain references
  * to SNAPSHOT versions.
- *
- * @goal check-bundle-list-for-snapshots
- * @requiresDependencyResolution test
- *
  */
+@Mojo(name = "check-bundle-list-for-snapshots", requiresDependencyResolution = ResolutionScope.TEST)
 public class CheckBundleListForSnapshotsMojo extends AbstractUsingBundleListMojo {
 
     /**
      * True if the build should be failed if a snapshot is found.
-     *
-     * @parameter default-value="true"
      */
+    @Parameter( defaultValue = "true")
     private boolean failOnSnapshot;
 
     @Override
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 c46da9b..160828f 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
@@ -23,9 +23,15 @@ import org.apache.maven.artifact.Artifact;
 import org.apache.maven.model.Resource;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 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.Archiver;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
 import org.codehaus.plexus.util.DirectoryScanner;
@@ -33,41 +39,32 @@ import org.codehaus.plexus.util.DirectoryScanner;
 /**
  * Create and attach a JAR file containing the resolved artifacts from the
  * bundle list.
- *
- * @goal create-bundle-jar
- * @requiresDependencyResolution test
- * @phase package
- *
  */
+@Mojo( name = "create-bundle-jar", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
 public class CreateBundleJarMojo extends AbstractLaunchpadFrameworkMojo {
 
     /**
      * The list of resources we want to add to the bundle JAR file.
-     *
-     * @parameter
      */
+    @Parameter
     private Resource[] resources;
 
     /**
      * The output directory.
-     *
-     * @parameter default-value="${project.build.directory}"
      */
+    @Parameter( defaultValue = "${project.build.directory}")
     private File outputDirectory;
 
     /**
      * Name of the generated JAR.
-     *
-     * @parameter default-value="${project.artifactId}-${project.version}"
-     * @required
      */
+    @Parameter( defaultValue = "${project.artifactId}-${project.version}", required = true)
     private String jarName;
 
     /**
      * The Jar archiver.
-     *
-     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
      */
+    @Component( role = Archiver.class, hint = "jar")
     private JarArchiver jarArchiver;
 
     private static final String CLASSIFIER = "bundles";
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 504d9cd..1e4aca0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
@@ -22,6 +22,10 @@ import java.io.IOException;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 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;
@@ -32,38 +36,24 @@ import org.jdom.output.XMLOutputter;
 
 /**
  * Create and attach a karaf feature descriptor XML file.
- *
- * @goal create-karaf-descriptor
- * @phase package
- * @description create a karaf feature descriptor
- * @requiresDependencyResolution test
  */
+@Mojo(name = "create-karaf-descriptor", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
 public class CreateKarafFeatureDescriptorMojo extends AbstractUsingBundleListMojo {
 
     private static final String CLASSIFIER = "features";
 
     private static final String TYPE = "xml";
 
-    /**
-     * @parameter default-value="sling"
-     */
+    @Parameter(defaultValue = "sling")
     private String featureName;
 
-    /**
-     * @parameter default-value="sling-2.0"
-     */
+    @Parameter(defaultValue = "sling-2.0")
     private String featuresName;
 
-    /**
-     * @parameter default-value="${project.version}"
-     */
+    @Parameter(defaultValue = "${project.version}")
     private String featureVersion;
 
-    /**
-     * The output directory.
-     *
-     * @parameter default-value="${project.build.directory}/features.xml"
-     */
+    @Parameter(defaultValue = "{project.build.directory}/features.xml")
     private File outputFile;
 
     @Override
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java
index 9e98997..716f8d6 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java
@@ -22,18 +22,18 @@ import java.io.IOException;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 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;
 
 /**
  * Create and attach a Pax Runner bundle provision file.
- * 
- * @goal create-paxrunner-provision-file
- * @phase package
- * @description create a Pax Runner bundle provision file
- * @requiresDependencyResolution test
  */
+@Mojo(name = "create-paxrunner-provision-file", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
 public class CreatePaxRunnerBundleProvisionFileMojo extends AbstractUsingBundleListMojo {
 
     private static final String CLASSIFIER = "bundles";
@@ -42,9 +42,8 @@ public class CreatePaxRunnerBundleProvisionFileMojo extends AbstractUsingBundleL
 
     /**
      * The output directory.
-     * 
-     * @parameter default-value="${project.build.directory}/bundles-pax"
      */
+    @Parameter(defaultValue = "${project.build.directory}/bundles-pax")
     private File outputFile;
 
     @Override
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 7f11573..5aeb3af 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
@@ -35,6 +35,9 @@ import org.apache.maven.model.Dependency;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 import org.apache.maven.project.path.PathTranslator;
 import org.apache.maven.settings.Settings;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
@@ -53,9 +56,9 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
  * display-dependency-updates goal from the Versions plugin.
  *
  * @since 2.0.8
- * @goal display-bundle-updates
  *
  */
+@Mojo(name = "display-bundle-updates")
 public class DisplayBundleUpdatesMojo extends AbstractMojo {
 
     /**
@@ -63,91 +66,61 @@ public class DisplayBundleUpdatesMojo extends AbstractMojo {
      */
     private static final int INFO_PAD_SIZE = 72;
 
-    /**
-     * @component
-     */
+    @Component
     private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory;
 
     /**
      * The artifact metadata source to use.
-     *
-     * @component
-     * @required
-     * @readonly
      */
+    @Component
     private ArtifactMetadataSource artifactMetadataSource;
 
-    /**
-     * @parameter expression="${project.remoteArtifactRepositories}"
-     * @readonly
-     */
+    @Parameter( defaultValue = "${project.remoteArtifactRepositories}", readonly = true)
     private List<ArtifactRepository> remoteArtifactRepositories;
 
-    /**
-     * @parameter expression="${project.pluginArtifactRepositories}"
-     * @readonly
-     */
+    @Parameter( defaultValue = "${project.pluginArtifactRepositories}", readonly = true)
     private List<ArtifactRepository> remotePluginRepositories;
 
-    /**
-     * @parameter expression="${localRepository}"
-     * @readonly
-     */
+    @Parameter( defaultValue = "${localRepository}", readonly = true)
     private ArtifactRepository localRepository;
 
-    /**
-     * @component
-     */
+    @Component
     private WagonManager wagonManager;
 
-    /**
-     * @parameter expression="${settings}"
-     * @readonly
-     */
+    @Parameter(defaultValue = "${settings}", readonly = true)
     private Settings settings;
 
     /**
      * settings.xml's server id for the URL. This is used when wagon needs extra
      * authentication information.
-     *
-     * @parameter expression="${maven.version.rules.serverId}"
-     *            default-value="serverId";
      */
+    @Parameter(property = "maven.version.rules.serverId", defaultValue = "serverId")
     private String serverId;
 
     /**
      * The Wagon URI of a ruleSet file containing the rules that control how to
      * compare version numbers.
-     *
-     * @parameter expression="${maven.version.rules}"
      */
+    @Parameter(defaultValue = "maven.version.rules")
     private String rulesUri;
 
     /**
      * The Maven Session.
-     *
-     * @parameter expression="${session}"
-     * @required
-     * @readonly
      */
+    @Parameter(defaultValue = "${session}", required = true)
     private MavenSession session;
 
-    /**
-     * @component
-     */
+    @Component
     private PathTranslator pathTranslator;
 
-    /**
-     * @parameter default-value="${basedir}/src/main/bundles/list.xml"
-     */
+    @Parameter(defaultValue = "${basedir}/src/main/bundles/list.xml")
     private File bundleListFile;
 
     /**
      * Whether to allow snapshots when searching for the latest version of an
      * artifact.
-     *
-     * @parameter expression="${allowSnapshots}" default-value="false"
      */
+    @Parameter(property = "allowSnapshots", defaultValue = "false")
     private boolean allowSnapshots;
 
     /**
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 31d0523..354a67a 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
@@ -21,15 +21,14 @@ import java.io.OutputStreamWriter;
 
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Writer;
 
 /**
  * Output the bundle list back to the console.
- * 
- * @goal output-bundle-list
- * @requiresDependencyResolution test
- * 
  */
+@Mojo( name = "output-bundle-list", requiresDependencyResolution = ResolutionScope.TEST)
 public class OutputBundleListMojo extends AbstractUsingBundleListMojo {
 
     @Override
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 e5c3612..f416c28 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -27,7 +27,13 @@ import java.util.Properties;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.codehaus.plexus.archiver.Archiver;
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.UnArchiver;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
@@ -38,73 +44,59 @@ import org.codehaus.plexus.util.FileUtils;
 /**
  * Initialize a Sling application project by extracting bundles into the correct
  * locations.
- *
- * @goal prepare-package
- * @requiresDependencyResolution test
- * @phase prepare-package
- * @description initialize a Sling application project
  */
+@Mojo(name = "prepare-package", defaultPhase = LifecyclePhase.PREPARE_PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
 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"
      */
+    @Parameter(defaultValue = "${project.build.directory}/launchpad-bundles")
     private File warOutputDirectory;
 
     /**
      * The project's packaging type.
-     *
-     * @parameter expression="${project.packaging}"
      */
+    @Parameter(property = "project.packaging")
     private String packaging;
 
     /**
      * The definition of the base JAR.
-     *
-     * @parameter
      */
+    @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
      */
+    @Parameter
     private ArtifactDefinition jarWebSupport;
 
     /**
      * The project's build output directory (i.e. target/classes).
-     *
-     * @parameter expression="${project.build.outputDirectory}"
-     * @readonly
      */
+    @Parameter(property = "project.build.outputDirectory", readonly = true)
     private File buildOutputDirectory;
 
     /**
      * The temp directory (i.e. target/maven-launchpad-plugintmp).
-     *
-     * @parameter expression="${project.build.directory}/maven-launchpad-plugintmp"
-     * @readonly
      */
+    @Parameter(defaultValue = "${project.build.outputDirectory}/maven-launchpad-plugintmp", readonly = true)
     private File tempDirectory;
 
     /**
      * To look up Archiver/UnArchiver implementations
-     *
-     * @component
      */
+    @Component
     private ArchiverManager archiverManager;
 
     /**
      * The Jar archiver.
-     *
-     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
      */
+    @Component(role = Archiver.class, hint = "jar")
     private JarArchiver jarArchiver;
 
     @Override
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
index d38d1cf..97a31de 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
@@ -22,42 +22,38 @@ import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 
 /**
  * Initialize a Sling integration test webapp by extracting bundles into the
  * correct locations, including the current artifact.
- *
- * @goal prepare-test-webapp
- * @requiresDependencyResolution test
- * @phase package
  */
+@Mojo( name = "prepare-test-webapp", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.PACKAGE)
 public class PrepareTestWebAppMojo extends PreparePackageMojo {
 
     /**
      * The project's build directory (i.e. target).
-     *
-     * @parameter expression="${project.build.directory}"
-     * @readonly
      */
+    @Parameter( property = "project.build.directory", readonly = true)
     private File buildDirectory;
 
     /**
      * The start level for the current artifact.
-     *
-     * @parameter default-value="16"
      */
+    @Parameter( defaultValue = "16")
     private int startLevel;
 
     /**
      * The output directory for bundles.
-     *
-     * @parameter default-value="${project.build.directory}/launchpad-bundles"
      */
+    @Parameter( defaultValue = "${project.build.directory}/launchpad-bundles")
     private File outputDirectory;
 
-    /**
-     * @component
-     */
+    @Component
     private ArtifactHandlerManager artifactHandlerManager;
 
     @Override
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java
index feaecd5..f34f321 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java
@@ -19,17 +19,16 @@ package org.apache.sling.maven.projectsupport;
 import java.util.Map;
 
 import org.apache.felix.framework.Logger;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.sling.launchpad.api.LaunchpadContentProvider;
 import org.apache.sling.launchpad.base.impl.Sling;
 import org.osgi.framework.BundleException;
 
 /**
  * Run a Launchpad application.
- *
- * @goal run
- * @requiresDependencyResolution test
- *
  */
+@Mojo( name = "run", requiresDependencyResolution = ResolutionScope.TEST)
 public class RunMojo extends AbstractLaunchpadStartingMojo {
 
 
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java
index 4a48571..75dfc17 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java
@@ -19,27 +19,23 @@ package org.apache.sling.maven.projectsupport;
 import java.util.Map;
 
 import org.apache.felix.framework.Logger;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
 import org.apache.sling.launchpad.api.LaunchpadContentProvider;
 import org.apache.sling.launchpad.base.impl.Sling;
 import org.osgi.framework.BundleException;
 
 /**
  * Start a Launchpad application.
- *
- * @goal start
- * @requiresDependencyResolution test
- *
  */
+@Mojo( name = "start", requiresDependencyResolution = ResolutionScope.TEST)
 public class StartMojo extends AbstractLaunchpadStartingMojo {
 
-    /**
-     * @parameter expression="${sling.control.port}" default-value="63000"
-     */
+    @Parameter( property = "sling.control.port", defaultValue = "63000")
     private int controlPort;
 
-    /**
-     * @parameter expression="${sling.control.host}"
-     */
+    @Parameter(property = "sling.control.host")
     private String controlHost;
 
     /**
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java
index 95388e5..990dd97 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java
@@ -19,24 +19,19 @@ package org.apache.sling.maven.projectsupport;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 
 /**
  * Gets the status a running Launchpad standalone application.
- *
- * @goal status
- * @requiresProject false
- *
  */
+@Mojo( name = "status", requiresProject = false)
 public class StatusMojo extends AbstractMojo {
 
-    /**
-     * @parameter expression="${sling.control.port}" default-value="63000"
-     */
+    @Parameter( property = "sling.control.port", defaultValue = "63000")
     private int controlPort;
 
-    /**
-     * @parameter expression="${sling.control.host}" default-value="localhost"
-     */
+    @Parameter( property = "sling.control.host")
     private String controlHost;
 
     /**
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java
index 8fe3a8f..5d2def9 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java
@@ -19,24 +19,19 @@ package org.apache.sling.maven.projectsupport;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
 
 /**
  * Stop a running Launchpad standalone application.
- *
- * @goal stop
- * @requiresProject false
- *
  */
+@Mojo( name = "stop", requiresProject = false)
 public class StopMojo extends AbstractMojo {
 
-    /**
-     * @parameter expression="${sling.control.port}" default-value="63000"
-     */
+    @Parameter( property = "sling.control.port", defaultValue = "63000")
     private int controlPort;
 
-    /**
-     * @parameter expression="${sling.control.host}" default-value="localhost"
-     */
+    @Parameter( property = "sling.control.host")
     private String controlHost;
 
     /**

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

[sling-maven-launchpad-plugin] 21/37: [maven-release-plugin] prepare release maven-launchpad-plugin-2.3.2

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 83cee9abb362dab2fc860f075326410e8137cd7b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 12 06:15:13 2014 +0000

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

diff --git a/pom.xml b/pom.xml
index 666c513..eef98d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     </parent>
 
     <artifactId>maven-launchpad-plugin</artifactId>
-    <version>2.3.1-SNAPSHOT</version>
+    <version>2.3.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/tooling/maven/maven-launchpad-plugin</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-launchpad-plugin</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.2</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.2</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.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] 37/37: SLING-7167 Adjust READMEs

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 41628b64c1f4d49bcdd5a46b96bcc6d7b4b9c1c3
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Oct 3 10:14:07 2017 +0000

    SLING-7167 Adjust READMEs
    
    add uniform header linking to Sling project
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1810971 13f79535-47bb-0310-9956-ffa450edef68
---
 README.md | 4 +++-
 pom.xml   | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index b635658..47efb7e 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
-Apache Sling Maven Plugin
+# Apache Sling Maven Launchpad Plugin
+
+This module is part of the [Apache Sling](https://sling.apache.org) project.
 
 Maven Plugin supporting the Sling Launchpad framework.
diff --git a/pom.xml b/pom.xml
index b874d1c..c0a71bd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
     <version>2.3.5-SNAPSHOT</version>
     <packaging>maven-plugin</packaging>
 
-    <name>Apache Sling Launchpad Maven Plugin</name>
+    <name>Apache Sling Maven Launchpad Plugin</name>
     <description>
         Maven Plugin supporting Sling Launchpad
     </description>

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

[sling-maven-launchpad-plugin] 07/37: SLING-3205 - provide bundle resources under resources/install to support run modes

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c816f452dd2ac4560a1b09307c362e7f14744074
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Oct 25 12:21:41 2013 +0000

    SLING-3205 - provide bundle resources under resources/install to support run modes
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1535709 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/BundleListContentProvider.java  | 153 ++++++++++++++++---
 .../BundleListContentProviderTest.java             | 164 +++++++++++++++++----
 src/test/resources/test-bundle-list.xml            |  10 ++
 3 files changed, 276 insertions(+), 51 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
index 472ec6c..eb34f54 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
@@ -26,6 +26,7 @@ import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -45,6 +46,10 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
  */
 abstract class BundleListContentProvider implements LaunchpadContentProvider {
     
+    public static final String INSTALL_PATH_PREFIX = "resources/install";
+    public static final int BOOTSTRAP_DEF_START_LEVEL = -1;
+    public static final int ACTUAL_BOOTSTRAP_START_LEVEL = 1;
+
     private final File resourceProviderRoot;
     private final static List<String> EMPTY_STRING_LIST = Collections.emptyList();
     
@@ -55,11 +60,10 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
     private Iterator<String> handleBundlePathRoot(String path) {
         final Set<String> levels = new HashSet<String>();
         for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
-            // we treat the boot level as level 1
-            if ( level.getStartLevel() == -1 ) {
-                levels.add(BUNDLE_PATH_PREFIX + "/1/");
-            } else {
-                levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
+            // Include only bootstrap bundles here, with start level 1.
+            // Other bundles go under the install folder, to support run modes
+            if( level.getStartLevel() == BOOTSTRAP_DEF_START_LEVEL) {
+                levels.add(BUNDLE_PATH_PREFIX + "/" + ACTUAL_BOOTSTRAP_START_LEVEL + "/");
             }
         }
         return levels.iterator();
@@ -88,31 +92,53 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
         }
     }
     
-    private Iterator<String> handleBundlePathFolder(String path) {
+    private Iterator<String> handleBundlesSubfolder(String path) {
+        Iterator<String> result = null;
         final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
         try {
             final int startLevel = Integer.parseInt(startLevelInfo);
+            
+            // To be consistent with handleBundlePathRoot, consider only level 1 which
+            // is assigned to bootstrap bundles
+            if(startLevel == ACTUAL_BOOTSTRAP_START_LEVEL) {
+                final List<String> bundles = new ArrayList<String>();
+                addBundles(bundles, ACTUAL_BOOTSTRAP_START_LEVEL, null);
+                addBundles(bundles, BOOTSTRAP_DEF_START_LEVEL, null);
+                result = bundles.iterator();
+            }
 
-            final List<String> bundles = new ArrayList<String>();
-            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);
-                        try {
-                            final Artifact artifact = getArtifact(d);
-                            bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
-                        } catch (Exception e) {
-                            getLog().error("Unable to resolve artifact ", e);
-                        }
+        } catch (NumberFormatException e) {
+            getLog().warn("Invalid start level " + startLevelInfo + " in path " + path);
+        }
+        
+        return result;
+    }
+    
+    private void addBundles(Collection<String> bundles, int startLevel, String runMode) {
+        for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+            if(level.getStartLevel() == startLevel) {
+                for (final Bundle bundle : level.getBundles()) {
+                    if(!runModeMatches(bundle, runMode)) {
+                        continue;
+                    }
+                    final ArtifactDefinition d = new ArtifactDefinition(bundle, startLevel);
+                    try {
+                        final Artifact artifact = getArtifact(d);
+                        bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
+                    } catch (Exception e) {
+                        getLog().error("Unable to resolve artifact ", e);
                     }
                 }
             }
-            return bundles.iterator();
-
-        } catch (NumberFormatException e) {
-            // we ignore this
         }
-        return null;
+    }
+    
+    private boolean runModeMatches(Bundle b, String runMode) {
+        if(runMode == null || runMode.length() == 0) {
+            return b.getRunModes() == null || b.getRunModes().length() == 0;
+        } else {
+            return b.getRunModes() != null && b.getRunModes().contains(runMode);
+        }
     }
     
     private Iterator<String> handleResourcesRoot() {
@@ -120,8 +146,81 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
         subDirs.add(BUNDLE_PATH_PREFIX);
         subDirs.add(CONFIG_PATH_PREFIX);
         subDirs.add("resources/corebundles");
+        subDirs.add(INSTALL_PATH_PREFIX);
+        
+        // Compute the set of run modes in our bundles
+        final Set<String> runModes = new HashSet<String>();
+        for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+            for(Bundle bundle : level.getBundles()) {
+                final String modes = bundle.getRunModes();
+                if(modes != null && modes.length() > 0) {
+                    for(String m : modes.split(",")) {
+                        runModes.add("." + m);
+                    }
+                }
+            }
+        }
+        
+        // Add one install subdir per run mode
+        for(String m : runModes) {
+            subDirs.add(INSTALL_PATH_PREFIX + m);
+        }
         return subDirs.iterator();
     }
+    
+    /** Add one folder per child, using given path as prefix, for start
+     *  levels which actually provide bundles for the given run mode.
+     */
+    private void addStartLevelSubdirs(Collection<String> children, String path, String runMode) {
+        for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+            final List<String> bundles = new ArrayList<String>();
+            addBundles(bundles, level.getStartLevel(), runMode);
+            if(!bundles.isEmpty()) {
+                int folderLevel = level.getStartLevel();
+                if(folderLevel== BOOTSTRAP_DEF_START_LEVEL) {
+                    folderLevel = ACTUAL_BOOTSTRAP_START_LEVEL;
+                }
+                children.add(path + "/" + folderLevel);
+            }
+        }
+    }
+
+    private Iterator<String> handleInstallPath(String path) {
+        // Path is like
+        // bundles/install.runMode/12
+        // or a subset of that.
+        // Extract optional run mode and start level from that
+        if(path.endsWith("/")) {
+            path = path.substring(0, path.length() - 1);
+        }
+        final String [] parts = path.substring(INSTALL_PATH_PREFIX.length()).split("/");
+        if (parts.length > 2){
+            throw new IllegalStateException("Cannot parse path " + path);
+        }
+        final String runMode = parts[0].length() == 0 ? null : parts[0].substring(1);
+        final String startLevelInfo = parts.length > 1 ? parts[1] : null; 
+        Set<String> result = new HashSet<String>();
+        
+        if(runMode == null && startLevelInfo == null) {
+            // Root folder: add one subdir per start level that provides bundles
+            addStartLevelSubdirs(result, INSTALL_PATH_PREFIX, null);
+            
+        } else if(startLevelInfo == null) {
+            // The root of a run mode folder - one subdir per start
+            // level which actually provides bundles
+            addStartLevelSubdirs(result, path, runMode);
+            
+        } else {
+            // A folder that contains bundles
+            try {
+                addBundles(result, Integer.parseInt(startLevelInfo), runMode);
+            } catch (NumberFormatException e) {
+                getLog().warn("Invalid start level info " + startLevelInfo + " in path " + path);
+            }
+        }
+        
+        return result.iterator();
+    }
 
     public Iterator<String> getChildren(String path) {
         Iterator<String> result = null;
@@ -132,11 +231,17 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
         } else if (path.equals(CONFIG_PATH_PREFIX)) {
             result = handleConfigPath();
         } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
-            result = handleBundlePathFolder(path);
+            result = handleBundlesSubfolder(path);
+        } else if (path.startsWith(INSTALL_PATH_PREFIX)) {
+            result = handleInstallPath(path);
         } else if (path.equals("resources") ) {
             result = handleResourcesRoot();
+        } else if (path.startsWith("file:") ) {
+            // Client looks for files under a file - we have none,
+            // as our file URLs point to Maven artifacts
+            result = EMPTY_STRING_LIST.iterator();
         } else {
-            getLog().warn("un-handlable " + getClass().getSimpleName() + " path: " + path);
+            getLog().warn("BundleListContentProvider cannot handle path: " + path);
         }
 
         return result;
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
index b4c3905..21cbe53 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -27,6 +27,7 @@ import java.io.InputStream;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 
 import org.apache.maven.artifact.Artifact;
@@ -48,7 +49,7 @@ public class BundleListContentProviderTest {
     private static BundleList bundleList;
     
     public static final String TEST_BUNDLE_LIST = "test-bundle-list.xml";
-    public static final int BUNDLES_IN_TEST_BUNDLE_LIST = 11;
+    public static final int BUNDLES_IN_TEST_BUNDLE_LIST = 13;
     
     private LaunchpadContentProvider provider;
     private File resourceProviderRoot;
@@ -114,7 +115,7 @@ public class BundleListContentProviderTest {
             Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException {
                 final Artifact a = Mockito.mock(Artifact.class);
                 final String fakeName = new StringBuilder()
-                .append("/")
+                .append("/FAKE_BUNDLE/")
                 .append(def.getArtifactId())
                 .append("/")
                 .append(def.getStartLevel())
@@ -138,14 +139,17 @@ public class BundleListContentProviderTest {
         if(expected.length == 0) {
            assertTrue("Expecting no children for " + path, it == null || !it.hasNext()); 
         } else {
+            assertNotNull("Expecting non-null iterator for " + path, it);
             while(it.hasNext()) {
                 kids.add(it.next());
             }
             for(String exp : expected) {
-                assertTrue("Expecting " + exp + " in children of " + path + " (result=" + kids + ")", kids.contains(exp));
+                assertTrue("Expecting " + exp + " in children of " + path + " (result=" + kids + ")", 
+                        kids.contains(exp));
             }
         }
-        assertEquals("Expecting the correct number of children for " + path, expected.length, kids.size());
+        assertEquals("Expecting the correct number of children for " + path + " (result=" + kids + ")", 
+                expected.length, kids.size());
     }
     
     @Test
@@ -162,16 +166,53 @@ public class BundleListContentProviderTest {
         assertChildren("resources", 
                 "resources/bundles", 
                 "resources/corebundles", 
-                "resources/config");
+                "resources/config",
+                "resources/install",
+                "resources/install.dev", 
+                "resources/install.test", 
+                "resources/install.oak", 
+                "resources/install.jackrabbit");
     }
     
     @Test
     public void testBundles() {
         assertChildren("resources/bundles", 
-                "resources/bundles/0/", 
-                "resources/bundles/1/", 
-                "resources/bundles/5/", 
-                "resources/bundles/15/"); 
+                "resources/bundles/1/"); 
+    }
+    
+    @Test
+    public void testInstall() {
+        assertChildren("resources/install",
+                "resources/install/0", 
+                "resources/install/1", 
+                "resources/install/5", 
+                "resources/install/15"); 
+    }
+    
+    @Test
+    public void testInstallDev() {
+        assertChildren("resources/install.dev",
+                "resources/install.dev/0", 
+                "resources/install.dev/5");
+    }
+    
+    @Test
+    public void testInstallTest() {
+        assertChildren("resources/install.test",
+                "resources/install.test/0", 
+                "resources/install.test/5");
+    }
+    
+    @Test
+    public void testInstallOak() {
+        assertChildren("resources/install.oak",
+                "resources/install.oak/15");
+    }
+    
+    @Test
+    public void testInstallJackrabbit() {
+        assertChildren("resources/install.jackrabbit",
+                "resources/install.jackrabbit/15");
     }
     
     @Test
@@ -194,34 +235,68 @@ public class BundleListContentProviderTest {
     }
 
     @Test
-    public void testBundles0() {
-        assertChildren("resources/bundles/0", 
-                "file:/commons-io/0/null", 
-                "file:/commons-fileupload/0/null", 
-                "file:/commons-collections/0/null", 
-                "file:/org.apache.sling.installer.provider.jcr/0/test,dev"); 
+    public void testIgnoredNonBootstrapBundles() {
+        // All these start levels do not provide resources/bundles anymore - moved to resources/install
+        for(int i=0; i <= 30; i++) {
+            if(i == 1) {
+                continue;
+            }
+            final String path ="resources/bundles/" + i;
+            assertNull("Expecting no resources under " + path, provider.getChildren(path));
+        }
+    }
+    
+    @Test
+    public void testInstall0() {
+        assertChildren("resources/install/0", 
+                "file:/FAKE_BUNDLE/commons-io/0/null", 
+                "file:/FAKE_BUNDLE/commons-fileupload/0/null", 
+                "file:/FAKE_BUNDLE/commons-collections/0/null"); 
     }
     
     @Test
-    public void testBundles1() {
+    public void testBootstrapBundles() {
         assertChildren("resources/bundles/1", 
-                "file:/slf4j-api/1/null", 
-                "file:/org.apache.sling.commons.log/1/null"); 
+                "file:/FAKE_BUNDLE/slf4j-api/-1/null", 
+                "file:/FAKE_BUNDLE/org.apache.sling.commons.log/-1/null"); 
+    }
+    
+    @Test
+    public void testInstall5() {
+        assertChildren("resources/install/5", 
+                "file:/FAKE_BUNDLE/five.norunmode/5/null"); 
     }
     
     @Test
-    public void testBundles5() {
-        assertChildren("resources/bundles/5", 
-                "file:/org.apache.sling.extensions.webconsolebranding/5/dev", 
-                "file:/org.apache.sling.extensions.webconsolesecurityprovider/5/test"); 
+    public void testInstall5Dev() {
+        assertChildren("resources/install.dev/5", 
+                "file:/FAKE_BUNDLE/org.apache.sling.extensions.webconsolebranding/5/dev"); 
     }
     
     @Test
-    public void testBundles15() {
-        assertChildren("resources/bundles/15", 
-                "file:/org.apache.sling.jcr.oak.server/15/oak", 
-                "file:/guava/15/jackrabbit", 
-                "file:/jsr305/15/oak,jackrabbit"); 
+    public void testInstall5Test() {
+        assertChildren("resources/install.test/5", 
+                "file:/FAKE_BUNDLE/org.apache.sling.extensions.webconsolesecurityprovider/5/test");
+    }
+    
+    @Test
+    public void testInstall15() {
+        assertChildren("resources/install/15",
+                "file:/FAKE_BUNDLE/fifteen.norunmode/15/null"); 
+    }
+    
+    @Test
+    public void testInstall15Oak() {
+        assertChildren("resources/install.oak/15", 
+                "file:/FAKE_BUNDLE/org.apache.sling.jcr.oak.server/15/oak",
+                "file:/FAKE_BUNDLE/jsr305/15/oak,jackrabbit"); 
+    }
+    
+    @Test
+    public void testInstall15Jackrabbit() {
+        assertChildren("resources/install.jackrabbit/15", 
+                "file:/FAKE_BUNDLE/guava/15/jackrabbit", 
+                "file:/FAKE_BUNDLE/jsr305/15/oak,jackrabbit"); 
     }
     
     @Test
@@ -271,4 +346,39 @@ public class BundleListContentProviderTest {
         assertNull(provider.getChildren("/FOO/bar"));
     }
     
+    @Test
+    public void testAllBundlesFound() {
+        final List<String> allResources = new LinkedList<String>();
+        addRecursively(allResources, "resources");
+        final List<String> bundles = new LinkedList<String>();
+        for(String r : allResources) {
+            if(r.contains("FAKE_BUNDLE")) {
+                bundles.add(r);
+            }
+        }
+        
+        // Bundles that have two run modes appear in two folders, we have two of those
+        // with two run modes each
+        final int expected = BUNDLES_IN_TEST_BUNDLE_LIST + 2;
+        assertEquals("Expecting the exact number of test bundles to be found", expected, bundles.size());
+    }
+    
+    @Test
+    public void testFile() {
+        assertChildren("file:/something");
+    }
+                
+    private void addRecursively(List<String> resources, String path) {
+        if(path.endsWith("/")) {
+            path = path.substring(0, path.length() - 1);
+        }
+        resources.add(path);
+        final Iterator<String> it = provider.getChildren(path);
+        if(it != null) {
+            while(it.hasNext()) {
+                addRecursively(resources, it.next());
+            }
+        }
+    }
+    
 }
diff --git a/src/test/resources/test-bundle-list.xml b/src/test/resources/test-bundle-list.xml
index 8c3b87c..43b7da5 100644
--- a/src/test/resources/test-bundle-list.xml
+++ b/src/test/resources/test-bundle-list.xml
@@ -51,6 +51,11 @@
             <version>1.0.0</version>
             <runModes>test</runModes>
         </bundle>
+        <bundle>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>five.norunmode</artifactId>
+            <version>1.0.0</version>
+        </bundle>
     </startLevel>
    
     <startLevel level="15">
@@ -72,5 +77,10 @@
             <version>2.0.0</version>
             <runModes>oak,jackrabbit</runModes>
         </bundle>
+        <bundle>
+            <groupId>org.apache.sling</groupId>
+            <artifactId>fifteen.norunmode</artifactId>
+            <version>1.0.0</version>
+        </bundle>
     </startLevel>
 </bundles>

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

[sling-maven-launchpad-plugin] 13/37: SLING-3416 - Some tests in o.a.s.m.projectsupport.BundleListContentProviderTest fails on windows

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 396172eab5fbe232a9c9a53bb9e46437236dd80d
Author: Amit Gupta <am...@apache.org>
AuthorDate: Mon Feb 24 18:08:46 2014 +0000

    SLING-3416 - Some tests in o.a.s.m.projectsupport.BundleListContentProviderTest fails on windows
    
    fixing the tests, hopefully these do not break on other platforms now.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1571375 13f79535-47bb-0310-9956-ffa450edef68
---
 .../BundleListContentProviderTest.java             | 55 +++++++++++++---------
 1 file changed, 33 insertions(+), 22 deletions(-)

diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
index 056c018..8041a56 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -59,6 +60,7 @@ public class BundleListContentProviderTest {
     private File resourceProviderFile;
     private File configDirectory;
     private int logWarningsCount;
+    private String fakeBundlePath;
     
     @Rule
     public TemporaryFolder tempFolder = new TemporaryFolder();
@@ -89,17 +91,26 @@ public class BundleListContentProviderTest {
             assertTrue("Expecting temporary config file to have been created: " + f.getAbsolutePath(), f.exists());
         }
         configDirectory = tempFolder.getRoot();
-        
+
         resourceProviderRoot = new File(tempFolder.getRoot(), "RESOURCE_PROVIDER_ROOT");
         resourceProviderRoot.mkdirs();
         resourceProviderFile = new File(resourceProviderRoot, "RP_FILE_" + System.currentTimeMillis());
         resourceProviderFile.createNewFile();
+        fakeBundlePath = getFakeBundlePath();
     }
     
     private File getConfigFile(String name) {
         return new File(tempFolder.getRoot(), name);
     }
-    
+
+    private String getFakeBundlePath() {
+        try {
+            return new File("/FAKE_BUNDLE").toURI().toURL().toExternalForm();
+        } catch (MalformedURLException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
     @Before
     public void setupProvider() {
         final Log log = Mockito.mock(Log.class);
@@ -276,55 +287,55 @@ public class BundleListContentProviderTest {
     
     @Test
     public void testInstall0() {
-        assertChildren("resources/install/0", 
-                "file:/FAKE_BUNDLE/commons-io/0/null", 
-                "file:/FAKE_BUNDLE/commons-fileupload/0/null", 
-                "file:/FAKE_BUNDLE/commons-collections/0/null"); 
+        assertChildren("resources/install/0",
+                fakeBundlePath + "/commons-io/0/null",
+                fakeBundlePath + "/commons-fileupload/0/null",
+                fakeBundlePath + "/commons-collections/0/null");
     }
     
     @Test
     public void testBootstrapBundles() {
-        assertChildren("resources/bundles/1", 
-                "file:/FAKE_BUNDLE/slf4j-api/-1/null", 
-                "file:/FAKE_BUNDLE/org.apache.sling.commons.log/-1/null"); 
+        assertChildren("resources/bundles/1",
+                fakeBundlePath + "/slf4j-api/-1/null",
+                fakeBundlePath + "/org.apache.sling.commons.log/-1/null");
     }
     
     @Test
     public void testInstall5() {
-        assertChildren("resources/install/5", 
-                "file:/FAKE_BUNDLE/five.norunmode/5/null"); 
+        assertChildren("resources/install/5",
+                fakeBundlePath + "/five.norunmode/5/null");
     }
     
     @Test
     public void testInstall5Dev() {
-        assertChildren("resources/install.dev/5", 
-                "file:/FAKE_BUNDLE/org.apache.sling.extensions.webconsolebranding/5/dev"); 
+        assertChildren("resources/install.dev/5",
+                fakeBundlePath + "/org.apache.sling.extensions.webconsolebranding/5/dev");
     }
     
     @Test
     public void testInstall5Test() {
-        assertChildren("resources/install.test/5", 
-                "file:/FAKE_BUNDLE/org.apache.sling.extensions.webconsolesecurityprovider/5/test");
+        assertChildren("resources/install.test/5",
+                fakeBundlePath + "/org.apache.sling.extensions.webconsolesecurityprovider/5/test");
     }
     
     @Test
     public void testInstall15() {
         assertChildren("resources/install/15",
-                "file:/FAKE_BUNDLE/fifteen.norunmode/15/null"); 
+                fakeBundlePath + "/fifteen.norunmode/15/null");
     }
     
     @Test
     public void testInstall15Oak() {
-        assertChildren("resources/install.oak/15", 
-                "file:/FAKE_BUNDLE/org.apache.sling.jcr.oak.server/15/oak",
-                "file:/FAKE_BUNDLE/jsr305/15/oak,jackrabbit"); 
+        assertChildren("resources/install.oak/15",
+                fakeBundlePath + "/org.apache.sling.jcr.oak.server/15/oak",
+                fakeBundlePath + "/jsr305/15/oak,jackrabbit");
     }
     
     @Test
     public void testInstall15Jackrabbit() {
-        assertChildren("resources/install.jackrabbit/15", 
-                "file:/FAKE_BUNDLE/guava/15/jackrabbit", 
-                "file:/FAKE_BUNDLE/jsr305/15/oak,jackrabbit"); 
+        assertChildren("resources/install.jackrabbit/15",
+                fakeBundlePath + "/guava/15/jackrabbit",
+                fakeBundlePath + "/jsr305/15/oak,jackrabbit");
     }
     
     @Test

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

[sling-maven-launchpad-plugin] 04/37: SLING-3142 : NullPointerException with Java8 in AbstractUsingBundleList

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 7bcfa0113ac30d7f813544441a8c01ea8c586569
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Oct 4 05:56:14 2013 +0000

    SLING-3142 : NullPointerException with Java8 in AbstractUsingBundleList
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1529083 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java    | 2 +-
 .../sling/maven/projectsupport/AbstractUsingBundleListMojo.java      | 5 +++--
 2 files changed, 4 insertions(+), 3 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 bb27287..2b45cc6 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -300,7 +300,7 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
                 File tmp = null;
                 try {
                     tmp = File.createTempFile("sling", "props");
-                    mavenFileFilter.copyFile(propertiesFile, tmp, true, project, null, true,
+                    mavenFileFilter.copyFile(propertiesFile, tmp, true, project, Collections.EMPTY_LIST, true,
                             System.getProperty("file.encoding"), mavenSession);
                     Properties loadedProps = PropertyUtils.loadPropertyFile(tmp, null);
                     for (Object key : loadedProps.keySet()) {
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 41e45a4..146a134 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -23,6 +23,7 @@ import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.Reader;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Properties;
 import java.util.Set;
@@ -408,7 +409,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
             File tmp = null;
             try {
                 tmp = File.createTempFile("sling", "props");
-                mavenFileFilter.copyFile(propsFile, tmp, true, project, null, true,
+                mavenFileFilter.copyFile(propsFile, tmp, true, project, Collections.EMPTY_LIST, true,
                         System.getProperty("file.encoding"), mavenSession);
                 final Properties loadedProps = PropertyUtils.loadPropertyFile(tmp, null);
                 if ( mode == 0 ) {
@@ -482,7 +483,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
             Reader reader = null;
             try {
                 tmp = File.createTempFile("sling", "bootstrap");
-                mavenFileFilter.copyFile(bootstrapFile, tmp, true, project, null, true,
+                mavenFileFilter.copyFile(bootstrapFile, tmp, true, project, Collections.EMPTY_LIST, true,
                         System.getProperty("file.encoding"), mavenSession);
                 reader = new FileReader(tmp);
                 final StringBuilder sb = new StringBuilder();

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

[sling-maven-launchpad-plugin] 27/37: Update to Sling Parent 23

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4e12946c094dd934ec5ac870654c7cfff81a2f27
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:08:16 2015 +0000

    Update to Sling Parent 23
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1687500 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 9f407d6..00c0ad8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>22</version>
+        <version>23</version>
         <relativePath/>
     </parent>
 

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

[sling-maven-launchpad-plugin] 08/37: SLING-3205 - avoid confusing warning on config files

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 805488f5eaa0c38499c10d88c5e7b3e7ed56e3ad
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Oct 28 14:07:46 2013 +0000

    SLING-3205 - avoid confusing warning on config files
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1536357 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/BundleListContentProvider.java  | 21 ++++++++++++++--
 .../BundleListContentProviderTest.java             | 28 ++++++++++++++++++++++
 2 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
index eb34f54..64442fc 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
@@ -221,6 +221,21 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
         
         return result.iterator();
     }
+    
+    private Iterator<String> handleConfigSubpath(String path) {
+        // We don't handle config subpaths for now, but do not 
+        // warn if we're asked for the children of a file, just
+        // return empty in that case
+        final File f = getConfigFile(path);
+        if(!f.exists()) {
+            getLog().warn("BundleListContentProvider cannot get children of config path: " + path);
+        }
+        return EMPTY_STRING_LIST.iterator();
+    }
+    
+    private File getConfigFile(String path) {
+        return new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
+    }
 
     public Iterator<String> getChildren(String path) {
         Iterator<String> result = null;
@@ -230,6 +245,8 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
             result = EMPTY_STRING_LIST.iterator();
         } else if (path.equals(CONFIG_PATH_PREFIX)) {
             result = handleConfigPath();
+        } else if (path.startsWith(CONFIG_PATH_PREFIX)) {
+            result = handleConfigSubpath(path);
         } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
             result = handleBundlesSubfolder(path);
         } else if (path.startsWith(INSTALL_PATH_PREFIX)) {
@@ -241,7 +258,7 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
             // as our file URLs point to Maven artifacts
             result = EMPTY_STRING_LIST.iterator();
         } else {
-            getLog().warn("BundleListContentProvider cannot handle path: " + path);
+            getLog().warn("BundleListContentProvider cannot get children of path: " + path);
         }
 
         return result;
@@ -249,7 +266,7 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
 
     public URL getResource(String path) {
         if (path.startsWith(CONFIG_PATH_PREFIX)) {
-            File configFile = new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
+            final File configFile = getConfigFile(path);
             if (configFile.exists()) {
                 try {
                     return configFile.toURI().toURL();
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
index 21cbe53..056c018 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -42,7 +42,10 @@ import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
+import org.mockito.Matchers;
 import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
 
 /** Test the BundleListContentProvider */
 public class BundleListContentProviderTest {
@@ -55,6 +58,7 @@ public class BundleListContentProviderTest {
     private File resourceProviderRoot;
     private File resourceProviderFile;
     private File configDirectory;
+    private int logWarningsCount;
     
     @Rule
     public TemporaryFolder tempFolder = new TemporaryFolder();
@@ -99,6 +103,18 @@ public class BundleListContentProviderTest {
     @Before
     public void setupProvider() {
         final Log log = Mockito.mock(Log.class);
+        final Answer<Void> countWarningAnswers = new Answer<Void>() {
+
+            public Void answer(InvocationOnMock invocation) throws Throwable {
+                logWarningsCount++;
+                return null;
+            }
+            
+        };
+        Mockito.doAnswer(countWarningAnswers).when(log).warn(Matchers.any(String.class));
+        Mockito.doAnswer(countWarningAnswers).when(log).warn(Matchers.any(Throwable.class));
+        Mockito.doAnswer(countWarningAnswers).when(log).warn(Matchers.any(String.class), Matchers.any(Throwable.class));
+        
         provider = new BundleListContentProvider(resourceProviderRoot) {
 
             @Override
@@ -229,6 +245,18 @@ public class BundleListContentProviderTest {
     }
     
     @Test
+    public void testConfigFile() {
+        assertChildren("resources/config/file1.txt");
+        assertEquals("Expecting no warnings", 0, logWarningsCount);
+    }
+    
+    @Test
+    public void testConfigSubpath() {
+        assertChildren("resources/config/someFolder/someSubFolder");
+        assertEquals("Expecting a warning", 1, logWarningsCount);
+    }
+    
+    @Test
     public void testNonExistentConfigDirectory() {
         configDirectory = new File("/NON_EXISTENT_" + System.currentTimeMillis());
         assertChildren("resources/config");

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

[sling-maven-launchpad-plugin] 17/37: SLING-3681 - Enable the maven-launchpad-plugin to generate the XSD for bundles list XML document

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 870559ac042804d041171593a7460bca1aeaf14c
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 19 12:05:49 2014 +0000

    SLING-3681 - Enable the maven-launchpad-plugin to generate the XSD for bundles list XML document
    
    Applied patch from Simone Tripodi, thanks!
    
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1603848 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                      | 5 +++--
 src/main/mdo/bundle-list.xml | 7 ++++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2444327..8159897 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,11 +41,12 @@
             <plugin>
                 <groupId>org.codehaus.modello</groupId>
                 <artifactId>modello-maven-plugin</artifactId>
-                <version>1.1</version>
+                <version>1.8.1</version>
                 <executions>
                     <execution>
                         <id>bundle-manifest.xml</id>
                         <goals>
+                            <goal>xsd</goal>
                             <goal>java</goal>
                             <goal>xpp3-reader</goal>
                             <goal>xpp3-writer</goal>
@@ -145,7 +146,7 @@
         <dependency>
             <groupId>org.codehaus.plexus</groupId>
             <artifactId>plexus-utils</artifactId>
-            <version>1.5.15</version>
+            <version>3.0.17</version>
         </dependency>
         <dependency>
             <groupId>commons-io</groupId>
diff --git a/src/main/mdo/bundle-list.xml b/src/main/mdo/bundle-list.xml
index 0bb9d5c..c82f9fc 100644
--- a/src/main/mdo/bundle-list.xml
+++ b/src/main/mdo/bundle-list.xml
@@ -18,7 +18,8 @@
   under the License.
 -->
 <model xmlns="http://modello.codehaus.org/MODELLO/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.0.0 http://modello.codehaus.org/xsd/modello-1.0.0.xsd">
+ xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.0.0 http://modello.codehaus.org/xsd/modello-1.0.0.xsd"
+ xsd.namespace="http://sling.apache.org/maven/1.0.0">
     <id>bundle-list</id>
     <name>BundleList</name>
     <description>
@@ -31,7 +32,7 @@
         </default>
     </defaults>
     <classes>
-        <class rootElement="true" xml.tagName="bundles">
+        <class rootElement="true" xml.tagName="bundles" xsd.compositor="sequence">
             <name>BundleList</name>
             <description>List of bundles.</description>
             <version>1.0.0</version>
@@ -47,7 +48,7 @@
                 </field>
             </fields>
         </class>
-        <class xml.tagName="startLevel">
+        <class xml.tagName="startLevel" xsd.compositor="sequence">
         	<name>StartLevel</name>
             <version>1.0.0</version>
             <superClass>org.apache.sling.maven.projectsupport.bundlelist.BaseStartLevel</superClass>

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

[sling-maven-launchpad-plugin] 34/37: Switch to parent pom 26

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 93873ae8b212cb4c8bf2aa874e9b4cd50cd17240
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Jan 3 14:07:46 2016 +0000

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

diff --git a/pom.xml b/pom.xml
index 4daaf6c..b874d1c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>25</version>
+        <version>26</version>
         <relativePath />
     </parent>
 

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

[sling-maven-launchpad-plugin] 23/37: Update to Sling Parent POM 22 with baselining enabled

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 8f0f3d3cf1943c623872867f91172bf43415a5c1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 1 06:34:43 2014 +0000

    Update to Sling Parent POM 22 with baselining enabled
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1628609 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 193133e..4b77d1f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>20</version>
+        <version>22</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] 33/37: [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 branch master
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git

commit 04b81d74cec33fc262ed3468eef8e713ffbd7e02
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Oct 21 11:39:56 2015 +0000

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

diff --git a/pom.xml b/pom.xml
index 9f96dd9..4daaf6c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     </parent>
 
     <artifactId>maven-launchpad-plugin</artifactId>
-    <version>2.3.4</version>
+    <version>2.3.5-SNAPSHOT</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/tags/maven-launchpad-plugin-2.3.4</connection>
-        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.4</developerConnection>
-        <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.4</url>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
+        <url>http://svn.apache.org/viewvc/sling/trunk/tooling/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] 20/37: SLING-3883 : Merging partial bundle list with properties fails. Apply patch from Marcel Reutegger

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9d96205266d842361dd1aa7269ef0e6519c81b34
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 12 06:10:57 2014 +0000

    SLING-3883 : Merging partial bundle list with properties fails. Apply patch from Marcel Reutegger
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1624456 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java  | 2 ++
 1 file changed, 2 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 ac6a0ba..4605275 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -259,6 +259,8 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
             }
         }
 
+        interpolateProperties(initializedBundleList, project, mavenSession);
+
         // check for partial bundle lists
         final Set<Artifact> dependencies = project.getDependencyArtifacts();
         for (Artifact artifact : dependencies) {

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