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

[sling-maven-launchpad-plugin] annotated tag maven-launchpad-plugin-2.1.0 created (now 537c6ca)

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

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


      at 537c6ca  (tag)
 tagging dbe394100c3f9758ca3307bdeb42e120ca06b05c (commit)
      by Carsten Ziegeler
      on Tue Sep 6 07:53:50 2011 +0000

- Log -----------------------------------------------------------------
maven-launchpad-plugin-2.1.0
-----------------------------------------------------------------------

This annotated tag includes the following new commits:

     new 96dc6d5  Introducing the maven-launchpad-plugin and builder (fka uber) project described in SLING-1197
     new ff6a77c  SLING-1310 - Changing artifactId of launchpad.builder to launchpad
     new 1f5bd24  SLING-1322 - adding check to avoid loading launchpad artifact if it's the same as the current project's
     new 347e5fb  SLING-1322 - removing extraneous project variable
     new b8899de  SLING-1323 - adding "bundlesToRemove" option
     new 5682b2d  Unifying bundle addition / removal code (re: SLING-1321)
     new bb29c9b  SLING-1351 Fixed, added the Start levels in when there are none defined.
     new 8ffdfb1  SLING-1364 - creating prepare-test-webapp mojo
     new d2e7962  SLING-1351 When the xpp parser loads a Bundle it only sets the attributes specified on the bundle, and takes no account of any containers, hence on merge the container start level must be inspected to determine where a bundle should be merged. If not specified (ie 0) it should be merged in the containing bundle. This means that its not going to be possible to specify a bundle as loading in start level 0 by setting the level on the bundle. To load in start level 0 you mus [...]
     new 8c0ec78  SLING-1441 - adding run goal to launchpad plugin
     new b3f5ef2  SLING-1454 - adding ability to read filtered sling properties from a file
     new df85fd6  SLING-1442 - adding start and stop goals to launchpad plugin
     new 74b72b9  exposing controlHost configuration parameter in launchpad plugin
     new 99ee468  fix formatting of pom file
     new 9768cfb  SLING-1442 - shouldn't be killing the JVM on a "stop" command.
     new dd65aa8  SLING-1491 - switching from pax web to felix httpservice
     new eb5e840  updating to released launchpad base
     new 2183492  reformatting pom
     new cc7a04f  [maven-release-plugin] prepare release maven-launchpad-plugin-2.0.6
     new d69b5db  [maven-release-plugin] prepare for next development iteration
     new 2e9d194  using next snapshot until release vote is finished
     new e75b100  Update some notice files
     new 2551177  Use released version of launchpad base
     new 917e990  Use released parent pom.
     new c6c90d7  SLING-1586 - adding overwrite version on merge code
     new 99e00dc  SLING-1591 - upgrading to latest base artifacts
     new c52ad9c  SLING-1692 - replacing dummy code for updated() method.
     new 2945145  SLING-1693 - adding xml as a resource provider provided extension
     new 42035b5  changing classname and adding missing license header
     new 119f700  SLING-1693 - implemeting a search path for resources
     new b508767  SLING-1743 / SLING-845 - setting slingHome to default to ${basedir}/sling. No longer need the antrun execution as a result
     new ea8d50e  SLING-1799 - adding output-bundle-list mojo
     new d05a0b4  tabs -> spaces
     new f300177  SLING-1795 - adding Drools-based rules for rewriting bundle list. Includes sample rule which can be activated by running "mvn -P test-reactor-sling-bundles clean install" from the root project.
     new cbb45d4  updating all modules to parent 10-SNAPSHOT in anticipation of emma additions to parent
     new 25154c3  adding jboss repository (for drools dependencies)
     new 793fe22  trivial improvement in error handling
     new 85a3ca6  SLING-1803 - adding emma report. runs with -P emma
     new 3106d97  SLING-1843 - adding launchpad:display-bundle-updates goal
     new c31bbfa  Update to recent snapshots
     new bad22bd  prepping maven-launchpad-plugin for release
     new 63eaf6e  [maven-release-plugin] prepare release maven-launchpad-plugin-2.0.8
     new 9fd2bdb  [maven-release-plugin] prepare for next development iteration
     new 61f3f68  SLING-1597 - adding config installation via launchpad
     new c0518da  removing LICENSE and NOTICE files for future releases
     new ede6563  SLING-1980 - fixing by adding some code as described by Benjamin on maven-users
     new f33d169  updating pom pre-release
     new 64e03a1  [maven-release-plugin] prepare release maven-launchpad-plugin-2.0.10
     new 6cec043  [maven-release-plugin] prepare for next development iteration
     new c80a1cc  using snapshots during vote
     new d8dc15d  Temporarily upgrade to 1.0.1-SNAPSHOT of the launchpad API to not fail builds
     new 8c84089  SLING-1988 - removing errant files
     new 2cddbb6  removing empty dir
     new b751260  SLING-2105 - initial implementation of partial bundle lists
     new f23f3d6  Code  cleanup - remove unused stuff.
     new d8c44e2  Code  cleanup - remove unused stuff.
     new 67eb316  SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
     new 79e6e41  SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
     new 2d6b5a8  SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
     new cb3b66f  SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
     new 0a616ce  SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
     new 2fc71ae  Remove unused code
     new d72004a  SLING-2134 : Provide a way to add additional properties to sling.properties
     new 5039e0f  SLING-2135 : Copying of resources should respect default includes
     new 13dad4c  SLING-2134 : Provide a way to add additional properties to sling.properties
     new 98a09a7  SLING-2150 : Update plugins to use the latest available versions
     new a0121dc  Update to recent snapshot
     new 893c07a  Update to recent snapshot
     new 917e094  Using latest released parent pom
     new ba156ae  SLING-2182 : Provide a way to specify additional bootstrap commands
     new 934711b  SLING-2182 : Provide a way to specify additional bootstrap commands
     new 97dac9a  SLING-2183 : Bundle configurations and sling files with bundlelist
     new 0f6d05c  Using released versions
     new dff0438  SLING-2134 : Provide a way to add additional properties to sling.properties SLING-2182 : Provide a way to specify additional bootstrap commands
     new f1a9178  SLING-2182 : Provide a way to specify additional bootstrap commands
     new a35a90d  SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
     new 179cc9b  temporarily using snapshots during release vote
     new 02a8aea  SLING-2207 : Support different properties and bootstrap commands for standalone and webapp
     new 44145b7  SLING-2207 : Support different properties and bootstrap commands for standalone and webapp
     new 3b2fc20  Prepare for release
     new 3325362  [maven-release-plugin] prepare release maven-launchpad-plugin-2.1.0
     new dbe3941  [maven-release-plugin]  copy for tag maven-launchpad-plugin-2.1.0

The 82 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] 19/34: Update to recent snapshot

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

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

commit a0121dccab0c3fec988e8bfd9f62e3ea61b2d8c4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Aug 3 09:01:37 2011 +0000

    Update to recent snapshot
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1153397 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 5eb21d4..bd4e35b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,13 +17,13 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>11-SNAPSHOT</version>
+        <version>12-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 
     <groupId>org.apache.sling</groupId>
     <artifactId>maven-launchpad-plugin</artifactId>
-    <version>2.0.11-SNAPSHOT</version>
+    <version>2.0.12-SNAPSHOT</version>
     <packaging>maven-plugin</packaging>
 
     <name>Apache Sling Launchpad Maven Plugin</name>

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

[sling-maven-launchpad-plugin] 12/34: SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles

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

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

commit cb3b66f1f953e2c75f408ff01beb7af020249dc6
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 7 16:09:27 2011 +0000

    SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1143901 13f79535-47bb-0310-9956-ffa450edef68
---
 .../AbstractLaunchpadStartingMojo.java             | 33 +++++++++++++---------
 .../maven/projectsupport/PreparePackageMojo.java   |  2 +-
 .../projectsupport/bundlelist/BaseBundle.java      |  6 ++++
 .../projectsupport/bundlelist/BaseBundleList.java  |  2 +-
 .../projectsupport/PreparePackageMojoTest.java     |  4 ++-
 5 files changed, 31 insertions(+), 16 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 bc5cf72..3904aed 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -27,10 +27,12 @@ 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;
@@ -119,9 +121,14 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
 
         public Iterator<String> getChildren(String path) {
             if (path.equals(BUNDLE_PATH_PREFIX)) {
-                List<String> levels = new ArrayList<String>();
-                for (StartLevel level : getBundleList().getStartLevels()) {
-                    levels.add(String.valueOf(BUNDLE_PATH_PREFIX + "/" + level.getLevel()) + "/");
+                final Set<String> levels = new HashSet<String>();
+                for (final StartLevel level : getBundleList().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")) {
@@ -150,28 +157,28 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
                     return empty.iterator();
                 }
             } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
-                String startLevel = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
+                final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
                 try {
-                    int i = Integer.parseInt(startLevel);
-                    List<String> bundles = new ArrayList<String>();
-                    for (StartLevel level : getBundleList().getStartLevels()) {
-                        if (level.getStartLevel() == i) {
-                            for (Bundle bundle : level.getBundles()) {
-                                ArtifactDefinition d = new ArtifactDefinition(bundle, i);
+                    final int startLevel = Integer.parseInt(startLevelInfo);
+
+                    final List<String> bundles = new ArrayList<String>();
+                    for (final StartLevel level : getBundleList().getStartLevels()) {
+                        if (level.getStartLevel() == startLevel || (startLevel == 1 && level.getStartLevel() == -1)) {
+                            for (final Bundle bundle : level.getBundles()) {
+                                final ArtifactDefinition d = new ArtifactDefinition(bundle, startLevel);
                                 try {
-                                    Artifact artifact = getArtifact(d);
+                                    final Artifact artifact = getArtifact(d);
                                     bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
                                 } catch (Exception e) {
                                     getLog().error("Unable to resolve artifact ", e);
                                 }
                             }
-
-                            break;
                         }
                     }
                     return bundles.iterator();
 
                 } catch (NumberFormatException e) {
+                    // we ignore this
                 }
             }
 
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 1fdc8c0..bc8a9e3 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -193,7 +193,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to copy configuration files", e);
         }
-        
+
     }
 
     private void unpack(File source, File destination, String includes, String excludes)
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
index 5c9b683..9ae1f8d 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundle.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundle.java
@@ -30,4 +30,10 @@ public abstract class BaseBundle {
 
     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
index 70050e3..85cc7a8 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
@@ -81,7 +81,7 @@ public abstract class BaseBundleList {
             current.setVersion(newBnd.getVersion());
         } else {
             StartLevel startLevel = null;
-            if ( mergeStartLevel == null || newBnd.getStartLevel() > 0) {
+            if ( mergeStartLevel == null || newBnd.getStartLevel() != 0) {
                 startLevel = getOrCreateStartLevel(newBnd.getStartLevel());
             } else {
                 startLevel = getOrCreateStartLevel(mergeStartLevel.getStartLevel());
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 7d94f09..2a2fff3 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
@@ -16,11 +16,13 @@
  */
 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;
-import static org.junit.Assert.*;
 
 /**
  * Tests of PreparePageMojo

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

[sling-maven-launchpad-plugin] 28/34: SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files

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

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

commit a35a90daf2e175ba11faeb1d04fe5ec8d040d729
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Aug 31 19:23:49 2011 +0000

    SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1163752 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 62a347e..65aa8c0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>11</version>
+        <version>12-SNAPSHOT</version>
         <relativePath>../../parent/pom.xml</relativePath>
     </parent>
 

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

[sling-maven-launchpad-plugin] 06/34: SLING-2105 - initial implementation of partial bundle lists

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

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

commit b751260154168693024adcdebcfa251ff9deaf9c
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Fri Jun 17 16:41:07 2011 +0000

    SLING-2105 - initial implementation of partial bundle lists
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1136928 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/AbstractBundleListMojo.java     | 313 +--------------------
 .../AbstractLaunchpadFrameworkMojo.java            |   2 +-
 .../AbstractLaunchpadStartingMojo.java             |   2 +-
 ...tMojo.java => AbstractUsingBundleListMojo.java} |  38 +--
 .../maven/projectsupport/AttachBundleListMojo.java |   2 +-
 ...tMojo.java => AttachPartialBundleListMojo.java} |  23 +-
 .../CheckBundleListForSnapshotsMojo.java           |   2 +-
 .../CreateKarafFeatureDescriptorMojo.java          |   2 +-
 .../maven/projectsupport/OutputBundleListMojo.java |   2 +-
 src/main/resources/META-INF/plexus/components.xml  |  53 ++++
 10 files changed, 86 insertions(+), 353 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index cd6bb11..1818ff6 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -17,40 +17,10 @@
 package org.apache.sling.maven.projectsupport;
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.List;
-import java.util.Properties;
 
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataRetrievalException;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.versioning.ArtifactVersion;
-import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
-import org.codehaus.plexus.util.StringUtils;
-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 AbstractBundleListMojo extends AbstractMojo {
 
@@ -70,6 +40,11 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
      */
     protected static final String WAR = "war";
 
+    /**
+     * Partial Bundle List type
+     */
+    protected static final String PARTIAL = "partialbundlelist";
+
     protected static final String CONFIG_PATH_PREFIX = "resources/config";
 
     protected static final String BUNDLE_PATH_PREFIX = "resources/bundles";
@@ -88,13 +63,6 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
     protected File bundleListFile;
 
     /**
-     * The definition of the defaultBundleList artifact.
-     *
-     * @parameter
-     */
-    protected ArtifactDefinition defaultBundleList;
-
-    /**
      * The Maven project.
      *
      * @parameter expression="${project}"
@@ -108,275 +76,4 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
      */
     protected MavenProjectHelper projectHelper;
 
-    /**
-     * Any additional bundles to include in the project's bundles directory.
-     *
-     * @parameter
-     */
-    private ArtifactDefinition[] additionalBundles;
-
-    private BundleList bundleList;
-
-    /**
-     * Bundles which should be removed from the project's bundles directory.
-     *
-     * @parameter
-     */
-    private ArtifactDefinition[] bundleExclusions;
-
-    /**
-     * Used to look up Artifacts in the remote repository.
-     *
-     * @component
-     */
-    private ArtifactFactory factory;
-
-    /**
-     * Used to look up Artifacts in the remote repository.
-     *
-     * @component hint="maven"
-     */
-    private ArtifactMetadataSource metadataSource;
-
-    /**
-     * If true, include the default bundles.
-     *
-     * @parameter default-value="true"
-     */
-    private boolean includeDefaultBundles;
-
-    /**
-     * Location of the local repository.
-     *
-     * @parameter expression="${localRepository}"
-     * @readonly
-     * @required
-     */
-    private ArtifactRepository local;
-
-    /**
-     * List of Remote Repositories used by the resolver.
-     *
-     * @parameter expression="${project.remoteArtifactRepositories}"
-     * @readonly
-     * @required
-     */
-    private List remoteRepos;
-
-    /**
-     * Used to look up Artifacts in the remote repository.
-     *
-     * @component
-     */
-    private ArtifactResolver resolver;
-
-    /**
-     * @parameter
-     */
-    private File[] rewriteRuleFiles;
-
-    /**
-     * @parameter expression="${session}
-     * @required
-     * @readonly
-     */
-    protected MavenSession mavenSession;
-
-    public final void execute() throws MojoFailureException, MojoExecutionException {
-        try {
-            initBundleList();
-        } catch (MojoExecutionException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new MojoExecutionException("Unable to load dependency information from properties file.", e);
-        }
-        executeWithArtifacts();
-
-    }
-
-    /**
-     * Execute the logic of the plugin after the default artifacts have been
-     * initialized.
-     */
-    protected abstract void executeWithArtifacts() throws MojoExecutionException, MojoFailureException;
-
-    /**
-     * Get a resolved Artifact from the coordinates found in the artifact
-     * definition.
-     *
-     * @param def the artifact definition
-     * @return the artifact, which has been resolved
-     * @throws MojoExecutionException
-     */
-    protected Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException {
-        return getArtifact(def.getGroupId(), def.getArtifactId(), def.getVersion(), def.getType(), def.getClassifier());
-    }
-
-    /**
-     * Get a resolved Artifact from the coordinates provided
-     *
-     * @return the artifact, which has been resolved.
-     * @throws MojoExecutionException
-     */
-    protected Artifact getArtifact(String groupId, String artifactId, String version, String type, String classifier)
-            throws MojoExecutionException {
-        Artifact artifact;
-        VersionRange vr;
-
-        try {
-            vr = VersionRange.createFromVersionSpec(version);
-        } catch (InvalidVersionSpecificationException e) {
-            vr = VersionRange.createFromVersion(version);
-        }
-
-        if (StringUtils.isEmpty(classifier)) {
-            artifact = factory.createDependencyArtifact(groupId, artifactId, vr, type, null, Artifact.SCOPE_COMPILE);
-        } else {
-            artifact = factory.createDependencyArtifact(groupId, artifactId, vr, type, classifier,
-                    Artifact.SCOPE_COMPILE);
-        }
-
-        // This code kicks in when the version specifier is a range.
-        if (vr.getRecommendedVersion() == null) {
-            try {
-                List availVersions = metadataSource.retrieveAvailableVersions(artifact, local, remoteRepos);
-                ArtifactVersion resolvedVersion = vr.matchVersion(availVersions);
-                artifact.setVersion(resolvedVersion.toString());
-            } catch (ArtifactMetadataRetrievalException e) {
-                throw new MojoExecutionException("Unable to find version for artifact", e);
-            }
-            
-        }
-
-        try {
-            resolver.resolve(artifact, remoteRepos, local);
-        } catch (ArtifactResolutionException e) {
-            throw new MojoExecutionException("Unable to resolve artifact.", e);
-        } catch (ArtifactNotFoundException e) {
-            throw new MojoExecutionException("Unable to find artifact.", e);
-        }
-        return artifact;
-    }
-
-    protected BundleList getBundleList() {
-        return bundleList;
-    }
-
-    /**
-     * 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) {
-    }
-
-    protected boolean isCurrentArtifact(ArtifactDefinition def) {
-        return (def.getGroupId().equals(project.getGroupId()) && def.getArtifactId().equals(project.getArtifactId()));
-    }
-
-    /**
-     * Initialize the artifact definitions using defaults inside the plugin JAR.
-     *
-     * @throws IOException if the default properties can't be read
-     * @throws XmlPullParserException
-     * @throws MojoExecutionException
-     */
-    private final void initArtifactDefinitions() throws IOException {
-        Properties dependencies = new Properties();
-        dependencies.load(getClass().getResourceAsStream(
-                "/org/apache/sling/maven/projectsupport/dependencies.properties"));
-
-        if (defaultBundleList == null) {
-            defaultBundleList = new ArtifactDefinition();
-        }
-        defaultBundleList.initDefaults(dependencies.getProperty("defaultBundleList"));
-
-        initArtifactDefinitions(dependencies);
-    }
-
-    private final void initBundleList() throws IOException, XmlPullParserException, MojoExecutionException {
-        initArtifactDefinitions();
-        if (isCurrentArtifact(defaultBundleList)) {
-            bundleList = readBundleList(bundleListFile);
-        } else {
-            bundleList = new BundleList();
-            if (includeDefaultBundles) {
-                Artifact defBndListArtifact = getArtifact(defaultBundleList.getGroupId(),
-                        defaultBundleList.getArtifactId(), defaultBundleList.getVersion(), defaultBundleList.getType(),
-                        defaultBundleList.getClassifier());
-                getLog().info("Using bundle list file from " + defBndListArtifact.getFile().getAbsolutePath());
-                bundleList = readBundleList(defBndListArtifact.getFile());
-            }
-
-            if (bundleListFile.exists()) {
-                bundleList.merge(readBundleList(bundleListFile));
-            }
-        }
-        if (additionalBundles != null) {
-            for (ArtifactDefinition def : additionalBundles) {
-                bundleList.add(def.toBundle());
-            }
-        }
-        if (bundleExclusions != null) {
-            for (ArtifactDefinition def : bundleExclusions) {
-                bundleList.remove(def.toBundle(), false);
-            }
-        }
-        initBundleList(bundleList);
-
-        rewriteBundleList(bundleList);
-    }
-
-    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 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/AbstractLaunchpadFrameworkMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
index 7eeede7..4697899 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
@@ -30,7 +30,7 @@ import org.codehaus.plexus.util.FileUtils;
  * This class contains the Launchpad-framework specific utility methods.
  *
  */
-public abstract class AbstractLaunchpadFrameworkMojo extends AbstractBundleListMojo {
+public abstract class AbstractLaunchpadFrameworkMojo extends AbstractUsingBundleListMojo {
 
     /**
      * The name of the directory within the output directory into which the base
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 6c5c4fd..6835161 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -50,7 +50,7 @@ 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 AbstractBundleListMojo implements Notifiable {
+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;
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
similarity index 95%
copy from src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
copy to src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index cd6bb11..5420b42 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -21,6 +21,7 @@ import java.io.FileInputStream;
 import java.io.IOException;
 import java.util.List;
 import java.util.Properties;
+import java.util.Set;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -34,11 +35,8 @@ 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.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectHelper;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
 import org.codehaus.plexus.util.StringUtils;
@@ -52,7 +50,7 @@ import org.drools.builder.ResourceType;
 import org.drools.io.ResourceFactory;
 import org.drools.runtime.StatefulKnowledgeSession;
 
-public abstract class AbstractBundleListMojo extends AbstractMojo {
+public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo {
 
     /**
      * @parameter expression="${configDirectory}"
@@ -83,11 +81,6 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
     }
 
     /**
-     * @parameter default-value="${basedir}/src/main/bundles/list.xml"
-     */
-    protected File bundleListFile;
-
-    /**
      * The definition of the defaultBundleList artifact.
      *
      * @parameter
@@ -95,20 +88,6 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
     protected ArtifactDefinition defaultBundleList;
 
     /**
-     * The Maven project.
-     *
-     * @parameter expression="${project}"
-     * @required
-     * @readonly
-     */
-    protected MavenProject project;
-
-    /**
-     * @component
-     */
-    protected MavenProjectHelper projectHelper;
-
-    /**
      * Any additional bundles to include in the project's bundles directory.
      *
      * @parameter
@@ -301,6 +280,7 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
         initArtifactDefinitions(dependencies);
     }
 
+    @SuppressWarnings("unchecked")
     private final void initBundleList() throws IOException, XmlPullParserException, MojoExecutionException {
         initArtifactDefinitions();
         if (isCurrentArtifact(defaultBundleList)) {
@@ -329,6 +309,18 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
                 bundleList.remove(def.toBundle(), false);
             }
         }
+        
+        Set<Artifact> dependencies = project.getDependencyArtifacts();
+        for (Artifact artifact : dependencies) {
+            if (PARTIAL.equals(artifact.getType())) {
+                getLog().info(
+                        String.format("merging partial bundle list for %s:%s:%s", artifact.getGroupId(),
+                                artifact.getArtifactId(), artifact.getVersion()));
+                bundleList.merge(readBundleList(artifact.getFile()));
+            }
+        }
+        
+        
         initBundleList(bundleList);
 
         rewriteBundleList(bundleList);
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 ddb0287..dc5505c 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
@@ -31,7 +31,7 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleLis
  * @phase package
  * @description attach the bundle list as a project artifact
  */
-public class AttachBundleListMojo extends AbstractBundleListMojo {
+public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
 
     private static final String CLASSIFIER = "bundlelist";
 
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
similarity index 58%
copy from src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
copy to src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
index 031949f..79b1cc0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -16,29 +16,20 @@
  */
 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
+ * Attaches the bundle list as a project artifact.
  * 
+ * @goal attach-partial-bundle-list
+ * @phase package
+ * @description attach the partial bundle list as a project artifact
  */
-public class OutputBundleListMojo extends AbstractBundleListMojo {
+public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
 
-    @Override
-    protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
-        BundleListXpp3Writer writer = new BundleListXpp3Writer();
-        try {
-            writer.write(new OutputStreamWriter(System.out), getBundleList());
-        } catch (IOException e) {
-            throw new MojoExecutionException("Unable to write bundle list", e);
-        }
+    public void execute() throws MojoExecutionException, MojoFailureException {
+        project.getArtifact().setFile(bundleListFile);
     }
 
 }
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 cb0a210..9c6b97b 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
@@ -32,7 +32,7 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
  * @goal check-bundle-list-for-snapshots
  *
  */
-public class CheckBundleListForSnapshotsMojo extends AbstractBundleListMojo {
+public class CheckBundleListForSnapshotsMojo extends AbstractUsingBundleListMojo {
 
     /**
      * True if the build should be failed if a snapshot is found.
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 9e7e9e3..dba8b69 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
@@ -37,7 +37,7 @@ import org.jdom.output.XMLOutputter;
  * @phase package
  * @description create a karaf feature descriptor
  */
-public class CreateKarafFeatureDescriptorMojo extends AbstractBundleListMojo {
+public class CreateKarafFeatureDescriptorMojo extends AbstractUsingBundleListMojo {
 
     private static final String CLASSIFIER = "features";
 
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 031949f..9c8cec1 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
@@ -29,7 +29,7 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleLis
  * @goal output-bundle-list
  * 
  */
-public class OutputBundleListMojo extends AbstractBundleListMojo {
+public class OutputBundleListMojo extends AbstractUsingBundleListMojo {
 
     @Override
     protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
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>

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

[sling-maven-launchpad-plugin] 22/34: SLING-2182 : Provide a way to specify additional bootstrap commands

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

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

commit ba156ae8d985e97680b9ec5e257e50a48dcb6876
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Aug 18 08:46:19 2011 +0000

    SLING-2182 : Provide a way to specify additional bootstrap commands
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1159088 13f79535-47bb-0310-9956-ffa450edef68
---
 .../AbstractUsingBundleListMojo.java               |  58 ++++++++-
 .../maven/projectsupport/PreparePackageMojo.java   | 135 ++++++++++++++-------
 2 files changed, 142 insertions(+), 51 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index a9af72a..be08450 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -18,7 +18,9 @@ package org.apache.sling.maven.projectsupport;
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileReader;
 import java.io.IOException;
+import java.io.Reader;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
@@ -65,7 +67,13 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      * @parameter expression="${additionalSlingProps}"
      *            default-value="src/main/sling/additional.properties"
      */
-    protected File additionalSlingProps;
+    private File additionalSlingProps;
+
+    /**
+     * @parameter expression="${additionalSlingBootstrap}"
+     *            default-value="src/main/sling/bootstrap.txt"
+     */
+    private File additionalSlingBootstrap;
 
     /**
      * JAR Packaging type.
@@ -84,9 +92,8 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
     protected static boolean shouldCopy(File source, File dest) {
         if (!dest.exists()) {
             return true;
-        } else {
-            return source.lastModified() > dest.lastModified();
         }
+        return source.lastModified() > dest.lastModified();
     }
 
     /**
@@ -149,7 +156,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      * @readonly
      * @required
      */
-    private List remoteRepos;
+    private List<?> remoteRepos;
 
     /**
      * Used to look up Artifacts in the remote repository.
@@ -232,7 +239,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         // This code kicks in when the version specifier is a range.
         if (vr.getRecommendedVersion() == null) {
             try {
-                List availVersions = metadataSource.retrieveAvailableVersions(artifact, local, remoteRepos);
+                List<?> availVersions = metadataSource.retrieveAvailableVersions(artifact, local, remoteRepos);
                 ArtifactVersion resolvedVersion = vr.matchVersion(availVersions);
                 artifact.setVersion(resolvedVersion.toString());
             } catch (ArtifactMetadataRetrievalException e) {
@@ -406,4 +413,45 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         }
         return null;
     }
+
+    /**
+     * 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() throws MojoExecutionException {
+        if (this.additionalSlingBootstrap.exists()) {
+            File tmp = null;
+            Reader reader = null;
+            try {
+                tmp = File.createTempFile("sling", "bootstrap");
+                mavenFileFilter.copyFile(this.additionalSlingBootstrap, tmp, true, project, null, true,
+                        System.getProperty("file.encoding"), mavenSession);
+                reader = new FileReader(tmp);
+                final StringBuilder sb = new StringBuilder();
+                final char[] buffer = new char[2048];
+                int l;
+                while ( (l = reader.read(buffer, 0, buffer.length) ) != -1 ) {
+                    sb.append(buffer, 0, l);
+                }
+
+                return sb.toString();
+            } catch (IOException e) {
+                throw new MojoExecutionException("Unable to create filtered bootstrap file", e);
+            } catch (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) {}
+                }
+            }
+        }
+        return 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 b2554da..2f60407 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -19,6 +19,7 @@ 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;
@@ -137,13 +138,86 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
         }
     }
 
-	private void copyBaseArtifact() throws MojoExecutionException {
+    /**
+     * 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 or append
+        try {
+            if ( !origSlingCmd.exists() ) {
+                writer = new FileWriter(origSlingCmd);
+            } else {
+                writer = new FileWriter(origSlingCmd, true);
+            }
+
+            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",
+					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);
@@ -151,53 +225,23 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 				.getArtifactId()
 				+ "." + artifact.getArtifactHandler().getExtension());
 
-		// check if custom sling.properties file exists
+		// check if custom sling.properties file or bootstrap command exists
 		final Properties additionalProps = this.getSlingProperties();
-		if ( additionalProps != null ) {
+		final String bootstrapCmd = this.getSlingBootstrap();
+		if ( additionalProps != null || bootstrapCmd != null ) {
     		// unpack to a temp destination
 		    final File dest = new File(this.tempDirectory, "basejar");
 		    try {
         		unpack(artifact.getFile(), dest);
-        		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 sling properties
+        		if ( additionalProps != null ) {
+        		    this.patchSlingProperties(dest, additionalProps);
         		}
 
-                // 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 bootstrap command
+                if  ( bootstrapCmd != null ) {
+                    this.patchSlingBootstrap(dest, bootstrapCmd);
                 }
 
                 // and repack again
@@ -245,9 +289,8 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 	protected File getOutputDirectory() {
 		if (WAR.equals(packaging)) {
 			return warOutputDirectory;
-		} else {
-			return buildOutputDirectory;
-		}
+        }
+		return buildOutputDirectory;
 	}
 
 	protected void unpackBaseArtifact() throws MojoExecutionException {

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

[sling-maven-launchpad-plugin] 23/34: SLING-2182 : Provide a way to specify additional bootstrap commands

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

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

commit 934711be4f2513d32317c9df07feadadc66fdc20
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Aug 18 08:55:51 2011 +0000

    SLING-2182 : Provide a way to specify additional bootstrap commands
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1159094 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/maven/projectsupport/PreparePackageMojo.java | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

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 2f60407..67d83c0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -195,13 +195,9 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
         final File origSlingCmd = new File(dest, "sling_bootstrap.txt");
         FileWriter writer = null;
 
-        /// and write or append
+        /// and write
         try {
-            if ( !origSlingCmd.exists() ) {
-                writer = new FileWriter(origSlingCmd);
-            } else {
-                writer = new FileWriter(origSlingCmd, true);
-            }
+            writer = new FileWriter(origSlingCmd);
 
             writer.write(additionalCmd);
         } catch (final IOException ioe) {

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

[sling-maven-launchpad-plugin] 16/34: SLING-2135 : Copying of resources should respect default includes

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

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

commit 5039e0f525bbe8bb83c78af6ad7b77381e869604
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jul 11 15:41:26 2011 +0000

    SLING-2135 : Copying of resources should respect default includes
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1145208 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 f0788bb..1d8c989 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -277,7 +277,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 
     private void copyConfigurationFiles() throws MojoExecutionException {
         try {
-            FileUtils.copyDirectory(configDirectory, new File(getOutputDirectory(), CONFIG_PATH_PREFIX));
+            FileUtils.copyDirectory(configDirectory, new File(getOutputDirectory(), CONFIG_PATH_PREFIX), null, FileUtils.getDefaultExcludesAsString());
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to copy configuration files", e);
         }

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

[sling-maven-launchpad-plugin] 31/34: SLING-2207 : Support different properties and bootstrap commands for standalone and webapp

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

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

commit 44145b749ac80d2bebeac24cc7e02267b584dc06
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Sep 6 07:25:55 2011 +0000

    SLING-2207 : Support different properties and bootstrap commands for standalone and webapp
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1165526 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 34270d5..60898d6 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -565,6 +565,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                 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 ) {
@@ -603,6 +604,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         }
         if ( addCmds != null ) {
             final StringBuilder builder = new StringBuilder(this.slingBootstrapCommand);
+            builder.append('\n');
             builder.append(addCmds);
             return builder.toString();
         }

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

[sling-maven-launchpad-plugin] 14/34: Remove unused code

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

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

commit 2fc71ae125efa7fe9ae27c34c4d92eff797dcb40
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jul 11 09:38:24 2011 +0000

    Remove unused code
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1145094 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/projectsupport/PreparePackageMojo.java     | 20 ++------------------
 1 file changed, 2 insertions(+), 18 deletions(-)

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 bc8a9e3..9f445f3 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -28,9 +28,7 @@ import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.UnArchiver;
 import org.codehaus.plexus.archiver.manager.ArchiverManager;
 import org.codehaus.plexus.archiver.manager.NoSuchArchiverException;
-import org.codehaus.plexus.components.io.fileselectors.IncludeExcludeFileSelector;
 import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
 
 /**
  * Initialize a Sling application project by extracting bundles into the correct
@@ -184,7 +182,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 									"Project doesn't have a base dependency of groupId %s and artifactId %s",
 									base.getGroupId(), base.getArtifactId()));
 		}
-		unpack(artifact.getFile(), buildOutputDirectory, null, null);
+		unpack(artifact.getFile(), buildOutputDirectory);
 	}
 
     private void copyConfigurationFiles() throws MojoExecutionException {
@@ -196,7 +194,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 
     }
 
-    private void unpack(File source, File destination, String includes, String excludes)
+    private void unpack(File source, File destination)
             throws MojoExecutionException {
         getLog().info("Unpacking " + source.getPath() + " to\n  " + destination.getPath());
         try {
@@ -207,20 +205,6 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
             unArchiver.setSourceFile(source);
             unArchiver.setDestDirectory(destination);
 
-            if (StringUtils.isNotEmpty(excludes) || StringUtils.isNotEmpty(includes)) {
-                IncludeExcludeFileSelector[] selectors = new IncludeExcludeFileSelector[] { new IncludeExcludeFileSelector() };
-
-                if (StringUtils.isNotEmpty(excludes)) {
-                    selectors[0].setExcludes(excludes.split(","));
-                }
-
-                if (StringUtils.isNotEmpty(includes)) {
-                    selectors[0].setIncludes(includes.split(","));
-                }
-
-                unArchiver.setFileSelectors(selectors);
-            }
-
             unArchiver.extract();
         } catch (NoSuchArchiverException e) {
             throw new MojoExecutionException("Unable to find archiver for " + source.getPath(), e);

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

[sling-maven-launchpad-plugin] 34/34: [maven-release-plugin] copy for tag maven-launchpad-plugin-2.1.0

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

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

commit dbe394100c3f9758ca3307bdeb42e120ca06b05c
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Sep 6 07:53:50 2011 +0000

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

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

[sling-maven-launchpad-plugin] 08/34: Code cleanup - remove unused stuff.

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

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

commit d8c44e26b77330e24e4e3015f5b4a5ce892ebad4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jul 4 07:47:41 2011 +0000

    Code  cleanup - remove unused stuff.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1142582 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/AbstractBundleListMojo.java     | 24 ----------------------
 1 file changed, 24 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index 2810c41..6ec799a 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -25,34 +25,10 @@ import org.apache.maven.project.MavenProjectHelper;
 public abstract class AbstractBundleListMojo extends AbstractMojo {
 
     /**
-     * @parameter expression="${configDirectory}"
-     *            default-value="src/main/config"
-     */
-    protected File configDirectory;
-
-    /**
-     * JAR Packaging type.
-     */
-    protected static final String JAR = "jar";
-
-    /**
-     * WAR Packaging type.
-     */
-    protected static final String WAR = "war";
-
-    /**
      * Partial Bundle List type
      */
     protected static final String PARTIAL = "partialbundlelist";
 
-    protected static boolean shouldCopy(File source, File dest) {
-        if (!dest.exists()) {
-            return true;
-        } else {
-            return source.lastModified() > dest.lastModified();
-        }
-    }
-
     /**
      * @parameter default-value="${basedir}/src/main/bundles/list.xml"
      */

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

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

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

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

commit 6cec043260204ef81fc856c91fb2cd354cf39b7c
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Feb 15 02:04:49 2011 +0000

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

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

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

[sling-maven-launchpad-plugin] 10/34: SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles

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

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

commit 79e6e415c4770ee5236bedbf5f88965a7c81003b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 7 09:43:25 2011 +0000

    SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1143730 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/maven/projectsupport/dependencies.properties       | 2 +-
 .../org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java   | 2 +-
 2 files changed, 2 insertions(+), 2 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 89b1c3c..d8102e3 100644
--- a/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties
+++ b/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties
@@ -17,4 +17,4 @@
 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,,5
+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 9eb4fe4..7d94f09 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
@@ -42,7 +42,7 @@ public class PreparePackageMojoTest {
 		        "org.apache.sling.launchpad", "RELEASE", "xml", "bundlelist", 0);
 
 		makeArtifactAssertions(mojo, "jarWebSupport", "org.apache.felix",
-				"org.apache.felix.http.jetty", "RELEASE", "jar", null, 5);
+				"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] 29/34: temporarily using snapshots during release vote

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

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

commit 179cc9b201b4388db10c828d912d044dfc23432a
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Aug 31 20:10:55 2011 +0000

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

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

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

[sling-maven-launchpad-plugin] 32/34: Prepare for release

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

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

commit 3b2fc202a81e4cf9547ca140621619602d6f908b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Sep 6 07:52:15 2011 +0000

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

diff --git a/pom.xml b/pom.xml
index 427d15e..62a347e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.sling</groupId>
         <artifactId>sling</artifactId>
-        <version>13-SNAPSHOT</version>
+        <version>11</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] 27/34: SLING-2182 : Provide a way to specify additional bootstrap commands

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

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

commit f1a9178e65ac2588c68cb3ff49c9828ca0145dc9
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Aug 29 07:09:23 2011 +0000

    SLING-2182 : Provide a way to specify additional bootstrap commands
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1162660 13f79535-47bb-0310-9956-ffa450edef68
---
 .../org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java   | 2 +-
 .../apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java  | 2 +-
 .../java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index 28d75cd..e248d2b 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -62,7 +62,7 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
 
     /**
      * @parameter expression="${commonSlingBootstrap}"
-     *            default-value="src/main/sling/bootstrap.txt"
+     *            default-value="src/main/sling/common.bootstrap.txt"
      */
     protected File commonSlingBootstrap;
 
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 9934ae2..e602d1c 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -40,7 +40,7 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
 
     public static final String SLING_COMMON_PROPS = "common.properties";
 
-    public static final String SLING_COMMON_BOOTSTRAP = "bootstrap.txt";
+    public static final String SLING_COMMON_BOOTSTRAP = "common.bootstrap.txt";
 
     /**
      * @parameter default-value="${project.build.directory}/bundleListconfig"
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 dee24c4..7506118 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -191,7 +191,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
      */
     private void patchSlingBootstrap(final File dest, final String additionalCmd)
     throws MojoExecutionException {
-        getLog().info("Patching sling.bootstrap.txt");
+        getLog().info("Patching sling_bootstrap.txt");
         final File origSlingCmd = new File(dest, "sling_bootstrap.txt");
         FileWriter writer = null;
 

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

[sling-maven-launchpad-plugin] 05/34: removing empty dir

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

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

commit 2cddbb6360af7ba6fa108abef09ea30d2e79da9f
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Jun 15 00:18:42 2011 +0000

    removing empty dir
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1135867 13f79535-47bb-0310-9956-ffa450edef68

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

[sling-maven-launchpad-plugin] 17/34: SLING-2134 : Provide a way to add additional properties to sling.properties

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

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

commit 13dad4c11dc29aa874a64ca5881b7c5d12ba37d3
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Jul 13 12:12:18 2011 +0000

    SLING-2134 : Provide a way to add additional properties to sling.properties
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1145965 13f79535-47bb-0310-9956-ffa450edef68
---
 .../AbstractUsingBundleListMojo.java               | 36 +++++++++++++++++++---
 .../maven/projectsupport/PreparePackageMojo.java   | 21 +++----------
 2 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index ec00009..a9af72a 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -37,6 +37,9 @@ import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.execution.MavenSession;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.shared.filtering.MavenFileFilter;
+import org.apache.maven.shared.filtering.MavenFilteringException;
+import org.apache.maven.shared.filtering.PropertyUtils;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
 import org.codehaus.plexus.util.StringUtils;
@@ -59,6 +62,12 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
     protected File configDirectory;
 
     /**
+     * @parameter expression="${additionalSlingProps}"
+     *            default-value="src/main/sling/additional.properties"
+     */
+    protected File additionalSlingProps;
+
+    /**
      * JAR Packaging type.
      */
     protected static final String JAR = "jar";
@@ -161,6 +170,11 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      */
     protected MavenSession mavenSession;
 
+    /**
+     * @component
+     */
+    private MavenFileFilter mavenFileFilter;
+
     public final void execute() throws MojoFailureException, MojoExecutionException {
         try {
             initBundleList();
@@ -371,11 +385,23 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         }
     }
 
-    protected File getSlingProperties() {
-        if ( this.configDirectory != null && this.configDirectory.exists() && this.configDirectory.isDirectory() ) {
-            final File slingProps = new File(this.configDirectory, "sling.properties");
-            if ( slingProps.exists() && slingProps.isFile() ) {
-                return slingProps;
+    protected Properties getSlingProperties() throws MojoExecutionException {
+        if (this.additionalSlingProps.exists()) {
+            File tmp = null;
+            try {
+                tmp = File.createTempFile("sling", "props");
+                mavenFileFilter.copyFile(this.additionalSlingProps, tmp, true, project, null, true,
+                        System.getProperty("file.encoding"), mavenSession);
+                final Properties loadedProps = PropertyUtils.loadPropertyFile(tmp, null);
+                return loadedProps;
+            } 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();
+                }
             }
         }
         return 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 1d8c989..b2554da 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -152,8 +152,8 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 				+ "." + artifact.getArtifactHandler().getExtension());
 
 		// check if custom sling.properties file exists
-		final File slingProps = this.getSlingProperties();
-		if ( slingProps != null ) {
+		final Properties additionalProps = this.getSlingProperties();
+		if ( additionalProps != null ) {
     		// unpack to a temp destination
 		    final File dest = new File(this.tempDirectory, "basejar");
 		    try {
@@ -177,27 +177,14 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
         		    }
         		}
 
-        		// read additional properties
-                final Properties addProps = new Properties();
-                try {
-                    fis = new FileInputStream(slingProps);
-                    addProps.load(fis);
-                } catch (final IOException ioe) {
-                    throw new MojoExecutionException("Unable to read " + slingProps, ioe);
-                } finally {
-                    if ( fis != null ) {
-                        try { fis.close(); } catch (final IOException ignore) {}
-                    }
-                }
-
                 // patch
-                final Enumeration<Object> keys = addProps.keys();
+                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, addProps.get(key));
+                    orig.put(key, additionalProps.get(key));
                 }
 
                 /// and save

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

[sling-maven-launchpad-plugin] 13/34: SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles

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

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

commit 0a616ceb1767944a25e72fae6eae2e547a893803
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 7 16:58:15 2011 +0000

    SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1143920 13f79535-47bb-0310-9956-ffa450edef68
---
 .../apache/sling/maven/projectsupport/bundlelist/BaseStartLevel.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
index e2f08a2..8e541d0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseStartLevel.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseStartLevel.java
@@ -82,7 +82,7 @@ public abstract class BaseStartLevel {
     }
 
     public String getLevel() {
-        return String.valueOf(this.startLevel);
+        return (this.startLevel == -1 ? BOOT_MARKER : String.valueOf(this.startLevel));
     }
 
     public int getStartLevel() {

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

[sling-maven-launchpad-plugin] 03/34: Temporarily upgrade to 1.0.1-SNAPSHOT of the launchpad API to not fail builds

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

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

commit d8dc15d8185b2b71a40820049f8c454fcb7d8771
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Tue Feb 15 11:20:34 2011 +0000

    Temporarily upgrade to 1.0.1-SNAPSHOT of the launchpad API to not fail builds
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1070843 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index e079074..9d26d2e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -138,7 +138,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.api</artifactId>
-            <version>1.0.0</version>
+            <version>1.0.1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>

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

[sling-maven-launchpad-plugin] 15/34: SLING-2134 : Provide a way to add additional properties to sling.properties

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

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

commit d72004a32a36bf5c85585e1586d92a33bcb631ba
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jul 11 12:56:45 2011 +0000

    SLING-2134 : Provide a way to add additional properties to sling.properties
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1145156 13f79535-47bb-0310-9956-ffa450edef68
---
 .../AbstractUsingBundleListMojo.java               |  17 ++-
 .../maven/projectsupport/PreparePackageMojo.java   | 135 ++++++++++++++++++---
 2 files changed, 134 insertions(+), 18 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 5420b42..ec00009 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -224,7 +224,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
             } catch (ArtifactMetadataRetrievalException e) {
                 throw new MojoExecutionException("Unable to find version for artifact", e);
             }
-            
+
         }
 
         try {
@@ -309,7 +309,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                 bundleList.remove(def.toBundle(), false);
             }
         }
-        
+
         Set<Artifact> dependencies = project.getDependencyArtifacts();
         for (Artifact artifact : dependencies) {
             if (PARTIAL.equals(artifact.getType())) {
@@ -319,8 +319,8 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                 bundleList.merge(readBundleList(artifact.getFile()));
             }
         }
-        
-        
+
+
         initBundleList(bundleList);
 
         rewriteBundleList(bundleList);
@@ -371,4 +371,13 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         }
     }
 
+    protected File getSlingProperties() {
+        if ( this.configDirectory != null && this.configDirectory.exists() && this.configDirectory.isDirectory() ) {
+            final File slingProps = new File(this.configDirectory, "sling.properties");
+            if ( slingProps.exists() && slingProps.isFile() ) {
+                return slingProps;
+            }
+        }
+        return 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 9f445f3..f0788bb 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -17,7 +17,10 @@
 package org.apache.sling.maven.projectsupport;
 
 import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.util.Enumeration;
 import java.util.Properties;
 
 import org.apache.maven.artifact.Artifact;
@@ -26,6 +29,7 @@ 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;
@@ -81,13 +85,28 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 	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;
 
-	public void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
+    /**
+     * The Jar archiver.
+     *
+     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
+     */
+    private JarArchiver jarArchiver;
+
+    public void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
 		copyBaseArtifact();
 		copyBundles(getBundleList(), getOutputDirectory());
 		copyConfigurationFiles();
@@ -131,20 +150,91 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 		File destinationFile = new File(destinationDir, artifact
 				.getArtifactId()
 				+ "." + artifact.getArtifactHandler().getExtension());
-		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);
-			}
+
+		// check if custom sling.properties file exists
+		final File slingProps = this.getSlingProperties();
+		if ( slingProps != null ) {
+    		// unpack to a temp destination
+		    final File dest = new File(this.tempDirectory, "basejar");
+		    try {
+        		unpack(artifact.getFile(), dest);
+        		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) {}
+        		    }
+        		}
+
+        		// read additional properties
+                final Properties addProps = new Properties();
+                try {
+                    fis = new FileInputStream(slingProps);
+                    addProps.load(fis);
+                } catch (final IOException ioe) {
+                    throw new MojoExecutionException("Unable to read " + slingProps, ioe);
+                } finally {
+                    if ( fis != null ) {
+                        try { fis.close(); } catch (final IOException ignore) {}
+                    }
+                }
+
+                // patch
+                final Enumeration<Object> keys = addProps.keys();
+                if ( keys.hasMoreElements() ) {
+                    getLog().info("Patching sling.properties");
+                }
+                while ( keys.hasMoreElements() ) {
+                    final Object key = keys.nextElement();
+                    orig.put(key, addProps.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) {}
+                    }
+                }
+
+                // and repack again
+        		pack(dest, destinationFile);
+		    } finally {
+		        this.tempDirectory.delete();
+		    }
 		} else {
-			getLog().debug(
-					String.format("Skipping copy of base artifact from %s.",
-							artifact.getFile()));
+		    // 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()));
+    		}
 		}
 	}
 
@@ -212,4 +302,21 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
             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);
+        }
+    }
 }

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

[sling-maven-launchpad-plugin] 11/34: SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles

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

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

commit 2d6b5a8466407a0bb9adbcdec0cf22a123da478d
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Jul 7 13:55:32 2011 +0000

    SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1143828 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 ea86646..401f69d 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
@@ -56,7 +56,7 @@ public abstract class AbstractLaunchpadFrameworkMojo extends AbstractUsingBundle
 
     protected String getPathForArtifact(final int startLevel, final String artifactName) {
         if ( startLevel == -1 && bootDirectory != null ) {
-            return String.format("%s/%s/%s", baseDestination, bootDirectory,
+            return String.format("%s/%s/1/%s", baseDestination, bootDirectory,
                     artifactName);
         }
         return String.format("%s/%s/%s/%s", baseDestination, bundlesDirectory,

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

[sling-maven-launchpad-plugin] 26/34: SLING-2134 : Provide a way to add additional properties to sling.properties SLING-2182 : Provide a way to specify additional bootstrap commands

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

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

commit dff04388d48ca80ecfe502549f7d229bcfcd4fb6
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Aug 29 07:03:45 2011 +0000

    SLING-2134 : Provide a way to add additional properties to sling.properties
    SLING-2182 : Provide a way to specify additional bootstrap commands
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1162656 13f79535-47bb-0310-9956-ffa450edef68
---
 .../maven/projectsupport/AbstractBundleListMojo.java     | 10 +++++-----
 .../projectsupport/AbstractUsingBundleListMojo.java      |  8 ++++----
 .../projectsupport/AttachPartialBundleListMojo.java      | 16 ++++++++--------
 3 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index 050c653..28d75cd 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -55,16 +55,16 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
     private File configDirectory;
 
     /**
-     * @parameter expression="${additionalSlingProps}"
-     *            default-value="src/main/sling/additional.properties"
+     * @parameter expression="${commonSlingProps}"
+     *            default-value="src/main/sling/common.properties"
      */
-    protected File additionalSlingProps;
+    protected File commonSlingProps;
 
     /**
-     * @parameter expression="${additionalSlingBootstrap}"
+     * @parameter expression="${commonSlingBootstrap}"
      *            default-value="src/main/sling/bootstrap.txt"
      */
-    protected File additionalSlingBootstrap;
+    protected File commonSlingBootstrap;
 
     protected File getConfigDirectory() {
         return this.configDirectory;
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 7eac40f..f058a34 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -380,8 +380,8 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                         zipUnarchiver.extract();
 
                         final File slingDir = new File(this.tmpOutputDir, "sling");
-                        this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_ADDITIONAL_PROPS));
-                        this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_BOOTSTRAP));
+                        this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_COMMON_PROPS));
+                        this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_COMMON_BOOTSTRAP));
 
                         // and now configurations
                         if ( this.overlayConfigDir == null ) {
@@ -488,7 +488,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
     }
 
     protected Properties getSlingProperties() throws MojoExecutionException {
-        readSlingProperties(this.additionalSlingProps);
+        readSlingProperties(this.commonSlingProps);
         return this.slingProperties;
     }
 
@@ -541,7 +541,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      * @throws MojoExecutionException
      */
     protected String getSlingBootstrap() throws MojoExecutionException {
-        this.readSlingBootstrap(this.additionalSlingBootstrap);
+        this.readSlingBootstrap(this.commonSlingBootstrap);
 
         return this.slingBootstrapCommand;
     }
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 a890ec1..9934ae2 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -38,9 +38,9 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
 
     public static final String CONFIG_TYPE = "zip";
 
-    public static final String SLING_ADDITIONAL_PROPS = "additional.properties";
+    public static final String SLING_COMMON_PROPS = "common.properties";
 
-    public static final String SLING_BOOTSTRAP = "bootstrap.txt";
+    public static final String SLING_COMMON_BOOTSTRAP = "bootstrap.txt";
 
     /**
      * @parameter default-value="${project.build.directory}/bundleListconfig"
@@ -82,8 +82,8 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
         }
         // check if we have configurations
         boolean hasConfigs = this.checkFile(this.getConfigDirectory());
-        hasConfigs |= this.checkFile(this.additionalSlingBootstrap);
-        hasConfigs |= this.checkFile(this.additionalSlingProps);
+        hasConfigs |= this.checkFile(this.commonSlingBootstrap);
+        hasConfigs |= this.checkFile(this.commonSlingProps);
 
         if ( !hasConfigs ) {
             this.getLog().debug("No configurations to attach.");
@@ -91,15 +91,15 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
         }
         // copy configuration, as this project might use different names we have to copy everything!
         this.configOutputDir.mkdirs();
-        if ( this.checkFile(this.additionalSlingBootstrap) ) {
+        if ( this.checkFile(this.commonSlingBootstrap) ) {
             final File slingDir = new File(this.configOutputDir, "sling");
             slingDir.mkdirs();
-            FileUtils.copyFile(this.additionalSlingBootstrap, new File(slingDir, SLING_BOOTSTRAP));
+            FileUtils.copyFile(this.commonSlingBootstrap, new File(slingDir, SLING_COMMON_BOOTSTRAP));
         }
-        if ( this.checkFile(this.additionalSlingProps) ) {
+        if ( this.checkFile(this.commonSlingProps) ) {
             final File slingDir = new File(this.configOutputDir, "sling");
             slingDir.mkdirs();
-            FileUtils.copyFile(this.additionalSlingProps, new File(slingDir, SLING_ADDITIONAL_PROPS));
+            FileUtils.copyFile(this.commonSlingProps, new File(slingDir, SLING_COMMON_PROPS));
         }
         if ( this.checkFile(this.getConfigDirectory()) ) {
             final File configDir = new File(this.configOutputDir, "config");

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

[sling-maven-launchpad-plugin] 18/34: SLING-2150 : Update plugins to use the latest available versions

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

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

commit 98a09a71210c289d15079e949a667c69cb041311
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Jul 20 12:21:40 2011 +0000

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

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

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

[sling-maven-launchpad-plugin] 07/34: Code cleanup - remove unused stuff.

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

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

commit f23f3d6b6ada35da2bb1e28875bd2298304f8f62
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jul 4 06:54:47 2011 +0000

    Code  cleanup - remove unused stuff.
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1142568 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/AbstractBundleListMojo.java     |  4 ---
 .../AbstractLaunchpadStartingMojo.java             | 10 +++---
 .../projectsupport/DisplayBundleUpdatesMojo.java   | 42 +++++++---------------
 .../projectsupport/bundlelist/BaseBundleList.java  |  2 +-
 4 files changed, 17 insertions(+), 41 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index 1818ff6..2810c41 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -45,10 +45,6 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
      */
     protected static final String PARTIAL = "partialbundlelist";
 
-    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;
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 6835161..d1abf68 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -5,9 +5,9 @@
  * licenses this file to You under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -16,12 +16,10 @@
  */
 package org.apache.sling.maven.projectsupport;
 
-import static org.apache.felix.framework.util.FelixConstants.*;
+import static org.apache.felix.framework.util.FelixConstants.LOG_LEVEL_PROP;
 
 import java.io.File;
 import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.MalformedURLException;
@@ -83,7 +81,7 @@ 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
      */
     private ArtifactDefinition jarWebSupport;
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 aa34a78..2b9868f 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.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
@@ -35,7 +35,6 @@ 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.MavenProjectBuilder;
 import org.apache.maven.project.path.PathTranslator;
 import org.apache.maven.settings.Settings;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
@@ -52,10 +51,10 @@ 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 {
 
@@ -70,25 +69,8 @@ public class DisplayBundleUpdatesMojo extends AbstractMojo {
     private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory;
 
     /**
-     * @component
-     */
-    private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
-
-    /**
-     * @component
-     */
-    private MavenProjectBuilder projectBuilder;
-
-    /**
-     * @parameter expression="${reactorProjects}"
-     * @required
-     * @readonly
-     */
-    private List reactorProjects;
-
-    /**
      * The artifact metadata source to use.
-     * 
+     *
      * @component
      * @required
      * @readonly
@@ -127,7 +109,7 @@ public class DisplayBundleUpdatesMojo extends AbstractMojo {
     /**
      * 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";
      */
@@ -136,14 +118,14 @@ public class DisplayBundleUpdatesMojo extends AbstractMojo {
     /**
      * 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
@@ -163,7 +145,7 @@ public class DisplayBundleUpdatesMojo extends AbstractMojo {
     /**
      * Whether to allow snapshots when searching for the latest version of an
      * artifact.
-     * 
+     *
      * @parameter expression="${allowSnapshots}" default-value="false"
      */
     private boolean allowSnapshots;
@@ -177,9 +159,9 @@ public class DisplayBundleUpdatesMojo extends AbstractMojo {
     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));
@@ -200,7 +182,7 @@ public class DisplayBundleUpdatesMojo extends AbstractMojo {
         dep.setClassifier(bundle.getClassifier());
         dep.setVersion(bundle.getVersion());
         dep.setType(bundle.getType());
-        
+
         return dep;
     }
 
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 5bfc19f..2079203 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
@@ -48,7 +48,7 @@ public abstract class BaseBundleList {
 
     /**
      * Merge the current bundle list with an additional list.
-     * @see add(Bundle)
+     * @see #add(Bundle)
      *
      * @param bundleList the new bundle list
      */

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

[sling-maven-launchpad-plugin] 04/34: SLING-1988 - removing errant files

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

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

commit 8c8408967def479f0459b8b0788f3baebfe35102
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Jun 15 00:18:14 2011 +0000

    SLING-1988 - removing errant files
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1135866 13f79535-47bb-0310-9956-ffa450edef68
---
 src/main/resources/META-INF/LICENSE | 202 ------------------------------------
 src/main/resources/META-INF/NOTICE  |  26 -----
 2 files changed, 228 deletions(-)

diff --git a/src/main/resources/META-INF/LICENSE b/src/main/resources/META-INF/LICENSE
deleted file mode 100644
index d645695..0000000
--- a/src/main/resources/META-INF/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed 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.
diff --git a/src/main/resources/META-INF/NOTICE b/src/main/resources/META-INF/NOTICE
deleted file mode 100644
index 7dbe7cb..0000000
--- a/src/main/resources/META-INF/NOTICE
+++ /dev/null
@@ -1,26 +0,0 @@
-Apache Sling Launchpad Maven Plugin
-Copyright 2008-2010 The Apache Software Foundation
-
-Apache Sling is based on source code originally developed 
-by Day Software (http://www.day.com/).
-
-
-I. Included Software
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-Licensed under the Apache License 2.0.
-
-
-II. Used Software
-
-This product uses software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright 2006 The OSGi Alliance.
-Licensed under the Apache License 2.0.
-
-
-III. License Summary
-- Apache License 2.0
-
-

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

[sling-maven-launchpad-plugin] 02/34: using snapshots during vote

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

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

commit c80a1cc6d5d006fd78bf413c1baee21fe430f717
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Feb 15 02:27:51 2011 +0000

    using snapshots during vote
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1070763 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pom.xml b/pom.xml
index 25d6ec6..e079074 100644
--- a/pom.xml
+++ b/pom.xml
@@ -143,12 +143,12 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.base</artifactId>
-            <version>2.3.0</version>
+            <version>2.3.1-SNAPSHOT</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.base</artifactId>
-            <version>2.3.0</version>
+            <version>2.3.1-SNAPSHOT</version>
             <classifier>app</classifier>
         </dependency>
         <dependency>

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

[sling-maven-launchpad-plugin] 25/34: Using released versions

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

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

commit 0f6d05c94184167f8c17fd3b39a22aff99418b8f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Aug 23 06:58:46 2011 +0000

    Using released versions
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1160566 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3cc8535..62a347e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -138,17 +138,17 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.api</artifactId>
-            <version>1.0.1-SNAPSHOT</version>
+            <version>1.0.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.base</artifactId>
-            <version>2.3.1-SNAPSHOT</version>
+            <version>2.3.0</version>
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.launchpad.base</artifactId>
-            <version>2.3.1-SNAPSHOT</version>
+            <version>2.3.0</version>
             <classifier>app</classifier>
         </dependency>
         <dependency>
@@ -159,7 +159,7 @@
         <dependency>
             <groupId>org.apache.maven.shared</groupId>
             <artifactId>maven-filtering</artifactId>
-            <version>1.0-beta-4</version>
+            <version>1.0</version>
         </dependency>
         <dependency>
             <groupId>org.drools</groupId>

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

[sling-maven-launchpad-plugin] 30/34: SLING-2207 : Support different properties and bootstrap commands for standalone and webapp

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

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

commit 02a8aea9e2d2e5fe735e9061d5089c7091512dff
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Sep 5 15:31:41 2011 +0000

    SLING-2207 : Support different properties and bootstrap commands for standalone and webapp
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1165337 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/AbstractBundleListMojo.java     |  24 +++++
 .../AbstractUsingBundleListMojo.java               | 105 ++++++++++++++++-----
 .../AttachPartialBundleListMojo.java               |  33 +++++++
 .../maven/projectsupport/PreparePackageMojo.java   |   4 +-
 4 files changed, 143 insertions(+), 23 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index e248d2b..912fa3d 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -66,6 +66,30 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
      */
     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;
+
     protected File getConfigDirectory() {
         return this.configDirectory;
     }
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 f058a34..34270d5 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -177,8 +177,16 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
 
     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"
      */
@@ -380,8 +388,12 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                         zipUnarchiver.extract();
 
                         final File slingDir = new File(this.tmpOutputDir, "sling");
-                        this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_COMMON_PROPS));
-                        this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_COMMON_BOOTSTRAP));
+                        this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_COMMON_PROPS), 0);
+                        this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_WEBAPP_PROPS), 1);
+                        this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_STANDALONE_PROPS), 2);
+                        this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_COMMON_BOOTSTRAP), 0);
+                        this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_WEBAPP_BOOTSTRAP), 1);
+                        this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_STANDALONE_BOOTSTRAP), 2);
 
                         // and now configurations
                         if ( this.overlayConfigDir == null ) {
@@ -458,7 +470,15 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         }
     }
 
-    private void readSlingProperties(final File propsFile) throws MojoExecutionException {
+    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 {
@@ -466,13 +486,23 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                 mavenFileFilter.copyFile(propsFile, tmp, true, project, null, true,
                         System.getProperty("file.encoding"), mavenSession);
                 final Properties loadedProps = PropertyUtils.loadPropertyFile(tmp, null);
-                if ( this.slingProperties == null ) {
-                    this.slingProperties = loadedProps;
+                if ( mode == 0 ) {
+                    if ( this.slingProperties == null ) {
+                        this.slingProperties = loadedProps;
+                    } else {
+                        this.copyProperties(loadedProps, this.slingProperties);
+                    }
+                } else if ( mode == 1 ) {
+                    if ( this.slingWebappProperties == null ) {
+                        this.slingWebappProperties = loadedProps;
+                    } else {
+                        this.copyProperties(loadedProps, this.slingWebappProperties);
+                    }
                 } else {
-                    final Enumeration<Object> keys = loadedProps.keys();
-                    while ( keys.hasMoreElements() ) {
-                        final Object key = keys.nextElement();
-                        this.slingProperties.put(key, loadedProps.get(key));
+                    if ( this.slingStandaloneProperties == null ) {
+                        this.slingStandaloneProperties = loadedProps;
+                    } else {
+                        this.copyProperties(loadedProps, this.slingStandaloneProperties);
                     }
                 }
             } catch (IOException e) {
@@ -487,8 +517,18 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         }
     }
 
-    protected Properties getSlingProperties() throws MojoExecutionException {
-        readSlingProperties(this.commonSlingProps);
+    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;
     }
 
@@ -497,7 +537,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      * The filter is copied to a tmp location to apply filtering.
      * @throws MojoExecutionException
      */
-    private void readSlingBootstrap(final File bootstrapFile) throws MojoExecutionException {
+    private void readSlingBootstrap(final File bootstrapFile, final int mode) throws MojoExecutionException {
         if (bootstrapFile.exists()) {
             File tmp = null;
             Reader reader = null;
@@ -507,19 +547,34 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                         System.getProperty("file.encoding"), mavenSession);
                 reader = new FileReader(tmp);
                 final StringBuilder sb = new StringBuilder();
-                if ( this.slingBootstrapCommand != null ) {
-                    sb.append(this.slingBootstrapCommand);
+                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);
                 }
-
-                this.slingBootstrapCommand = sb.toString();
-            } catch (IOException e) {
+                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 (MavenFilteringException e) {
+            } catch (final MavenFilteringException e) {
                 throw new MojoExecutionException("Unable to create filtered bootstrap file", e);
             } finally {
                 if (tmp != null) {
@@ -540,9 +595,17 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      * @return The contents are <code>null</code>
      * @throws MojoExecutionException
      */
-    protected String getSlingBootstrap() throws MojoExecutionException {
-        this.readSlingBootstrap(this.commonSlingBootstrap);
-
+    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(addCmds);
+            return builder.toString();
+        }
         return this.slingBootstrapCommand;
     }
 }
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 e602d1c..40f5732 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -42,6 +42,14 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
 
     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"
      */
@@ -75,6 +83,7 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
     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.");
@@ -84,6 +93,10 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
         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.");
@@ -101,6 +114,26 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
             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();
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 7506118..abc2f03 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -222,8 +222,8 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 				+ "." + artifact.getArtifactHandler().getExtension());
 
 		// check if custom sling.properties file or bootstrap command exists
-		final Properties additionalProps = this.getSlingProperties();
-		final String bootstrapCmd = this.getSlingBootstrap();
+		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");

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

[sling-maven-launchpad-plugin] 24/34: SLING-2183 : Bundle configurations and sling files with bundlelist

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

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

commit 97dac9a60146fd01b6bf0d67d693d14d76a05277
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Aug 18 13:35:36 2011 +0000

    SLING-2183 : Bundle configurations and sling files with bundlelist
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1159213 13f79535-47bb-0310-9956-ffa450edef68
---
 .../projectsupport/AbstractBundleListMojo.java     |  21 +++
 .../AbstractLaunchpadStartingMojo.java             |   6 +-
 .../AbstractUsingBundleListMojo.java               | 153 ++++++++++++++++-----
 .../AttachPartialBundleListMojo.java               |  88 +++++++++++-
 .../maven/projectsupport/PreparePackageMojo.java   |   2 +-
 5 files changed, 232 insertions(+), 38 deletions(-)

diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index 6ec799a..050c653 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -48,4 +48,25 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
      */
     protected MavenProjectHelper projectHelper;
 
+    /**
+     * @parameter expression="${configDirectory}"
+     *            default-value="src/main/config"
+     */
+    private File configDirectory;
+
+    /**
+     * @parameter expression="${additionalSlingProps}"
+     *            default-value="src/main/sling/additional.properties"
+     */
+    protected File additionalSlingProps;
+
+    /**
+     * @parameter expression="${additionalSlingBootstrap}"
+     *            default-value="src/main/sling/bootstrap.txt"
+     */
+    protected File additionalSlingBootstrap;
+
+    protected File getConfigDirectory() {
+        return this.configDirectory;
+    }
 }
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 3904aed..9da0201 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -135,8 +135,8 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
                 List<String> empty = Collections.emptyList();
                 return empty.iterator();
             } else if (path.equals(CONFIG_PATH_PREFIX)) {
-                if (configDirectory.exists() && configDirectory.isDirectory()) {
-                    File[] configFiles = configDirectory.listFiles(new FileFilter() {
+                if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
+                    File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
 
                         public boolean accept(File file) {
                             return file.isFile();
@@ -188,7 +188,7 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
 
         public URL getResource(String path) {
             if (path.startsWith(CONFIG_PATH_PREFIX)) {
-                File configFile = new File(configDirectory, path.substring(CONFIG_PATH_PREFIX.length() + 1));
+                File configFile = new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
                 if (configFile.exists()) {
                     try {
                         return configFile.toURI().toURL();
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 be08450..7eac40f 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -21,6 +21,7 @@ import java.io.FileInputStream;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.Reader;
+import java.util.Enumeration;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
@@ -44,6 +45,9 @@ import org.apache.maven.shared.filtering.MavenFilteringException;
 import org.apache.maven.shared.filtering.PropertyUtils;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
 import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
+import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
+import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.drools.KnowledgeBase;
@@ -58,24 +62,6 @@ import org.drools.runtime.StatefulKnowledgeSession;
 public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo {
 
     /**
-     * @parameter expression="${configDirectory}"
-     *            default-value="src/main/config"
-     */
-    protected File configDirectory;
-
-    /**
-     * @parameter expression="${additionalSlingProps}"
-     *            default-value="src/main/sling/additional.properties"
-     */
-    private File additionalSlingProps;
-
-    /**
-     * @parameter expression="${additionalSlingBootstrap}"
-     *            default-value="src/main/sling/bootstrap.txt"
-     */
-    private File additionalSlingBootstrap;
-
-    /**
      * JAR Packaging type.
      */
     protected static final String JAR = "jar";
@@ -182,6 +168,29 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
      */
     private MavenFileFilter mavenFileFilter;
 
+    /**
+     * The zip unarchiver.
+     *
+     * @component role="org.codehaus.plexus.archiver.UnArchiver" roleHint="zip"
+     */
+    private ZipUnArchiver zipUnarchiver;
+
+    private Properties slingProperties;
+
+    private String slingBootstrapCommand;
+
+    /**
+     * @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();
@@ -194,6 +203,14 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
 
     }
 
+    @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.
@@ -331,13 +348,62 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
             }
         }
 
-        Set<Artifact> dependencies = project.getDependencyArtifacts();
+        final Set<Artifact> dependencies = project.getDependencyArtifacts();
         for (Artifact artifact : dependencies) {
             if (PARTIAL.equals(artifact.getType())) {
                 getLog().info(
                         String.format("merging partial bundle list for %s:%s:%s", artifact.getGroupId(),
                                 artifact.getArtifactId(), artifact.getVersion()));
                 bundleList.merge(readBundleList(artifact.getFile()));
+
+                // check for configuration artifact
+                Artifact cfgArtifact = null;
+                try {
+                    cfgArtifact = getArtifact(artifact.getGroupId(),
+                            artifact.getArtifactId(),
+                            artifact.getVersion(),
+                            AttachPartialBundleListMojo.CONFIG_TYPE,
+                            AttachPartialBundleListMojo.CONFIG_CLASSIFIER);
+                } catch (final MojoExecutionException ignore) {
+                    // we just ignore this
+                }
+                if ( cfgArtifact != null ) {
+                    getLog().info(
+                            String.format("merging partial bundle list configuration for %s:%s:%s", cfgArtifact.getGroupId(),
+                                    cfgArtifact.getArtifactId(), cfgArtifact.getVersion()));
+
+                    // extract
+                    zipUnarchiver.setSourceFile(cfgArtifact.getFile());
+                    try {
+                        this.tmpOutputDir.mkdirs();
+                        zipUnarchiver.setDestDirectory(this.tmpOutputDir);
+                        zipUnarchiver.extract();
+
+                        final File slingDir = new File(this.tmpOutputDir, "sling");
+                        this.readSlingProperties(new File(slingDir, AttachPartialBundleListMojo.SLING_ADDITIONAL_PROPS));
+                        this.readSlingBootstrap(new File(slingDir, AttachPartialBundleListMojo.SLING_BOOTSTRAP));
+
+                        // and now configurations
+                        if ( this.overlayConfigDir == null ) {
+                            this.tempConfigDir.mkdirs();
+                            if ( this.getConfigDirectory().exists() ) {
+                                FileUtils.copyDirectory(this.getConfigDirectory(), this.tempConfigDir,
+                                        null, FileUtils.getDefaultExcludesAsString());
+                            }
+                            this.overlayConfigDir = this.tempConfigDir;
+                        }
+                        final File configDir = new File(this.tmpOutputDir, "config");
+                        if ( configDir.exists() ) {
+                            FileUtils.copyDirectory(configDir, this.tempConfigDir,
+                                    null, FileUtils.getDefaultExcludesAsString());
+                        }
+                    } catch (final ArchiverException ae) {
+                        throw new MojoExecutionException("Unable to extract configuration archive.",ae);
+                    } finally {
+                        // and delete at the end
+                        FileUtils.deleteDirectory(this.tmpOutputDir);
+                    }
+                }
             }
         }
 
@@ -392,15 +458,23 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
         }
     }
 
-    protected Properties getSlingProperties() throws MojoExecutionException {
-        if (this.additionalSlingProps.exists()) {
+    private void readSlingProperties(final File propsFile) throws MojoExecutionException {
+        if (propsFile.exists()) {
             File tmp = null;
             try {
                 tmp = File.createTempFile("sling", "props");
-                mavenFileFilter.copyFile(this.additionalSlingProps, tmp, true, project, null, true,
+                mavenFileFilter.copyFile(propsFile, tmp, true, project, null, true,
                         System.getProperty("file.encoding"), mavenSession);
                 final Properties loadedProps = PropertyUtils.loadPropertyFile(tmp, null);
-                return loadedProps;
+                if ( this.slingProperties == null ) {
+                    this.slingProperties = loadedProps;
+                } else {
+                    final Enumeration<Object> keys = loadedProps.keys();
+                    while ( keys.hasMoreElements() ) {
+                        final Object key = keys.nextElement();
+                        this.slingProperties.put(key, loadedProps.get(key));
+                    }
+                }
             } catch (IOException e) {
                 throw new MojoExecutionException("Unable to create filtered properties file", e);
             } catch (MavenFilteringException e) {
@@ -411,32 +485,38 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                 }
             }
         }
-        return null;
+    }
+
+    protected Properties getSlingProperties() throws MojoExecutionException {
+        readSlingProperties(this.additionalSlingProps);
+        return this.slingProperties;
     }
 
     /**
-     * Try to read the bootstrap command file and return its content
+     * Try to read the bootstrap command file
      * The filter is copied to a tmp location to apply filtering.
-     * @return The contents are <code>null</code>
      * @throws MojoExecutionException
      */
-    protected String getSlingBootstrap() throws MojoExecutionException {
-        if (this.additionalSlingBootstrap.exists()) {
+    private void readSlingBootstrap(final File bootstrapFile) throws MojoExecutionException {
+        if (bootstrapFile.exists()) {
             File tmp = null;
             Reader reader = null;
             try {
                 tmp = File.createTempFile("sling", "bootstrap");
-                mavenFileFilter.copyFile(this.additionalSlingBootstrap, tmp, true, project, null, true,
+                mavenFileFilter.copyFile(bootstrapFile, tmp, true, project, null, true,
                         System.getProperty("file.encoding"), mavenSession);
                 reader = new FileReader(tmp);
                 final StringBuilder sb = new StringBuilder();
+                if ( this.slingBootstrapCommand != null ) {
+                    sb.append(this.slingBootstrapCommand);
+                }
                 final char[] buffer = new char[2048];
                 int l;
                 while ( (l = reader.read(buffer, 0, buffer.length) ) != -1 ) {
                     sb.append(buffer, 0, l);
                 }
 
-                return sb.toString();
+                this.slingBootstrapCommand = sb.toString();
             } catch (IOException e) {
                 throw new MojoExecutionException("Unable to create filtered bootstrap file", e);
             } catch (MavenFilteringException e) {
@@ -452,6 +532,17 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
                 }
             }
         }
-        return null;
+    }
+
+    /**
+     * 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() throws MojoExecutionException {
+        this.readSlingBootstrap(this.additionalSlingBootstrap);
+
+        return this.slingBootstrapCommand;
     }
 }
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 79b1cc0..a890ec1 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -5,9 +5,9 @@
  * licenses this file to You under the Apache License, Version 2.0 (the
  * "License"); you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  * http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -16,20 +16,102 @@
  */
 package org.apache.sling.maven.projectsupport;
 
+import java.io.File;
+import java.io.IOException;
+
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
+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-partial-bundle-list
  * @phase package
  * @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 SLING_ADDITIONAL_PROPS = "additional.properties";
+
+    public static final String SLING_BOOTSTRAP = "bootstrap.txt";
+
+    /**
+     * @parameter default-value="${project.build.directory}/bundleListconfig"
+     */
+    private File configOutputDir;
+
+    /**
+     * @parameter expression="${ignoreBundleListConfig}"
+     *            default-value="false"
+     */
+    private boolean ignoreBundleListConfig;
+
+    /**
+     * The zip archiver.
+     *
+     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="zip"
+     */
+    private ZipArchiver zipArchiver;
+
     public void execute() throws MojoExecutionException, MojoFailureException {
         project.getArtifact().setFile(bundleListFile);
+        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.additionalSlingBootstrap);
+        hasConfigs |= this.checkFile(this.additionalSlingProps);
+
+        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.additionalSlingBootstrap) ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            FileUtils.copyFile(this.additionalSlingBootstrap, new File(slingDir, SLING_BOOTSTRAP));
+        }
+        if ( this.checkFile(this.additionalSlingProps) ) {
+            final File slingDir = new File(this.configOutputDir, "sling");
+            slingDir.mkdirs();
+            FileUtils.copyFile(this.additionalSlingProps, new File(slingDir, SLING_ADDITIONAL_PROPS));
+        }
+        if ( this.checkFile(this.getConfigDirectory()) ) {
+            final File configDir = new File(this.configOutputDir, "config");
+            configDir.mkdirs();
+            FileUtils.copyDirectory(this.getConfigDirectory(), configDir,
+                    null, FileUtils.getDefaultExcludesAsString());
+        }
+        final File destFile = new File(this.configOutputDir.getParent(), this.configOutputDir.getName() + ".zip");
+        zipArchiver.setDestFile(destFile);
+        zipArchiver.addDirectory(this.configOutputDir);
+        zipArchiver.createArchive();
 
+        projectHelper.attachArtifact(project, CONFIG_TYPE, CONFIG_CLASSIFIER, destFile);
+    }
 }
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 67d83c0..dee24c4 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -303,7 +303,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
 
     private void copyConfigurationFiles() throws MojoExecutionException {
         try {
-            FileUtils.copyDirectory(configDirectory, new File(getOutputDirectory(), CONFIG_PATH_PREFIX), null, FileUtils.getDefaultExcludesAsString());
+            FileUtils.copyDirectory(this.getConfigDirectory(), new File(getOutputDirectory(), CONFIG_PATH_PREFIX), null, FileUtils.getDefaultExcludesAsString());
         } catch (IOException e) {
             throw new MojoExecutionException("Unable to copy configuration files", e);
         }

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

[sling-maven-launchpad-plugin] 33/34: [maven-release-plugin] prepare release maven-launchpad-plugin-2.1.0

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

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

commit 33253620f496168aeef2878bb4eb47b1c83644ad
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Sep 6 07:53:08 2011 +0000

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

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

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

[sling-maven-launchpad-plugin] 21/34: Using latest released parent pom

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

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

commit 917e09417396ca6d69e05500da894b9bf6110340
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Aug 8 11:31:38 2011 +0000

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

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

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

[sling-maven-launchpad-plugin] 20/34: Update to recent snapshot

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

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

commit 893c07add520a73d247470ea78bca4f9b9925174
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Aug 3 09:09:44 2011 +0000

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

diff --git a/pom.xml b/pom.xml
index bd4e35b..9f07b1c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
 
     <groupId>org.apache.sling</groupId>
     <artifactId>maven-launchpad-plugin</artifactId>
-    <version>2.0.12-SNAPSHOT</version>
+    <version>2.0.11-SNAPSHOT</version>
     <packaging>maven-plugin</packaging>
 
     <name>Apache Sling Launchpad Maven Plugin</name>

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

[sling-maven-launchpad-plugin] 09/34: SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles

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

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

commit 67eb31614ee6e29be702327d9ca16d65c8ccaad7
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Jul 4 08:54:14 2011 +0000

    SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1142589 13f79535-47bb-0310-9956-ffa450edef68
---
 .../AbstractLaunchpadFrameworkMojo.java            | 24 ++++++++++++++---
 .../AbstractLaunchpadStartingMojo.java             |  2 +-
 .../maven/projectsupport/CreateBundleJarMojo.java  |  6 ++---
 .../projectsupport/bundlelist/BaseBundleList.java  |  6 ++---
 .../projectsupport/bundlelist/BaseStartLevel.java  | 31 ++++++++++++++++++++++
 src/main/mdo/bundle-list.xml                       |  4 +--
 6 files changed, 59 insertions(+), 14 deletions(-)

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 4697899..ea86646 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
@@ -45,12 +45,29 @@ public abstract class AbstractLaunchpadFrameworkMojo extends AbstractUsingBundle
      *
      * @parameter default-value="bundles"
      */
-    protected String bundlesDirectory;
+    private String bundlesDirectory;
+
+    /**
+     * The directory which contains the bootstraop bundle directories.
+     *
+     * @parameter
+     */
+    private String bootDirectory;
+
+    protected String getPathForArtifact(final int startLevel, final String artifactName) {
+        if ( startLevel == -1 && bootDirectory != null ) {
+            return String.format("%s/%s/%s", baseDestination, bootDirectory,
+                    artifactName);
+        }
+        return String.format("%s/%s/%s/%s", baseDestination, bundlesDirectory,
+                (startLevel == -1 ? 1 : startLevel),
+                artifactName);
+    }
 
     protected void copyBundles(BundleList bundles, File outputDirectory) throws MojoExecutionException {
         for (StartLevel startLevel : bundles.getStartLevels()) {
             for (Bundle bundle : startLevel.getBundles()) {
-                copy(new ArtifactDefinition(bundle, startLevel.getLevel()), outputDirectory);
+                copy(new ArtifactDefinition(bundle, startLevel.getStartLevel()), outputDirectory);
             }
         }
     }
@@ -61,8 +78,7 @@ public abstract class AbstractLaunchpadFrameworkMojo extends AbstractUsingBundle
     }
 
     protected void copy(File file, int startLevel, File outputDirectory) throws MojoExecutionException {
-        File destination = new File(outputDirectory, String.format("%s/%s/%s/%s", baseDestination, bundlesDirectory,
-                startLevel, file.getName()));
+        File destination = new File(outputDirectory, getPathForArtifact(startLevel, file.getName().replace('/', File.separatorChar)));
         if (shouldCopy(file, destination)) {
             getLog().info(String.format("Copying bundle from %s to %s", file.getPath(), destination.getPath()));
             try {
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 d1abf68..bc5cf72 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -155,7 +155,7 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
                     int i = Integer.parseInt(startLevel);
                     List<String> bundles = new ArrayList<String>();
                     for (StartLevel level : getBundleList().getStartLevels()) {
-                        if (level.getLevel() == i) {
+                        if (level.getStartLevel() == i) {
                             for (Bundle bundle : level.getBundles()) {
                                 ArtifactDefinition d = new ArtifactDefinition(bundle, i);
                                 try {
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 01802db..b1b22b0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
@@ -80,10 +80,8 @@ public class CreateBundleJarMojo extends AbstractLaunchpadFrameworkMojo {
 		for (StartLevel level : bundles.getStartLevels()) {
 			for (Bundle bundle : level.getBundles()) {
 				Artifact artifact = getArtifact(new ArtifactDefinition(bundle,
-						level.getLevel()));
-				String destFileName = baseDestination + "/" + bundlesDirectory
-						+ "/" + level.getLevel() + "/"
-						+ artifact.getFile().getName();
+						level.getStartLevel()));
+				final String destFileName = getPathForArtifact(level.getStartLevel(), artifact.getFile().getName());
 				try {
 					jarArchiver.addFile(artifact.getFile(), destFileName);
 				} catch (ArchiverException e) {
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 2079203..70050e3 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
@@ -84,7 +84,7 @@ public abstract class BaseBundleList {
             if ( mergeStartLevel == null || newBnd.getStartLevel() > 0) {
                 startLevel = getOrCreateStartLevel(newBnd.getStartLevel());
             } else {
-                startLevel = getOrCreateStartLevel(mergeStartLevel.getLevel());
+                startLevel = getOrCreateStartLevel(mergeStartLevel.getStartLevel());
             }
             startLevel.getBundles().add(newBnd);
         }
@@ -93,14 +93,14 @@ public abstract class BaseBundleList {
 
     private StartLevel getOrCreateStartLevel(int startLevel) {
         for (StartLevel sl : getStartLevels()) {
-            if (sl.getLevel() == startLevel) {
+            if (sl.getStartLevel() == startLevel) {
                 return sl;
             }
         }
 
         StartLevel sl = new StartLevel();
         getStartLevels().add(sl);
-        sl.setLevel(startLevel);
+        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
index b7e5923..e2f08a2 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseStartLevel.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseStartLevel.java
@@ -23,8 +23,12 @@ 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)) {
@@ -57,4 +61,31 @@ public abstract class BaseStartLevel {
                 && 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 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
index 8c078b2..dbe123a 100644
--- a/src/main/mdo/bundle-list.xml
+++ b/src/main/mdo/bundle-list.xml
@@ -52,10 +52,10 @@
             <version>1.0.0</version>
             <superClass>org.apache.sling.maven.projectsupport.bundlelist.BaseStartLevel</superClass>
             <fields>
-            	<field xml.attribute="true">
+            	<field xml.attribute="true" java.setter="false" java.getter="false">
             		<name>level</name>
             		<version>1.0.0</version>
-            		<type>int</type>
+            		<type>String</type>
             	</field>
                 <field>
                     <name>bundles</name>

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