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:17:25 UTC
[sling-maven-launchpad-plugin] annotated tag
maven-launchpad-plugin-2.3.4 created (now cbf062c)
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a change to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git.
at cbf062c (tag)
tagging e9df49c49fc099c0d01b2a5067cb4ef5b425caa2 (commit)
by Robert Munteanu
on Wed Oct 21 11:39:55 2015 +0000
- Log -----------------------------------------------------------------
maven-launchpad-plugin-2.3.4
-----------------------------------------------------------------------
This annotated tag includes the following new commits:
new 96dc6d5 Introducing the maven-launchpad-plugin and builder (fka uber) project described in SLING-1197
new ff6a77c SLING-1310 - Changing artifactId of launchpad.builder to launchpad
new 1f5bd24 SLING-1322 - adding check to avoid loading launchpad artifact if it's the same as the current project's
new 347e5fb SLING-1322 - removing extraneous project variable
new b8899de SLING-1323 - adding "bundlesToRemove" option
new 5682b2d Unifying bundle addition / removal code (re: SLING-1321)
new bb29c9b SLING-1351 Fixed, added the Start levels in when there are none defined.
new 8ffdfb1 SLING-1364 - creating prepare-test-webapp mojo
new d2e7962 SLING-1351 When the xpp parser loads a Bundle it only sets the attributes specified on the bundle, and takes no account of any containers, hence on merge the container start level must be inspected to determine where a bundle should be merged. If not specified (ie 0) it should be merged in the containing bundle. This means that its not going to be possible to specify a bundle as loading in start level 0 by setting the level on the bundle. To load in start level 0 you mus [...]
new 8c0ec78 SLING-1441 - adding run goal to launchpad plugin
new b3f5ef2 SLING-1454 - adding ability to read filtered sling properties from a file
new df85fd6 SLING-1442 - adding start and stop goals to launchpad plugin
new 74b72b9 exposing controlHost configuration parameter in launchpad plugin
new 99ee468 fix formatting of pom file
new 9768cfb SLING-1442 - shouldn't be killing the JVM on a "stop" command.
new dd65aa8 SLING-1491 - switching from pax web to felix httpservice
new eb5e840 updating to released launchpad base
new 2183492 reformatting pom
new cc7a04f [maven-release-plugin] prepare release maven-launchpad-plugin-2.0.6
new d69b5db [maven-release-plugin] prepare for next development iteration
new 2e9d194 using next snapshot until release vote is finished
new e75b100 Update some notice files
new 2551177 Use released version of launchpad base
new 917e990 Use released parent pom.
new c6c90d7 SLING-1586 - adding overwrite version on merge code
new 99e00dc SLING-1591 - upgrading to latest base artifacts
new c52ad9c SLING-1692 - replacing dummy code for updated() method.
new 2945145 SLING-1693 - adding xml as a resource provider provided extension
new 42035b5 changing classname and adding missing license header
new 119f700 SLING-1693 - implemeting a search path for resources
new b508767 SLING-1743 / SLING-845 - setting slingHome to default to ${basedir}/sling. No longer need the antrun execution as a result
new ea8d50e SLING-1799 - adding output-bundle-list mojo
new d05a0b4 tabs -> spaces
new f300177 SLING-1795 - adding Drools-based rules for rewriting bundle list. Includes sample rule which can be activated by running "mvn -P test-reactor-sling-bundles clean install" from the root project.
new cbb45d4 updating all modules to parent 10-SNAPSHOT in anticipation of emma additions to parent
new 25154c3 adding jboss repository (for drools dependencies)
new 793fe22 trivial improvement in error handling
new 85a3ca6 SLING-1803 - adding emma report. runs with -P emma
new 3106d97 SLING-1843 - adding launchpad:display-bundle-updates goal
new c31bbfa Update to recent snapshots
new bad22bd prepping maven-launchpad-plugin for release
new 63eaf6e [maven-release-plugin] prepare release maven-launchpad-plugin-2.0.8
new 9fd2bdb [maven-release-plugin] prepare for next development iteration
new 61f3f68 SLING-1597 - adding config installation via launchpad
new c0518da removing LICENSE and NOTICE files for future releases
new ede6563 SLING-1980 - fixing by adding some code as described by Benjamin on maven-users
new f33d169 updating pom pre-release
new 64e03a1 [maven-release-plugin] prepare release maven-launchpad-plugin-2.0.10
new 6cec043 [maven-release-plugin] prepare for next development iteration
new c80a1cc using snapshots during vote
new d8dc15d Temporarily upgrade to 1.0.1-SNAPSHOT of the launchpad API to not fail builds
new 8c84089 SLING-1988 - removing errant files
new 2cddbb6 removing empty dir
new b751260 SLING-2105 - initial implementation of partial bundle lists
new f23f3d6 Code cleanup - remove unused stuff.
new d8c44e2 Code cleanup - remove unused stuff.
new 67eb316 SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
new 79e6e41 SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
new 2d6b5a8 SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
new cb3b66f SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
new 0a616ce SLING-2124 : Improve support for OSGi installer by distinguishing between bootstrap and app bundles
new 2fc71ae Remove unused code
new d72004a SLING-2134 : Provide a way to add additional properties to sling.properties
new 5039e0f SLING-2135 : Copying of resources should respect default includes
new 13dad4c SLING-2134 : Provide a way to add additional properties to sling.properties
new 98a09a7 SLING-2150 : Update plugins to use the latest available versions
new a0121dc Update to recent snapshot
new 893c07a Update to recent snapshot
new 917e094 Using latest released parent pom
new ba156ae SLING-2182 : Provide a way to specify additional bootstrap commands
new 934711b SLING-2182 : Provide a way to specify additional bootstrap commands
new 97dac9a SLING-2183 : Bundle configurations and sling files with bundlelist
new 0f6d05c Using released versions
new dff0438 SLING-2134 : Provide a way to add additional properties to sling.properties SLING-2182 : Provide a way to specify additional bootstrap commands
new f1a9178 SLING-2182 : Provide a way to specify additional bootstrap commands
new a35a90d SLING-2187 - adding new module to contain our custom notice file; adding remote-resources plugin configuration to parent pom and removing all existing appended-resources NOTICE files
new 179cc9b temporarily using snapshots during release vote
new 02a8aea SLING-2207 : Support different properties and bootstrap commands for standalone and webapp
new 44145b7 SLING-2207 : Support different properties and bootstrap commands for standalone and webapp
new 3b2fc20 Prepare for release
new 3325362 [maven-release-plugin] prepare release maven-launchpad-plugin-2.1.0
new f02592e [maven-release-plugin] prepare for next development iteration
new 4b57990 Use latest snapshot after release
new d32ced5 using latest releases
new 1a827c3 SLING-2212 : When merging bundle lists, the highest version should win
new bc03898 SLING-2238 - doing property interpolation on bundle list
new 6a0e12a SLING-2241 - AbstractLaunchpadStartingMojo uses protected fields from parent class
new b497a89 SLING-2194 - generating bundle list content from a project's dependencies; refactoring testing projects to use this feature.
new c2c4f2f SLING-2263 - validating partial bundle lists during their lifecycle
new 52fb200 trivial formatting and field name change
new eb65f0b SLING-2264 - add option to set includeDefaultBundles on command line
new 69e8764 SLING-2265 - adding maven-dependency-plugin style option includeDepenencies
new e0008c4 SLING-2273 - implementing a LifecycleParticipant which adds bundle list contents as dependencies
new 5d54df5 SLING-2292 - dependencies added by LaunchpadPluginLifecycleParticipant should be of scope provided
new c3a7120 SLING-2310 : Attach bundle list goal should also add configuration artifact
new 52f90be SLING-2203 : Allow for better configuration of sling home folder
new 5deee11 SLING-2331 : Values in partial bundle list should be interpolated Maven style
new bce914d SLING-2332 : Partial bundle list should be attachable to any maven project
new 210d0d4 SLING-2194 : generate a partial bundle list from a project's dependencies SLING-2265 : maven-launchpad-plugin should support a syntax similar to the maven-dependency-plugin
new 92b1ba9 SLING-2263 - no longer need to validate bundle lists as SLING-2273 handles that now.
new 802751b removing unused code
new bb6cf72 SLING-2194 - fail the build if a bundle list isn't available as this is now the only way to define a partial bundle list.
new 023486f SLING-2386 : It should be possible to remove bundles from an inherited partial bundle list. Apply patch from Timo Naroska
new 5099e0e SLING-2434 - upgrding to Drools 2.3.1.Final as that's in Maven Central
new 29f1677 SLING-2480 : Add config for maven-sling-plugin to m2e configuration
new 54d5e7f Update to latest parent pom
new d3b3dde Use released versions
new 2165db9 Use released version instead of older snapshot
new 069d580 [maven-release-plugin] prepare release maven-launchpad-plugin-2.1.2
new 2f1d9ed [maven-release-plugin] prepare for next development iteration
new bf9822b SLING-2589 : Project Configurations are overwritten by inherited
new 2bdd3ee SLING-2590 : Provide a way to exclude configurations from partial bundle lists
new 8285db3 SLING-2591 : Provide a way to exclude sling properties from partial bundle lists
new 605a92f SLING-2620 - creating target directories if they don't exist already (thanks Minto van der Sluis for the patch!)
new 54bb0b0 SLING.2649 : Add support for run modes
new 1c58c63 SLING-2649 : Add support for run modes
new e032914 SLING-2662 : Enhance run mode handling
new 061abd9 [maven-release-plugin] prepare release maven-launchpad-plugin-2.2.0
new 900df93 [maven-release-plugin] prepare for next development iteration
new 05ce861 SLING-1245 - adding pax-runner support. Thansk to Alex Collignon for the patch
new 4c57106 Use latest releases and update to new parent pom
new b419245 Update to latest parent pom and use latest releases in launchpad
new fd785a4 SLING-2843 : Launchpad plugin should check if configuration directory exists
new 5945c06 Correct reactor pom and update to parent pom 16
new 1c5b063 Update to latest parent pom
new 2fb9ff1 SLING-2978 - Create tooling top-level directory and move maven and ide under it
new c775975 SLING-3011 - Bind the launchpad:prepare-package goal to the prepare-package lifecycle phase
new 056c137 Update to parent pom 18
new 477f0b1 SLING-3142 : NullPointerException with Java8 in AbstractUsingBundleList
new fb52357 SLING-3205 - factor out BundleListContentProvider to make it easier to test, and add tests. No functional changes so far
new 8925b33 SLING-3205 - refactor if statement into more readable methods
new 1461921 SLING-3205 - provide bundle resources under resources/install to support run modes
new 1b8ba47 SLING-3205 - avoid confusing warning on config files
new 066b97b SLING-3401 Support multiple bundles for the jarWebSupport
new 81e074a SLING-3401 : Support multiple bundles for jarWebSupport Add support for reading multiple bundles when directly reading the maven xml (lifecycle participant) and add support to define several bundles in the dependencies.properties file
new 5fb1583 SLING-3401 : Support multiple bundles for jarWebSupport Implement toString and provide a way to get the contained artifact definitions
new cde72b8 SLING-3401 : Support multiple bundles for jarWebSupport Fix init method
new 69bcdbc SLING-3416 - Some tests in o.a.s.m.projectsupport.BundleListContentProviderTest fails on windows
new 784ed4e [maven-release-plugin] prepare release maven-launchpad-plugin-2.3.0
new fda7f2d [maven-release-plugin] prepare for next development iteration
new b627e43 Update to parent pom v19
new 8cb75ee SLING-3681 - Enable the maven-launchpad-plugin to generate the XSD for bundles list XML document
new 6d4f459 SLING-3681 - Enable the maven-launchpad-plugin to generate the XSD for bundles list XML document
new 2537d9d Updated to parent version 20
new 7b26d65 SLING-3883 : Merging partial bundle list with properties fails. Apply patch from Marcel Reutegger
new 0299487 [maven-release-plugin] prepare release maven-launchpad-plugin-2.3.2
new dcaba22 [maven-release-plugin] prepare for next development iteration
new 38bd73e Update to Sling Parent POM 22 with baselining enabled
new 442c08d SLING-4284 - Support nested config path in BundleListContentProvider
new 9073c7b Add missing licence headers
new e53611b SLING-4698 - Set parent.relativePath to empty for all modules
new c7407ec Update to Sling Parent 23
new 7ffded0 set parent version to 24 and add empty relativePath where missing
new 929d4f5 Update the main reactor to parent 25
new 52e8f45 SLING-5107 - Switch to Java annotations for Maven plugins
new 2e905ad SLING-5177- Launchpad plugin breaks after release of Sling 8
new ff441fa [maven-release-plugin] prepare release maven-launchpad-plugin-2.3.4
new e9df49c [maven-release-plugin] copy for tag maven-launchpad-plugin-2.3.4
The 158 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] 43/45: SLING-5177- Launchpad plugin
breaks after release of Sling 8
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 2e905ad14ac4c34e8c043dea7b5d44985a39435c
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Oct 21 11:38:25 2015 +0000
SLING-5177- Launchpad plugin breaks after release of Sling 8
Depend on version 7 of the launchpad instead of RELEASE.
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1709800 13f79535-47bb-0310-9956-ffa450edef68
---
.../org/apache/sling/maven/projectsupport/dependencies.properties | 4 ++--
.../org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties b/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties
index d8102e3..e6d9369 100644
--- a/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties
+++ b/src/main/resources/org/apache/sling/maven/projectsupport/dependencies.properties
@@ -15,6 +15,6 @@
# specific language governing permissions and limitations
# under the License.
base=org.apache.sling,org.apache.sling.launchpad.base,,jar,,0
-defaultBundles=org.apache.sling,org.apache.sling.launchpad,RELEASE,jar,bundles,0
-defaultBundleList=org.apache.sling,org.apache.sling.launchpad,RELEASE,xml,bundlelist,0
+defaultBundles=org.apache.sling,org.apache.sling.launchpad,7,jar,bundles,0
+defaultBundleList=org.apache.sling,org.apache.sling.launchpad,7,xml,bundlelist,0
jarWebSupport=org.apache.felix,org.apache.felix.http.jetty,RELEASE,jar,,-1
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java b/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
index 2a2fff3..c4d765d 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/PreparePackageMojoTest.java
@@ -41,7 +41,7 @@ public class PreparePackageMojoTest {
// "org.apache.sling.launchpad", "RELEASE", "jar", "bundles", 0);
makeArtifactAssertions(mojo, "defaultBundleList", "org.apache.sling",
- "org.apache.sling.launchpad", "RELEASE", "xml", "bundlelist", 0);
+ "org.apache.sling.launchpad", "7", "xml", "bundlelist", 0);
makeArtifactAssertions(mojo, "jarWebSupport", "org.apache.felix",
"org.apache.felix.http.jetty", "RELEASE", "jar", null, -1);
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 31/45: Updated to parent version 20
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 2537d9dd923b11c67002063109738afb0609c4f5
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Fri Aug 1 19:16:26 2014 +0000
Updated to parent version 20
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1615208 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 8159897..666c513 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>19</version>
+ <version>20</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 08/45: Use latest releases and
update to new 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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 4c57106d80a876598bd51dcb3a3fb27d570ab1bb
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Dec 23 06:53:35 2012 +0000
Use latest releases and update to new parent pom
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1425425 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 97a5388..123d041 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>13</version>
+ <version>14</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] 19/45: SLING-3205 - provide bundle
resources under resources/install to support run modes
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 14619210945e86788e4e905c8f55d9874d5ac464
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Oct 25 12:21:41 2013 +0000
SLING-3205 - provide bundle resources under resources/install to support run modes
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1535709 13f79535-47bb-0310-9956-ffa450edef68
---
.../projectsupport/BundleListContentProvider.java | 153 ++++++++++++++++---
.../BundleListContentProviderTest.java | 164 +++++++++++++++++----
src/test/resources/test-bundle-list.xml | 10 ++
3 files changed, 276 insertions(+), 51 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
index 472ec6c..eb34f54 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
@@ -26,6 +26,7 @@ import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
@@ -45,6 +46,10 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
*/
abstract class BundleListContentProvider implements LaunchpadContentProvider {
+ public static final String INSTALL_PATH_PREFIX = "resources/install";
+ public static final int BOOTSTRAP_DEF_START_LEVEL = -1;
+ public static final int ACTUAL_BOOTSTRAP_START_LEVEL = 1;
+
private final File resourceProviderRoot;
private final static List<String> EMPTY_STRING_LIST = Collections.emptyList();
@@ -55,11 +60,10 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
private Iterator<String> handleBundlePathRoot(String path) {
final Set<String> levels = new HashSet<String>();
for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
- // we treat the boot level as level 1
- if ( level.getStartLevel() == -1 ) {
- levels.add(BUNDLE_PATH_PREFIX + "/1/");
- } else {
- levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
+ // Include only bootstrap bundles here, with start level 1.
+ // Other bundles go under the install folder, to support run modes
+ if( level.getStartLevel() == BOOTSTRAP_DEF_START_LEVEL) {
+ levels.add(BUNDLE_PATH_PREFIX + "/" + ACTUAL_BOOTSTRAP_START_LEVEL + "/");
}
}
return levels.iterator();
@@ -88,31 +92,53 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
}
}
- private Iterator<String> handleBundlePathFolder(String path) {
+ private Iterator<String> handleBundlesSubfolder(String path) {
+ Iterator<String> result = null;
final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
try {
final int startLevel = Integer.parseInt(startLevelInfo);
+
+ // To be consistent with handleBundlePathRoot, consider only level 1 which
+ // is assigned to bootstrap bundles
+ if(startLevel == ACTUAL_BOOTSTRAP_START_LEVEL) {
+ final List<String> bundles = new ArrayList<String>();
+ addBundles(bundles, ACTUAL_BOOTSTRAP_START_LEVEL, null);
+ addBundles(bundles, BOOTSTRAP_DEF_START_LEVEL, null);
+ result = bundles.iterator();
+ }
- final List<String> bundles = new ArrayList<String>();
- for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
- if (level.getStartLevel() == startLevel || (startLevel == 1 && level.getStartLevel() == -1)) {
- for (final Bundle bundle : level.getBundles()) {
- final ArtifactDefinition d = new ArtifactDefinition(bundle, startLevel);
- try {
- final Artifact artifact = getArtifact(d);
- bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
- } catch (Exception e) {
- getLog().error("Unable to resolve artifact ", e);
- }
+ } catch (NumberFormatException e) {
+ getLog().warn("Invalid start level " + startLevelInfo + " in path " + path);
+ }
+
+ return result;
+ }
+
+ private void addBundles(Collection<String> bundles, int startLevel, String runMode) {
+ for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+ if(level.getStartLevel() == startLevel) {
+ for (final Bundle bundle : level.getBundles()) {
+ if(!runModeMatches(bundle, runMode)) {
+ continue;
+ }
+ final ArtifactDefinition d = new ArtifactDefinition(bundle, startLevel);
+ try {
+ final Artifact artifact = getArtifact(d);
+ bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
+ } catch (Exception e) {
+ getLog().error("Unable to resolve artifact ", e);
}
}
}
- return bundles.iterator();
-
- } catch (NumberFormatException e) {
- // we ignore this
}
- return null;
+ }
+
+ private boolean runModeMatches(Bundle b, String runMode) {
+ if(runMode == null || runMode.length() == 0) {
+ return b.getRunModes() == null || b.getRunModes().length() == 0;
+ } else {
+ return b.getRunModes() != null && b.getRunModes().contains(runMode);
+ }
}
private Iterator<String> handleResourcesRoot() {
@@ -120,8 +146,81 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
subDirs.add(BUNDLE_PATH_PREFIX);
subDirs.add(CONFIG_PATH_PREFIX);
subDirs.add("resources/corebundles");
+ subDirs.add(INSTALL_PATH_PREFIX);
+
+ // Compute the set of run modes in our bundles
+ final Set<String> runModes = new HashSet<String>();
+ for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+ for(Bundle bundle : level.getBundles()) {
+ final String modes = bundle.getRunModes();
+ if(modes != null && modes.length() > 0) {
+ for(String m : modes.split(",")) {
+ runModes.add("." + m);
+ }
+ }
+ }
+ }
+
+ // Add one install subdir per run mode
+ for(String m : runModes) {
+ subDirs.add(INSTALL_PATH_PREFIX + m);
+ }
return subDirs.iterator();
}
+
+ /** Add one folder per child, using given path as prefix, for start
+ * levels which actually provide bundles for the given run mode.
+ */
+ private void addStartLevelSubdirs(Collection<String> children, String path, String runMode) {
+ for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+ final List<String> bundles = new ArrayList<String>();
+ addBundles(bundles, level.getStartLevel(), runMode);
+ if(!bundles.isEmpty()) {
+ int folderLevel = level.getStartLevel();
+ if(folderLevel== BOOTSTRAP_DEF_START_LEVEL) {
+ folderLevel = ACTUAL_BOOTSTRAP_START_LEVEL;
+ }
+ children.add(path + "/" + folderLevel);
+ }
+ }
+ }
+
+ private Iterator<String> handleInstallPath(String path) {
+ // Path is like
+ // bundles/install.runMode/12
+ // or a subset of that.
+ // Extract optional run mode and start level from that
+ if(path.endsWith("/")) {
+ path = path.substring(0, path.length() - 1);
+ }
+ final String [] parts = path.substring(INSTALL_PATH_PREFIX.length()).split("/");
+ if (parts.length > 2){
+ throw new IllegalStateException("Cannot parse path " + path);
+ }
+ final String runMode = parts[0].length() == 0 ? null : parts[0].substring(1);
+ final String startLevelInfo = parts.length > 1 ? parts[1] : null;
+ Set<String> result = new HashSet<String>();
+
+ if(runMode == null && startLevelInfo == null) {
+ // Root folder: add one subdir per start level that provides bundles
+ addStartLevelSubdirs(result, INSTALL_PATH_PREFIX, null);
+
+ } else if(startLevelInfo == null) {
+ // The root of a run mode folder - one subdir per start
+ // level which actually provides bundles
+ addStartLevelSubdirs(result, path, runMode);
+
+ } else {
+ // A folder that contains bundles
+ try {
+ addBundles(result, Integer.parseInt(startLevelInfo), runMode);
+ } catch (NumberFormatException e) {
+ getLog().warn("Invalid start level info " + startLevelInfo + " in path " + path);
+ }
+ }
+
+ return result.iterator();
+ }
public Iterator<String> getChildren(String path) {
Iterator<String> result = null;
@@ -132,11 +231,17 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
} else if (path.equals(CONFIG_PATH_PREFIX)) {
result = handleConfigPath();
} else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
- result = handleBundlePathFolder(path);
+ result = handleBundlesSubfolder(path);
+ } else if (path.startsWith(INSTALL_PATH_PREFIX)) {
+ result = handleInstallPath(path);
} else if (path.equals("resources") ) {
result = handleResourcesRoot();
+ } else if (path.startsWith("file:") ) {
+ // Client looks for files under a file - we have none,
+ // as our file URLs point to Maven artifacts
+ result = EMPTY_STRING_LIST.iterator();
} else {
- getLog().warn("un-handlable " + getClass().getSimpleName() + " path: " + path);
+ getLog().warn("BundleListContentProvider cannot handle path: " + path);
}
return result;
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
index b4c3905..21cbe53 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -27,6 +27,7 @@ import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
+import java.util.LinkedList;
import java.util.List;
import org.apache.maven.artifact.Artifact;
@@ -48,7 +49,7 @@ public class BundleListContentProviderTest {
private static BundleList bundleList;
public static final String TEST_BUNDLE_LIST = "test-bundle-list.xml";
- public static final int BUNDLES_IN_TEST_BUNDLE_LIST = 11;
+ public static final int BUNDLES_IN_TEST_BUNDLE_LIST = 13;
private LaunchpadContentProvider provider;
private File resourceProviderRoot;
@@ -114,7 +115,7 @@ public class BundleListContentProviderTest {
Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException {
final Artifact a = Mockito.mock(Artifact.class);
final String fakeName = new StringBuilder()
- .append("/")
+ .append("/FAKE_BUNDLE/")
.append(def.getArtifactId())
.append("/")
.append(def.getStartLevel())
@@ -138,14 +139,17 @@ public class BundleListContentProviderTest {
if(expected.length == 0) {
assertTrue("Expecting no children for " + path, it == null || !it.hasNext());
} else {
+ assertNotNull("Expecting non-null iterator for " + path, it);
while(it.hasNext()) {
kids.add(it.next());
}
for(String exp : expected) {
- assertTrue("Expecting " + exp + " in children of " + path + " (result=" + kids + ")", kids.contains(exp));
+ assertTrue("Expecting " + exp + " in children of " + path + " (result=" + kids + ")",
+ kids.contains(exp));
}
}
- assertEquals("Expecting the correct number of children for " + path, expected.length, kids.size());
+ assertEquals("Expecting the correct number of children for " + path + " (result=" + kids + ")",
+ expected.length, kids.size());
}
@Test
@@ -162,16 +166,53 @@ public class BundleListContentProviderTest {
assertChildren("resources",
"resources/bundles",
"resources/corebundles",
- "resources/config");
+ "resources/config",
+ "resources/install",
+ "resources/install.dev",
+ "resources/install.test",
+ "resources/install.oak",
+ "resources/install.jackrabbit");
}
@Test
public void testBundles() {
assertChildren("resources/bundles",
- "resources/bundles/0/",
- "resources/bundles/1/",
- "resources/bundles/5/",
- "resources/bundles/15/");
+ "resources/bundles/1/");
+ }
+
+ @Test
+ public void testInstall() {
+ assertChildren("resources/install",
+ "resources/install/0",
+ "resources/install/1",
+ "resources/install/5",
+ "resources/install/15");
+ }
+
+ @Test
+ public void testInstallDev() {
+ assertChildren("resources/install.dev",
+ "resources/install.dev/0",
+ "resources/install.dev/5");
+ }
+
+ @Test
+ public void testInstallTest() {
+ assertChildren("resources/install.test",
+ "resources/install.test/0",
+ "resources/install.test/5");
+ }
+
+ @Test
+ public void testInstallOak() {
+ assertChildren("resources/install.oak",
+ "resources/install.oak/15");
+ }
+
+ @Test
+ public void testInstallJackrabbit() {
+ assertChildren("resources/install.jackrabbit",
+ "resources/install.jackrabbit/15");
}
@Test
@@ -194,34 +235,68 @@ public class BundleListContentProviderTest {
}
@Test
- public void testBundles0() {
- assertChildren("resources/bundles/0",
- "file:/commons-io/0/null",
- "file:/commons-fileupload/0/null",
- "file:/commons-collections/0/null",
- "file:/org.apache.sling.installer.provider.jcr/0/test,dev");
+ public void testIgnoredNonBootstrapBundles() {
+ // All these start levels do not provide resources/bundles anymore - moved to resources/install
+ for(int i=0; i <= 30; i++) {
+ if(i == 1) {
+ continue;
+ }
+ final String path ="resources/bundles/" + i;
+ assertNull("Expecting no resources under " + path, provider.getChildren(path));
+ }
+ }
+
+ @Test
+ public void testInstall0() {
+ assertChildren("resources/install/0",
+ "file:/FAKE_BUNDLE/commons-io/0/null",
+ "file:/FAKE_BUNDLE/commons-fileupload/0/null",
+ "file:/FAKE_BUNDLE/commons-collections/0/null");
}
@Test
- public void testBundles1() {
+ public void testBootstrapBundles() {
assertChildren("resources/bundles/1",
- "file:/slf4j-api/1/null",
- "file:/org.apache.sling.commons.log/1/null");
+ "file:/FAKE_BUNDLE/slf4j-api/-1/null",
+ "file:/FAKE_BUNDLE/org.apache.sling.commons.log/-1/null");
+ }
+
+ @Test
+ public void testInstall5() {
+ assertChildren("resources/install/5",
+ "file:/FAKE_BUNDLE/five.norunmode/5/null");
}
@Test
- public void testBundles5() {
- assertChildren("resources/bundles/5",
- "file:/org.apache.sling.extensions.webconsolebranding/5/dev",
- "file:/org.apache.sling.extensions.webconsolesecurityprovider/5/test");
+ public void testInstall5Dev() {
+ assertChildren("resources/install.dev/5",
+ "file:/FAKE_BUNDLE/org.apache.sling.extensions.webconsolebranding/5/dev");
}
@Test
- public void testBundles15() {
- assertChildren("resources/bundles/15",
- "file:/org.apache.sling.jcr.oak.server/15/oak",
- "file:/guava/15/jackrabbit",
- "file:/jsr305/15/oak,jackrabbit");
+ public void testInstall5Test() {
+ assertChildren("resources/install.test/5",
+ "file:/FAKE_BUNDLE/org.apache.sling.extensions.webconsolesecurityprovider/5/test");
+ }
+
+ @Test
+ public void testInstall15() {
+ assertChildren("resources/install/15",
+ "file:/FAKE_BUNDLE/fifteen.norunmode/15/null");
+ }
+
+ @Test
+ public void testInstall15Oak() {
+ assertChildren("resources/install.oak/15",
+ "file:/FAKE_BUNDLE/org.apache.sling.jcr.oak.server/15/oak",
+ "file:/FAKE_BUNDLE/jsr305/15/oak,jackrabbit");
+ }
+
+ @Test
+ public void testInstall15Jackrabbit() {
+ assertChildren("resources/install.jackrabbit/15",
+ "file:/FAKE_BUNDLE/guava/15/jackrabbit",
+ "file:/FAKE_BUNDLE/jsr305/15/oak,jackrabbit");
}
@Test
@@ -271,4 +346,39 @@ public class BundleListContentProviderTest {
assertNull(provider.getChildren("/FOO/bar"));
}
+ @Test
+ public void testAllBundlesFound() {
+ final List<String> allResources = new LinkedList<String>();
+ addRecursively(allResources, "resources");
+ final List<String> bundles = new LinkedList<String>();
+ for(String r : allResources) {
+ if(r.contains("FAKE_BUNDLE")) {
+ bundles.add(r);
+ }
+ }
+
+ // Bundles that have two run modes appear in two folders, we have two of those
+ // with two run modes each
+ final int expected = BUNDLES_IN_TEST_BUNDLE_LIST + 2;
+ assertEquals("Expecting the exact number of test bundles to be found", expected, bundles.size());
+ }
+
+ @Test
+ public void testFile() {
+ assertChildren("file:/something");
+ }
+
+ private void addRecursively(List<String> resources, String path) {
+ if(path.endsWith("/")) {
+ path = path.substring(0, path.length() - 1);
+ }
+ resources.add(path);
+ final Iterator<String> it = provider.getChildren(path);
+ if(it != null) {
+ while(it.hasNext()) {
+ addRecursively(resources, it.next());
+ }
+ }
+ }
+
}
diff --git a/src/test/resources/test-bundle-list.xml b/src/test/resources/test-bundle-list.xml
index 8c3b87c..43b7da5 100644
--- a/src/test/resources/test-bundle-list.xml
+++ b/src/test/resources/test-bundle-list.xml
@@ -51,6 +51,11 @@
<version>1.0.0</version>
<runModes>test</runModes>
</bundle>
+ <bundle>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>five.norunmode</artifactId>
+ <version>1.0.0</version>
+ </bundle>
</startLevel>
<startLevel level="15">
@@ -72,5 +77,10 @@
<version>2.0.0</version>
<runModes>oak,jackrabbit</runModes>
</bundle>
+ <bundle>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>fifteen.norunmode</artifactId>
+ <version>1.0.0</version>
+ </bundle>
</startLevel>
</bundles>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 03/45: SLING-2649 : Add support for
run modes
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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 1c58c6355f366040f6a93a8711a7973bc4e562aa
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Nov 14 11:35:29 2012 +0000
SLING-2649 : Add support for run modes
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1409168 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java | 7 +++++++
1 file changed, 7 insertions(+)
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 867535e..bb27287 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -166,6 +166,12 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
} catch (NumberFormatException e) {
// we ignore this
}
+ } else if (path.equals("resources") ) {
+ final Set<String> subDirs = new HashSet<String>();
+ subDirs.add(BUNDLE_PATH_PREFIX);
+ subDirs.add(CONFIG_PATH_PREFIX);
+ subDirs.add("resources/corebundles");
+ return subDirs.iterator();
}
getLog().warn("un-handlable path " + path);
@@ -328,6 +334,7 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
}
}
+ @Override
protected void initArtifactDefinitions(Properties dependencies) {
if (jarWebSupport == null) {
jarWebSupport = new ArtifactDefinition();
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 45/45: [maven-release-plugin] copy
for tag maven-launchpad-plugin-2.3.4
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit e9df49c49fc099c0d01b2a5067cb4ef5b425caa2
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Oct 21 11:39:55 2015 +0000
[maven-release-plugin] copy for tag maven-launchpad-plugin-2.3.4
git-svn-id: https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.4@1709803 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] 36/45: SLING-4284 - Support nested
config path in BundleListContentProvider
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 442c08d67ead11afb5a87bc9b7bf1495fd7475b5
Author: Chetan Mehrotra <ch...@apache.org>
AuthorDate: Tue Jan 6 10:19:53 2015 +0000
SLING-4284 - Support nested config path in BundleListContentProvider
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1649770 13f79535-47bb-0310-9956-ffa450edef68
---
.../projectsupport/BundleListContentProvider.java | 29 ++++++------
.../BundleListContentProviderTest.java | 52 ++++++++++++++++++----
2 files changed, 60 insertions(+), 21 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
index 64442fc..e2fdbbe 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
@@ -33,6 +33,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.apache.commons.io.FilenameUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
@@ -71,18 +72,11 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
private Iterator<String> handleConfigPath() {
if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
- File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
-
- public boolean accept(File file) {
- return file.isFile();
- }
- });
+ File[] configFiles = getConfigDirectory().listFiles();
List<String> fileNames = new ArrayList<String>();
for (File cfgFile : configFiles) {
- if (cfgFile.isFile()) {
fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
- }
}
return fileNames.iterator();
@@ -223,18 +217,27 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
}
private Iterator<String> handleConfigSubpath(String path) {
- // We don't handle config subpaths for now, but do not
- // warn if we're asked for the children of a file, just
- // return empty in that case
final File f = getConfigFile(path);
if(!f.exists()) {
getLog().warn("BundleListContentProvider cannot get children of config path: " + path);
+ return EMPTY_STRING_LIST.iterator();
+ }
+
+ if (f.isFile()){
+ return EMPTY_STRING_LIST.iterator();
}
- return EMPTY_STRING_LIST.iterator();
+
+ File[] configFiles = f.listFiles();
+ List<String> fileNames = new ArrayList<String>();
+ for (File cfgFile : configFiles) {
+ fileNames.add(path + "/" + cfgFile.getName());
+ }
+
+ return fileNames.iterator();
}
private File getConfigFile(String path) {
- return new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
+ return new File(FilenameUtils.concat(getConfigDirectory().getAbsolutePath(), path.substring(CONFIG_PATH_PREFIX.length() + 1)));
}
public Iterator<String> getChildren(String path) {
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
index 8041a56..6d5e66f 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -31,6 +31,7 @@ import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import org.apache.commons.io.FilenameUtils;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
@@ -68,7 +69,9 @@ public class BundleListContentProviderTest {
private static final String [] CONFIG_FILES = {
"file1.txt",
"file2.cfg",
- "someFile.properties"
+ "someFile.properties",
+ "dir1/file1.txt",
+ "dir1/dir2/file1.txt",
};
@BeforeClass
@@ -85,12 +88,14 @@ public class BundleListContentProviderTest {
@Before
public void setupTemporaryFiles() throws IOException {
+ TemporaryFolder configRoot = new TemporaryFolder(tempFolder.getRoot());
+ configRoot.create();
for(String filename: CONFIG_FILES) {
- final File f = getConfigFile(filename);
+ final File f = getConfigFile(configRoot, filename);
f.createNewFile();
assertTrue("Expecting temporary config file to have been created: " + f.getAbsolutePath(), f.exists());
}
- configDirectory = tempFolder.getRoot();
+ configDirectory = configRoot.getRoot();
resourceProviderRoot = new File(tempFolder.getRoot(), "RESOURCE_PROVIDER_ROOT");
resourceProviderRoot.mkdirs();
@@ -98,9 +103,19 @@ public class BundleListContentProviderTest {
resourceProviderFile.createNewFile();
fakeBundlePath = getFakeBundlePath();
}
+
+ private File getConfigFile(File configRoot, String name) throws IOException {
+ return new File(FilenameUtils.concat(configRoot.getAbsolutePath(), name));
+ }
- private File getConfigFile(String name) {
- return new File(tempFolder.getRoot(), name);
+ private File getConfigFile(TemporaryFolder configRoot, String name) throws IOException {
+ File parentFolder = configRoot.getRoot();
+ if (name.contains("/")){
+ String parentPath = name.substring(0, name.lastIndexOf('/'));
+ name = name.substring(name.lastIndexOf('/') + 1);
+ parentFolder = configRoot.newFolder(parentPath.split("/"));
+ }
+ return new File(parentFolder, name);
}
private String getFakeBundlePath() {
@@ -252,14 +267,28 @@ public class BundleListContentProviderTest {
assertChildren("resources/config",
"resources/config/file1.txt",
"resources/config/file2.cfg",
- "resources/config/someFile.properties");
+ "resources/config/someFile.properties",
+ "resources/config/dir1");
}
-
+
+ @Test
+ public void testNestedConfig() {
+ assertChildren("resources/config/dir1",
+ "resources/config/dir1/file1.txt",
+ "resources/config/dir1/dir2");
+ }
+
@Test
public void testConfigFile() {
assertChildren("resources/config/file1.txt");
assertEquals("Expecting no warnings", 0, logWarningsCount);
}
+
+ @Test
+ public void testNestedConfigFile() {
+ assertChildren("resources/config/dir1/file1.txt");
+ assertEquals("Expecting no warnings", 0, logWarningsCount);
+ }
@Test
public void testConfigSubpath() {
@@ -342,7 +371,14 @@ public class BundleListContentProviderTest {
public void testConfigResource() throws Exception {
final URL url = provider.getResource("resources/config/file1.txt");
assertNotNull("Expecting config resource to be found", url);
- assertEquals(getConfigFile("file1.txt").toURI().toURL().toExternalForm(), url.toExternalForm());
+ assertEquals(getConfigFile(configDirectory, "file1.txt").toURI().toURL().toExternalForm(), url.toExternalForm());
+ }
+
+ @Test
+ public void testNestedConfigResource() throws Exception {
+ final URL url = provider.getResource("resources/config/dir1/file1.txt");
+ assertNotNull("Expecting config resource to be found", url);
+ assertEquals(getConfigFile(configDirectory, "dir1/file1.txt").toURI().toURL().toExternalForm(), url.toExternalForm());
}
@Test
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 25/45: SLING-3416 - Some tests in
o.a.s.m.projectsupport.BundleListContentProviderTest fails on windows
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 69bcdbc6f7bf7ff7bca8923bfb48894aa6697651
Author: Amit Gupta <am...@apache.org>
AuthorDate: Mon Feb 24 18:08:46 2014 +0000
SLING-3416 - Some tests in o.a.s.m.projectsupport.BundleListContentProviderTest fails on windows
fixing the tests, hopefully these do not break on other platforms now.
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1571375 13f79535-47bb-0310-9956-ffa450edef68
---
.../BundleListContentProviderTest.java | 55 +++++++++++++---------
1 file changed, 33 insertions(+), 22 deletions(-)
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
index 056c018..8041a56 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
@@ -59,6 +60,7 @@ public class BundleListContentProviderTest {
private File resourceProviderFile;
private File configDirectory;
private int logWarningsCount;
+ private String fakeBundlePath;
@Rule
public TemporaryFolder tempFolder = new TemporaryFolder();
@@ -89,17 +91,26 @@ public class BundleListContentProviderTest {
assertTrue("Expecting temporary config file to have been created: " + f.getAbsolutePath(), f.exists());
}
configDirectory = tempFolder.getRoot();
-
+
resourceProviderRoot = new File(tempFolder.getRoot(), "RESOURCE_PROVIDER_ROOT");
resourceProviderRoot.mkdirs();
resourceProviderFile = new File(resourceProviderRoot, "RP_FILE_" + System.currentTimeMillis());
resourceProviderFile.createNewFile();
+ fakeBundlePath = getFakeBundlePath();
}
private File getConfigFile(String name) {
return new File(tempFolder.getRoot(), name);
}
-
+
+ private String getFakeBundlePath() {
+ try {
+ return new File("/FAKE_BUNDLE").toURI().toURL().toExternalForm();
+ } catch (MalformedURLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
@Before
public void setupProvider() {
final Log log = Mockito.mock(Log.class);
@@ -276,55 +287,55 @@ public class BundleListContentProviderTest {
@Test
public void testInstall0() {
- assertChildren("resources/install/0",
- "file:/FAKE_BUNDLE/commons-io/0/null",
- "file:/FAKE_BUNDLE/commons-fileupload/0/null",
- "file:/FAKE_BUNDLE/commons-collections/0/null");
+ assertChildren("resources/install/0",
+ fakeBundlePath + "/commons-io/0/null",
+ fakeBundlePath + "/commons-fileupload/0/null",
+ fakeBundlePath + "/commons-collections/0/null");
}
@Test
public void testBootstrapBundles() {
- assertChildren("resources/bundles/1",
- "file:/FAKE_BUNDLE/slf4j-api/-1/null",
- "file:/FAKE_BUNDLE/org.apache.sling.commons.log/-1/null");
+ assertChildren("resources/bundles/1",
+ fakeBundlePath + "/slf4j-api/-1/null",
+ fakeBundlePath + "/org.apache.sling.commons.log/-1/null");
}
@Test
public void testInstall5() {
- assertChildren("resources/install/5",
- "file:/FAKE_BUNDLE/five.norunmode/5/null");
+ assertChildren("resources/install/5",
+ fakeBundlePath + "/five.norunmode/5/null");
}
@Test
public void testInstall5Dev() {
- assertChildren("resources/install.dev/5",
- "file:/FAKE_BUNDLE/org.apache.sling.extensions.webconsolebranding/5/dev");
+ assertChildren("resources/install.dev/5",
+ fakeBundlePath + "/org.apache.sling.extensions.webconsolebranding/5/dev");
}
@Test
public void testInstall5Test() {
- assertChildren("resources/install.test/5",
- "file:/FAKE_BUNDLE/org.apache.sling.extensions.webconsolesecurityprovider/5/test");
+ assertChildren("resources/install.test/5",
+ fakeBundlePath + "/org.apache.sling.extensions.webconsolesecurityprovider/5/test");
}
@Test
public void testInstall15() {
assertChildren("resources/install/15",
- "file:/FAKE_BUNDLE/fifteen.norunmode/15/null");
+ fakeBundlePath + "/fifteen.norunmode/15/null");
}
@Test
public void testInstall15Oak() {
- assertChildren("resources/install.oak/15",
- "file:/FAKE_BUNDLE/org.apache.sling.jcr.oak.server/15/oak",
- "file:/FAKE_BUNDLE/jsr305/15/oak,jackrabbit");
+ assertChildren("resources/install.oak/15",
+ fakeBundlePath + "/org.apache.sling.jcr.oak.server/15/oak",
+ fakeBundlePath + "/jsr305/15/oak,jackrabbit");
}
@Test
public void testInstall15Jackrabbit() {
- assertChildren("resources/install.jackrabbit/15",
- "file:/FAKE_BUNDLE/guava/15/jackrabbit",
- "file:/FAKE_BUNDLE/jsr305/15/oak,jackrabbit");
+ assertChildren("resources/install.jackrabbit/15",
+ fakeBundlePath + "/guava/15/jackrabbit",
+ fakeBundlePath + "/jsr305/15/oak,jackrabbit");
}
@Test
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 17/45: SLING-3205 - factor out
BundleListContentProvider to make it easier to test,
and add tests. No functional changes so far
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit fb5235762d4ffe80bc06384ad60973787a2d0715
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Oct 24 14:22:15 2013 +0000
SLING-3205 - factor out BundleListContentProvider to make it easier to test, and add tests. No functional changes so far
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1535390 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 6 +
.../AbstractLaunchpadStartingMojo.java | 147 ++----------
.../projectsupport/BundleListContentProvider.java | 183 ++++++++++++++
.../BundleListContentProviderTest.java | 265 +++++++++++++++++++++
src/test/resources/test-bundle-list.xml | 76 ++++++
5 files changed, 547 insertions(+), 130 deletions(-)
diff --git a/pom.xml b/pom.xml
index 11ff2af..90eb8f2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -220,5 +220,11 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>1.9.5</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
index 2b45cc6..3c5e22b 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -19,33 +19,23 @@ package org.apache.sling.maven.projectsupport;
import static org.apache.felix.framework.util.FelixConstants.LOG_LEVEL_PROP;
import java.io.File;
-import java.io.FileFilter;
import java.io.IOException;
-import java.io.InputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
import java.util.Properties;
-import java.util.Set;
import org.apache.felix.framework.Logger;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
import org.apache.maven.shared.filtering.MavenFilteringException;
import org.apache.maven.shared.filtering.PropertyUtils;
import org.apache.sling.launchpad.api.LaunchpadContentProvider;
import org.apache.sling.launchpad.base.impl.Sling;
import org.apache.sling.launchpad.base.shared.Notifiable;
import org.apache.sling.launchpad.base.shared.SharedConstants;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
-import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
import org.osgi.framework.BundleException;
public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleListMojo implements Notifiable {
@@ -103,129 +93,26 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
*/
private File resourceProviderRoot;
- private LaunchpadContentProvider resourceProvider = new LaunchpadContentProvider() {
-
- public Iterator<String> getChildren(String path) {
- if (path.equals(BUNDLE_PATH_PREFIX)) {
- final Set<String> levels = new HashSet<String>();
- for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
- // we treat the boot level as level 1
- if ( level.getStartLevel() == -1 ) {
- levels.add(BUNDLE_PATH_PREFIX + "/1/");
- } else {
- levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
- }
- }
- return levels.iterator();
- } else if (path.equals("resources/corebundles")) {
- List<String> empty = Collections.emptyList();
- return empty.iterator();
- } else if (path.equals(CONFIG_PATH_PREFIX)) {
- if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
- File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
-
- public boolean accept(File file) {
- return file.isFile();
- }
- });
-
- List<String> fileNames = new ArrayList<String>();
- for (File cfgFile : configFiles) {
- if (cfgFile.isFile()) {
- fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
- }
- }
-
- return fileNames.iterator();
-
- } else {
- List<String> empty = Collections.emptyList();
- return empty.iterator();
- }
- } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
- final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
- try {
- final int startLevel = Integer.parseInt(startLevelInfo);
-
- final List<String> bundles = new ArrayList<String>();
- for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
- if (level.getStartLevel() == startLevel || (startLevel == 1 && level.getStartLevel() == -1)) {
- for (final Bundle bundle : level.getBundles()) {
- final ArtifactDefinition d = new ArtifactDefinition(bundle, startLevel);
- try {
- final Artifact artifact = getArtifact(d);
- bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
- } catch (Exception e) {
- getLog().error("Unable to resolve artifact ", e);
- }
- }
- }
- }
- return bundles.iterator();
+ private LaunchpadContentProvider resourceProvider = new BundleListContentProvider(resourceProviderRoot) {
- } catch (NumberFormatException e) {
- // we ignore this
- }
- } else if (path.equals("resources") ) {
- final Set<String> subDirs = new HashSet<String>();
- subDirs.add(BUNDLE_PATH_PREFIX);
- subDirs.add(CONFIG_PATH_PREFIX);
- subDirs.add("resources/corebundles");
- return subDirs.iterator();
- }
-
- getLog().warn("un-handlable path " + path);
- return null;
+ @Override
+ BundleList getInitializedBundleList() {
+ return AbstractLaunchpadStartingMojo.this.getInitializedBundleList();
}
- public URL getResource(String path) {
- if (path.startsWith(CONFIG_PATH_PREFIX)) {
- File configFile = new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
- if (configFile.exists()) {
- try {
- return configFile.toURI().toURL();
- } catch (MalformedURLException e) {
- // ignore this one
- }
- }
- }
-
- File resourceFile = new File(resourceProviderRoot, path);
- if (resourceFile.exists()) {
- try {
- return resourceFile.toURI().toURL();
- } catch (MalformedURLException e) {
- getLog().error("Unable to create URL for file", e);
- return null;
- }
- } else {
- URL fromClasspath = getClass().getResource("/" + path);
- if (fromClasspath != null) {
- return fromClasspath;
- }
-
- try {
- return new URL(path);
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
+ @Override
+ File getConfigDirectory() {
+ return AbstractLaunchpadStartingMojo.this.getConfigDirectory();
}
-
- public InputStream getResourceAsStream(String path) {
- URL res = this.getResource(path);
- if (res != null) {
- try {
- return res.openStream();
- } catch (IOException ioe) {
- // ignore this one
- }
- }
-
- // no resource
- return null;
-
+
+ @Override
+ Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException {
+ return AbstractLaunchpadStartingMojo.this.getArtifact(def);
+ }
+
+ @Override
+ Log getLog() {
+ return AbstractLaunchpadStartingMojo.this.getLog();
}
};
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
new file mode 100644
index 0000000..cfe1c46
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
@@ -0,0 +1,183 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.apache.sling.maven.projectsupport;
+
+import static org.apache.sling.maven.projectsupport.AbstractUsingBundleListMojo.BUNDLE_PATH_PREFIX;
+import static org.apache.sling.maven.projectsupport.AbstractUsingBundleListMojo.CONFIG_PATH_PREFIX;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.sling.launchpad.api.LaunchpadContentProvider;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
+
+/** LaunchpadContentProvider that provides resources based on a BundleList
+ * and other resources specific to this module.
+ */
+abstract class BundleListContentProvider implements LaunchpadContentProvider {
+
+ private final File resourceProviderRoot;
+
+ BundleListContentProvider(File resourceProviderRoot) {
+ this.resourceProviderRoot = resourceProviderRoot;
+ }
+
+ public Iterator<String> getChildren(String path) {
+ if (path.equals(BUNDLE_PATH_PREFIX)) {
+ final Set<String> levels = new HashSet<String>();
+ for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+ // we treat the boot level as level 1
+ if ( level.getStartLevel() == -1 ) {
+ levels.add(BUNDLE_PATH_PREFIX + "/1/");
+ } else {
+ levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
+ }
+ }
+ return levels.iterator();
+ } else if (path.equals("resources/corebundles")) {
+ List<String> empty = Collections.emptyList();
+ return empty.iterator();
+ } else if (path.equals(CONFIG_PATH_PREFIX)) {
+ if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
+ File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
+
+ public boolean accept(File file) {
+ return file.isFile();
+ }
+ });
+
+ List<String> fileNames = new ArrayList<String>();
+ for (File cfgFile : configFiles) {
+ if (cfgFile.isFile()) {
+ fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
+ }
+ }
+
+ return fileNames.iterator();
+
+ } else {
+ List<String> empty = Collections.emptyList();
+ return empty.iterator();
+ }
+ } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
+ final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
+ try {
+ final int startLevel = Integer.parseInt(startLevelInfo);
+
+ final List<String> bundles = new ArrayList<String>();
+ for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+ if (level.getStartLevel() == startLevel || (startLevel == 1 && level.getStartLevel() == -1)) {
+ for (final Bundle bundle : level.getBundles()) {
+ final ArtifactDefinition d = new ArtifactDefinition(bundle, startLevel);
+ try {
+ final Artifact artifact = getArtifact(d);
+ bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
+ } catch (Exception e) {
+ getLog().error("Unable to resolve artifact ", e);
+ }
+ }
+ }
+ }
+ return bundles.iterator();
+
+ } catch (NumberFormatException e) {
+ // we ignore this
+ }
+ } else if (path.equals("resources") ) {
+ final Set<String> subDirs = new HashSet<String>();
+ subDirs.add(BUNDLE_PATH_PREFIX);
+ subDirs.add(CONFIG_PATH_PREFIX);
+ subDirs.add("resources/corebundles");
+ return subDirs.iterator();
+ }
+
+ getLog().warn("un-handlable path " + path);
+ return null;
+ }
+
+ public URL getResource(String path) {
+ if (path.startsWith(CONFIG_PATH_PREFIX)) {
+ File configFile = new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
+ if (configFile.exists()) {
+ try {
+ return configFile.toURI().toURL();
+ } catch (MalformedURLException e) {
+ // ignore this one
+ }
+ }
+ }
+
+ File resourceFile = new File(resourceProviderRoot, path);
+ if (resourceFile.exists()) {
+ try {
+ return resourceFile.toURI().toURL();
+ } catch (MalformedURLException e) {
+ getLog().error("Unable to create URL for file", e);
+ return null;
+ }
+ } else {
+ URL fromClasspath = getClass().getResource("/" + path);
+ if (fromClasspath != null) {
+ return fromClasspath;
+ }
+
+ try {
+ return new URL(path);
+ } catch (MalformedURLException e) {
+ return null;
+ }
+ }
+
+ }
+
+ public InputStream getResourceAsStream(String path) {
+ URL res = this.getResource(path);
+ if (res != null) {
+ try {
+ return res.openStream();
+ } catch (IOException ioe) {
+ // ignore this one
+ }
+ }
+
+ // no resource
+ return null;
+ }
+
+ abstract BundleList getInitializedBundleList();
+
+ abstract File getConfigDirectory();
+
+ abstract Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException;
+
+ abstract Log getLog();
+}
\ No newline at end of file
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
new file mode 100644
index 0000000..7cd9039
--- /dev/null
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -0,0 +1,265 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.maven.projectsupport;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.sling.launchpad.api.LaunchpadContentProvider;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Reader;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.TemporaryFolder;
+import org.mockito.Mockito;
+
+/** Test the BundleListContentProvider */
+public class BundleListContentProviderTest {
+ private static BundleList bundleList;
+
+ public static final String TEST_BUNDLE_LIST = "test-bundle-list.xml";
+ public static final int BUNDLES_IN_TEST_BUNDLE_LIST = 11;
+
+ private LaunchpadContentProvider provider;
+ private File resourceProviderRoot;
+ private File resourceProviderFile;
+
+ @Rule
+ public TemporaryFolder tempFolder = new TemporaryFolder();
+
+ private static final String [] CONFIG_FILES = {
+ "file1.txt",
+ "file2.cfg",
+ "someFile.properties"
+ };
+
+ @BeforeClass
+ public static void parseBundleList() throws Exception {
+ final BundleListXpp3Reader reader = new BundleListXpp3Reader();
+ final InputStream is = BundleListContentProviderTest.class.getClassLoader().getResourceAsStream(TEST_BUNDLE_LIST);
+ assertNotNull("Expecting " + TEST_BUNDLE_LIST + " to be found", is);
+ try {
+ bundleList = reader.read(is);
+ } finally {
+ is.close();
+ }
+ }
+
+ @Before
+ public void setupTemporaryFiles() throws IOException {
+ for(String filename: CONFIG_FILES) {
+ final File f = getConfigFile(filename);
+ f.createNewFile();
+ assertTrue("Expecting temporary config file to have been created: " + f.getAbsolutePath(), f.exists());
+ }
+
+ resourceProviderRoot = new File(tempFolder.getRoot(), "RESOURCE_PROVIDER_ROOT");
+ resourceProviderRoot.mkdirs();
+ resourceProviderFile = new File(resourceProviderRoot, "RP_FILE_" + System.currentTimeMillis());
+ resourceProviderFile.createNewFile();
+ }
+
+ private File getConfigFile(String name) {
+ return new File(tempFolder.getRoot(), name);
+ }
+
+ @Before
+ public void setupProvider() {
+ final Log log = Mockito.mock(Log.class);
+ provider = new BundleListContentProvider(resourceProviderRoot) {
+
+ @Override
+ BundleList getInitializedBundleList() {
+ return bundleList;
+ }
+
+ @Override
+ File getConfigDirectory() {
+ return tempFolder.getRoot();
+ }
+
+ @Override
+ Artifact getArtifact(ArtifactDefinition def) throws MojoExecutionException {
+ final Artifact a = Mockito.mock(Artifact.class);
+ final String fakeName = new StringBuilder()
+ .append("/")
+ .append(def.getArtifactId())
+ .append("/")
+ .append(def.getStartLevel())
+ .append("/")
+ .append(def.getRunModes())
+ .toString();
+ Mockito.when(a.getFile()).thenReturn(new File(fakeName));
+ return a;
+ }
+
+ @Override
+ Log getLog() {
+ return log;
+ }
+ };
+ }
+
+ private void assertChildren(String path, String ...expected) {
+ final List<String> kids = new ArrayList<String>();
+ final Iterator<String> it = provider.getChildren(path);
+ if(expected.length == 0) {
+ assertTrue("Expecting no children for " + path, it == null || !it.hasNext());
+ } else {
+ while(it.hasNext()) {
+ kids.add(it.next());
+ }
+ for(String exp : expected) {
+ assertTrue("Expecting " + exp + " in children of " + path + " (result=" + kids + ")", kids.contains(exp));
+ }
+ }
+ assertEquals("Expecting the correct number of children for " + path, expected.length, kids.size());
+ }
+
+ @Test
+ public void testParsedBundlesCount() {
+ int counter = 0;
+ for(StartLevel level : bundleList.getStartLevels()) {
+ counter += level.getBundles().size();
+ }
+ assertEquals(BUNDLES_IN_TEST_BUNDLE_LIST, counter);
+ }
+
+ @Test
+ public void testRoot() {
+ assertChildren("resources",
+ "resources/bundles",
+ "resources/corebundles",
+ "resources/config");
+ }
+
+ @Test
+ public void testBundles() {
+ assertChildren("resources/bundles",
+ "resources/bundles/0/",
+ "resources/bundles/1/",
+ "resources/bundles/5/",
+ "resources/bundles/15/");
+ }
+
+ @Test
+ public void testCoreBundles() {
+ assertChildren("resources/corebundles");
+ }
+
+ @Test
+ public void testConfig() {
+ assertChildren("resources/config",
+ "resources/config/file1.txt",
+ "resources/config/file2.cfg",
+ "resources/config/someFile.properties");
+ }
+
+ @Test
+ public void testBundles0() {
+ assertChildren("resources/bundles/0",
+ "file:/commons-io/0/null",
+ "file:/commons-fileupload/0/null",
+ "file:/commons-collections/0/null",
+ "file:/org.apache.sling.installer.provider.jcr/0/test,dev");
+ }
+
+ @Test
+ public void testBundles1() {
+ assertChildren("resources/bundles/1",
+ "file:/slf4j-api/1/null",
+ "file:/org.apache.sling.commons.log/1/null");
+ }
+
+ @Test
+ public void testBundles5() {
+ assertChildren("resources/bundles/5",
+ "file:/org.apache.sling.extensions.webconsolebranding/5/dev",
+ "file:/org.apache.sling.extensions.webconsolesecurityprovider/5/test");
+ }
+
+ @Test
+ public void testBundles15() {
+ assertChildren("resources/bundles/15",
+ "file:/org.apache.sling.jcr.oak.server/15/oak",
+ "file:/guava/15/jackrabbit",
+ "file:/jsr305/15/oak,jackrabbit");
+ }
+
+ @Test
+ public void testConfigResource() throws Exception {
+ final URL url = provider.getResource("resources/config/file1.txt");
+ assertNotNull("Expecting config resource to be found", url);
+ assertEquals(getConfigFile("file1.txt").toURI().toURL().toExternalForm(), url.toExternalForm());
+ }
+
+ @Test
+ public void testResourceProviderResource() throws Exception {
+ final URL url = provider.getResource(resourceProviderFile.getName());
+ assertNotNull("Expecting resource provider file to be found", url);
+ assertEquals(resourceProviderFile.toURI().toURL().toExternalForm(), url.toExternalForm());
+ }
+
+ @Test
+ public void testClasspathResource() throws Exception {
+ final URL url = provider.getResource(TEST_BUNDLE_LIST);
+ assertNotNull("Expecting classpath resource to be found", url);
+ assertTrue(url.toExternalForm().endsWith(TEST_BUNDLE_LIST));
+ }
+
+ @Test
+ public void testClasspathResourceAsStream() throws Exception {
+ final InputStream is = provider.getResourceAsStream(TEST_BUNDLE_LIST);
+ assertNotNull("Expecting classpath resource stream to be found", is);
+ is.close();
+ }
+
+ @Test
+ public void testNotFoundStream() throws Exception {
+ final InputStream is = provider.getResourceAsStream("resources/config/NOT_HERE.txt");
+ assertNull("Expecting null stream for non-existent resource", is);
+ }
+
+ @Test
+ public void testURLResource() throws Exception {
+ final String urlStr = "http://www.perdu.com";
+ final URL url = provider.getResource(urlStr);
+ assertNotNull("Expecting URL resource to be found", url);
+ assertEquals(new URL(urlStr), url);
+ }
+
+ @Test
+ public void testNullResult() {
+ assertNull(provider.getChildren("/FOO/bar"));
+ }
+}
diff --git a/src/test/resources/test-bundle-list.xml b/src/test/resources/test-bundle-list.xml
new file mode 100644
index 0000000..8c3b87c
--- /dev/null
+++ b/src/test/resources/test-bundle-list.xml
@@ -0,0 +1,76 @@
+<?xml version="1.0"?>
+<bundles>
+ <startLevel level="boot">
+ <!-- bootstrap bundles, must allow the installer core to start -->
+ <bundle>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <version>1.6.4</version>
+ </bundle>
+ <bundle>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.commons.log</artifactId>
+ <version>3.0.3-SNAPSHOT</version>
+ </bundle>
+ </startLevel>
+
+ <startLevel level="0">
+ <bundle>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.4</version>
+ </bundle>
+ <bundle>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2.2</version>
+ </bundle>
+ <bundle>
+ <groupId>commons-collections</groupId>
+ <artifactId>commons-collections</artifactId>
+ <version>3.2.1</version>
+ </bundle>
+ <bundle>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.installer.provider.jcr</artifactId>
+ <version>3.1.6</version>
+ <runModes>test,dev</runModes>
+ </bundle>
+ </startLevel>
+
+ <startLevel level="5">
+ <bundle>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.extensions.webconsolebranding</artifactId>
+ <version>1.0.0</version>
+ <runModes>dev</runModes>
+ </bundle>
+ <bundle>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.extensions.webconsolesecurityprovider</artifactId>
+ <version>1.0.0</version>
+ <runModes>test</runModes>
+ </bundle>
+ </startLevel>
+
+ <startLevel level="15">
+ <bundle>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>org.apache.sling.jcr.oak.server</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <runModes>oak</runModes>
+ </bundle>
+ <bundle>
+ <groupId>com.google.guava</groupId>
+ <artifactId>guava</artifactId>
+ <version>14.0.1</version>
+ <runModes>jackrabbit</runModes>
+ </bundle>
+ <bundle>
+ <groupId>com.google.code.findbugs</groupId>
+ <artifactId>jsr305</artifactId>
+ <version>2.0.0</version>
+ <runModes>oak,jackrabbit</runModes>
+ </bundle>
+ </startLevel>
+</bundles>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 12/45: Update to latest parent pom
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 1c5b063213dc046a9115d08515ea360adc4dba02
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jul 19 07:04:15 2013 +0000
Update to latest parent pom
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1504788 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index bd9f0f9..1d1e2eb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>16</version>
+ <version>17</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] 41/45: Update the main reactor to
parent 25
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 929d4f591fc20e0b4e93cfade918ccba46e3da1a
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Oct 5 10:03:45 2015 +0000
Update the main reactor to parent 25
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1706780 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 3dd72a4..f0eafe7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>24</version>
+ <version>25</version>
<relativePath/>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 13/45: SLING-2978 - Create tooling
top-level directory and move maven and ide under it
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 2fb9ff1d47e5a4230b44b189504f295cc01ae55c
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Jul 24 18:13:22 2013 +0000
SLING-2978 - Create tooling top-level directory and move maven and ide
under it
* moved the maven directory under tooling maven
* adjusted module paths in pom.xml
* updated the scm information in the pom.xml files
* updated the scm information in the README.txt files
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1506645 13f79535-47bb-0310-9956-ffa450edef68
---
README.txt | 2 +-
pom.xml | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/README.txt b/README.txt
index ddcf41e..0df89ae 100644
--- a/README.txt
+++ b/README.txt
@@ -21,7 +21,7 @@ Subversion (http://subversion.tigris.org/) source repository of
the Apache Software Foundation. If you have Subversion installed,
you can checkout the latest source using the following command:
- svn checkout http://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin
+ svn checkout http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin
See the Subversion documentation for other source control features.
diff --git a/pom.xml b/pom.xml
index 1d1e2eb..3c8a4b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -31,9 +31,9 @@
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-launchpad-plugin</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 37/45: Add missing licence headers
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 9073c7b676652d09ff1074e527755f8bb6bf8dcb
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Apr 27 12:15:34 2015 +0000
Add missing licence headers
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1676244 13f79535-47bb-0310-9956-ffa450edef68
---
src/test/resources/test-bundle-list.xml | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/test/resources/test-bundle-list.xml b/src/test/resources/test-bundle-list.xml
index 43b7da5..1106f0b 100644
--- a/src/test/resources/test-bundle-list.xml
+++ b/src/test/resources/test-bundle-list.xml
@@ -1,4 +1,16 @@
<?xml version="1.0"?>
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ agreements. See the NOTICE file distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file to you under the Apache License,
+ Version 2.0 (the "License"); you may not use this file except in compliance with the
+ License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+ either express or implied. See the License for the specific language governing permissions
+ and limitations under the License.
+ -->
<bundles>
<startLevel level="boot">
<!-- bootstrap bundles, must allow the installer core to start -->
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 26/45: [maven-release-plugin]
prepare release maven-launchpad-plugin-2.3.0
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 784ed4e4d75be7103b6d79d4558d35ef4b645f79
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 3 07:30:20 2014 +0000
[maven-release-plugin] prepare release maven-launchpad-plugin-2.3.0
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1573466 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index 90eb8f2..f1bdc66 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
</parent>
<artifactId>maven-launchpad-plugin</artifactId>
- <version>2.2.1-SNAPSHOT</version>
+ <version>2.3.0</version>
<packaging>maven-plugin</packaging>
<name>Apache Sling Launchpad Maven Plugin</name>
@@ -31,9 +31,9 @@
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-launchpad-plugin</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.0</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.0</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.0</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 11/45: Correct reactor pom and
update to parent pom 16
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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 5945c06d3950674dca96bae5ec5055e367713324
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun May 5 14:38:24 2013 +0000
Correct reactor pom and update to parent pom 16
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1479333 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index eb75a6d..bd9f0f9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>15</version>
+ <version>16</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] 01/45: SLING-2620 - creating target
directories if they don't exist already (thanks Minto van der Sluis for the
patch!)
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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 605a92f06c0940bf03c54c12212482b811baaa15
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Tue Oct 16 20:40:40 2012 +0000
SLING-2620 - creating target directories if they don't exist already (thanks Minto van der Sluis for the patch!)
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1398986 13f79535-47bb-0310-9956-ffa450edef68
---
.../java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java | 1 +
.../apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java | 1 +
2 files changed, 2 insertions(+)
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 a64d84f..6f40dc0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
@@ -61,6 +61,7 @@ public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
FileWriter fw = null;
try {
+ this.outputFile.getParentFile().mkdirs();
fw = new FileWriter(outputFile);
writer.write(fw, getInitializedBundleList());
projectHelper.attachArtifact(project, AttachPartialBundleListMojo.TYPE, AttachPartialBundleListMojo.CLASSIFIER, outputFile);
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 c157a80..f909a35 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -97,6 +97,7 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
final BundleListXpp3Writer writer = new BundleListXpp3Writer();
try {
+ this.bundleListOutput.getParentFile().mkdirs();
writer.write(new FileWriter(bundleListOutput), initializedBundleList);
} catch (IOException e) {
throw new MojoExecutionException("Unable to write bundle list", e);
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 24/45: SLING-3401 : Support multiple
bundles for jarWebSupport Fix init method
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit cde72b8317fcd9697dc8697d3d96628e0c929fde
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Feb 20 15:42:38 2014 +0000
SLING-3401 : Support multiple bundles for jarWebSupport
Fix init method
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1570236 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/maven/projectsupport/ArtifactDefinition.java | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
index f9f6ab3..d8e38f1 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -190,12 +190,13 @@ public class ArtifactDefinition {
if ( values.length == 6 ) {
initDefaults(values[0], values[1], values[2], values[3], values[4],
Integer.valueOf(values[5]));
- }
- this.bundles = new ArtifactDefinition[values.length / 6];
- for(int i=0; i<values.length / 6; i++) {
- this.bundles[i] = new ArtifactDefinition();
- this.bundles[i].initDefaults(values[i*6 + 0], values[i*6 + 1], values[i*6 + 2], values[i*6 + 3], values[i*6 + 4],
- Integer.valueOf(values[i*6 + 5]));
+ } else {
+ this.bundles = new ArtifactDefinition[values.length / 6];
+ for(int i=0; i<values.length / 6; i++) {
+ this.bundles[i] = new ArtifactDefinition();
+ this.bundles[i].initDefaults(values[i*6 + 0], values[i*6 + 1], values[i*6 + 2], values[i*6 + 3], values[i*6 + 4],
+ Integer.valueOf(values[i*6 + 5]));
+ }
}
}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 39/45: Update to Sling Parent 23
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit c7407ec7f7a33420e352db333c702d36337ff643
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 13:08:16 2015 +0000
Update to Sling Parent 23
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1687500 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 9f407d6..00c0ad8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>22</version>
+ <version>23</version>
<relativePath/>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 29/45: SLING-3681 - Enable the
maven-launchpad-plugin to generate the XSD for bundles list XML document
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 8cb75eecb08f5b224df408cce4d0600df3c4b91b
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 19 12:05:49 2014 +0000
SLING-3681 - Enable the maven-launchpad-plugin to generate the XSD for bundles list XML document
Applied patch from Simone Tripodi, thanks!
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1603848 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 5 +++--
src/main/mdo/bundle-list.xml | 7 ++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index 2444327..8159897 100644
--- a/pom.xml
+++ b/pom.xml
@@ -41,11 +41,12 @@
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
- <version>1.1</version>
+ <version>1.8.1</version>
<executions>
<execution>
<id>bundle-manifest.xml</id>
<goals>
+ <goal>xsd</goal>
<goal>java</goal>
<goal>xpp3-reader</goal>
<goal>xpp3-writer</goal>
@@ -145,7 +146,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
- <version>1.5.15</version>
+ <version>3.0.17</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
diff --git a/src/main/mdo/bundle-list.xml b/src/main/mdo/bundle-list.xml
index 0bb9d5c..c82f9fc 100644
--- a/src/main/mdo/bundle-list.xml
+++ b/src/main/mdo/bundle-list.xml
@@ -18,7 +18,8 @@
under the License.
-->
<model xmlns="http://modello.codehaus.org/MODELLO/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.0.0 http://modello.codehaus.org/xsd/modello-1.0.0.xsd">
+ xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.0.0 http://modello.codehaus.org/xsd/modello-1.0.0.xsd"
+ xsd.namespace="http://sling.apache.org/maven/1.0.0">
<id>bundle-list</id>
<name>BundleList</name>
<description>
@@ -31,7 +32,7 @@
</default>
</defaults>
<classes>
- <class rootElement="true" xml.tagName="bundles">
+ <class rootElement="true" xml.tagName="bundles" xsd.compositor="sequence">
<name>BundleList</name>
<description>List of bundles.</description>
<version>1.0.0</version>
@@ -47,7 +48,7 @@
</field>
</fields>
</class>
- <class xml.tagName="startLevel">
+ <class xml.tagName="startLevel" xsd.compositor="sequence">
<name>StartLevel</name>
<version>1.0.0</version>
<superClass>org.apache.sling.maven.projectsupport.bundlelist.BaseStartLevel</superClass>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 02/45: SLING.2649 : Add support for
run modes
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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 54bb0b0f229b4e71de80d273e3c1d30d8a156683
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Nov 13 16:46:14 2012 +0000
SLING.2649 : Add support for run modes
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1408828 13f79535-47bb-0310-9956-ffa450edef68
---
.../AbstractLaunchpadFrameworkMojo.java | 39 +++++++++++++++++-----
.../maven/projectsupport/ArtifactDefinition.java | 20 ++++++++---
.../maven/projectsupport/CreateBundleJarMojo.java | 6 ++--
.../projectsupport/PrepareTestWebAppMojo.java | 3 +-
src/main/mdo/bundle-list.xml | 5 +++
5 files changed, 56 insertions(+), 17 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 401f69d..23d16d0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
@@ -18,6 +18,8 @@ package org.apache.sling.maven.projectsupport;
import java.io.File;
import java.io.IOException;
+import java.util.Set;
+import java.util.TreeSet;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
@@ -48,20 +50,41 @@ public abstract class AbstractLaunchpadFrameworkMojo extends AbstractUsingBundle
private String bundlesDirectory;
/**
- * The directory which contains the bootstraop bundle directories.
+ * The directory which contains the bootstrap bundle directories.
*
* @parameter
*/
private String bootDirectory;
- protected String getPathForArtifact(final int startLevel, final String artifactName) {
+ protected String getPathForArtifact(final int startLevel, final String artifactName, final String runModes) {
+ final Set<String> runModesList = new TreeSet<String>();
+ if (runModes != null ) {
+ for(final String mode : runModes.split(",")) {
+ if ( mode.trim().length() > 0 ) {
+ runModesList.add(mode);
+ }
+ }
+ }
+ final String runModeExt;
+ if ( runModesList.size() == 0 ) {
+ runModeExt = "";
+ } else {
+ final StringBuilder sb = new StringBuilder();
+ for(final String n : runModesList ) {
+ sb.append('.');
+ sb.append(n);
+ }
+ runModeExt = sb.toString();
+ }
if ( startLevel == -1 && bootDirectory != null ) {
- return String.format("%s/%s/1/%s", baseDestination, bootDirectory,
+ return String.format("%s/%s%s/1/%s", baseDestination, bootDirectory,
+ runModeExt,
artifactName);
}
- return String.format("%s/%s/%s/%s", baseDestination, bundlesDirectory,
+ return String.format("%s/%s%s/%s/%s", baseDestination, bundlesDirectory,
+ runModeExt,
(startLevel == -1 ? 1 : startLevel),
- artifactName);
+ artifactName, runModeExt);
}
protected void copyBundles(BundleList bundles, File outputDirectory) throws MojoExecutionException {
@@ -74,11 +97,11 @@ public abstract class AbstractLaunchpadFrameworkMojo extends AbstractUsingBundle
protected void copy(ArtifactDefinition additionalBundle, File outputDirectory) throws MojoExecutionException {
Artifact artifact = getArtifact(additionalBundle);
- copy(artifact.getFile(), additionalBundle.getStartLevel(), outputDirectory);
+ copy(artifact.getFile(), additionalBundle.getStartLevel(), additionalBundle.getRunModes(), outputDirectory);
}
- protected void copy(File file, int startLevel, File outputDirectory) throws MojoExecutionException {
- File destination = new File(outputDirectory, getPathForArtifact(startLevel, file.getName().replace('/', File.separatorChar)));
+ protected void copy(File file, int startLevel, String runModes, File outputDirectory) throws MojoExecutionException {
+ File destination = new File(outputDirectory, getPathForArtifact(startLevel, file.getName().replace('/', File.separatorChar), runModes));
if (shouldCopy(file, destination)) {
getLog().info(String.format("Copying bundle from %s to %s", file.getPath(), destination.getPath()));
try {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
index edb4271..2183c2e 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -16,7 +16,7 @@
*/
package org.apache.sling.maven.projectsupport;
-import static org.apache.sling.maven.projectsupport.BundleListUtils.*;
+import static org.apache.sling.maven.projectsupport.BundleListUtils.nodeValue;
import org.apache.maven.model.Dependency;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
@@ -46,9 +46,12 @@ public class ArtifactDefinition {
/** The artifact version */
private String version;
+ /** The artifact run modes */
+ private String runModes;
+
public ArtifactDefinition() {
}
-
+
public ArtifactDefinition(Bundle bundle, int startLevel) {
this.groupId = bundle.getGroupId();
this.artifactId = bundle.getArtifactId();
@@ -56,6 +59,7 @@ public class ArtifactDefinition {
this.version = bundle.getVersion();
this.classifier = bundle.getClassifier();
this.startLevel = startLevel;
+ this.runModes = bundle.getRunModes();
}
public ArtifactDefinition(Xpp3Dom config) {
@@ -65,6 +69,7 @@ public class ArtifactDefinition {
this.version = nodeValue(config, "version", null);
this.classifier = nodeValue(config, "classifier", null);
this.startLevel = nodeValue(config, "startLevel", 0);
+ this.runModes = nodeValue(config, "runModes", null);
}
public String getArtifactId() {
@@ -91,6 +96,10 @@ public class ArtifactDefinition {
return version;
}
+ public String getRunModes() {
+ return runModes;
+ }
+
public void setArtifactId(String artifactId) {
this.artifactId = artifactId;
}
@@ -119,7 +128,8 @@ public class ArtifactDefinition {
public String toString() {
return "ArtifactDefinition [artifactId=" + artifactId + ", classifier="
+ classifier + ", groupId=" + groupId + ", startLevel="
- + startLevel + ", type=" + type + ", version=" + version + "]";
+ + startLevel + ", type=" + type + ", version=" + version
+ + ", runModes=" + runModes + "]";
}
/**
@@ -198,7 +208,7 @@ public class ArtifactDefinition {
bnd.setStartLevel(startLevel);
return bnd;
}
-
+
public Dependency toDependency(String scope) {
Dependency dep = new Dependency();
dep.setArtifactId(artifactId);
@@ -211,7 +221,7 @@ public class ArtifactDefinition {
dep.setScope(scope);
return dep;
}
-
+
public static Dependency toDependency(Bundle bundle, String scope) {
return new ArtifactDefinition(bundle, 0).toDependency(scope);
}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
index dc848e7..c46da9b 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
@@ -81,7 +81,7 @@ public class CreateBundleJarMojo extends AbstractLaunchpadFrameworkMojo {
for (Bundle bundle : level.getBundles()) {
Artifact artifact = getArtifact(new ArtifactDefinition(bundle,
level.getStartLevel()));
- final String destFileName = getPathForArtifact(level.getStartLevel(), artifact.getFile().getName());
+ final String destFileName = getPathForArtifact(level.getStartLevel(), bundle.getRunModes(), artifact.getFile().getName());
try {
jarArchiver.addFile(artifact.getFile(), destFileName);
} catch (ArchiverException e) {
@@ -168,13 +168,13 @@ public class CreateBundleJarMojo extends AbstractLaunchpadFrameworkMojo {
DirectoryScanner scanner = new DirectoryScanner();
scanner.setBasedir(resource.getDirectory());
if (resource.getIncludes() != null && !resource.getIncludes().isEmpty()) {
- scanner.setIncludes((String[]) resource.getIncludes().toArray(
+ scanner.setIncludes(resource.getIncludes().toArray(
new String[resource.getIncludes().size()]));
} else {
scanner.setIncludes(DEFAULT_INCLUDES);
}
if (resource.getExcludes() != null && !resource.getExcludes().isEmpty()) {
- scanner.setExcludes((String[]) resource.getExcludes().toArray(
+ scanner.setExcludes(resource.getExcludes().toArray(
new String[resource.getExcludes().size()]));
}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
index 229c894..d38d1cf 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
@@ -60,9 +60,10 @@ public class PrepareTestWebAppMojo extends PreparePackageMojo {
*/
private ArtifactHandlerManager artifactHandlerManager;
+ @Override
public void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
super.executeWithArtifacts();
- copy(getPrimaryArtifact(), startLevel, getOutputDirectory());
+ copy(getPrimaryArtifact(), startLevel, null, getOutputDirectory());
}
@Override
diff --git a/src/main/mdo/bundle-list.xml b/src/main/mdo/bundle-list.xml
index dbe123a..0bb9d5c 100644
--- a/src/main/mdo/bundle-list.xml
+++ b/src/main/mdo/bundle-list.xml
@@ -107,6 +107,11 @@
<type>int</type>
<required>true</required>
</field>
+ <field>
+ <name>runModes</name>
+ <version>1.0.0</version>
+ <type>String</type>
+ </field>
</fields>
</class>
</classes>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 20/45: SLING-3205 - avoid confusing
warning on config files
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 1b8ba4756aba20d29a40a2b54e100a2ac619f3cd
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Mon Oct 28 14:07:46 2013 +0000
SLING-3205 - avoid confusing warning on config files
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1536357 13f79535-47bb-0310-9956-ffa450edef68
---
.../projectsupport/BundleListContentProvider.java | 21 ++++++++++++++--
.../BundleListContentProviderTest.java | 28 ++++++++++++++++++++++
2 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
index eb34f54..64442fc 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
@@ -221,6 +221,21 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
return result.iterator();
}
+
+ private Iterator<String> handleConfigSubpath(String path) {
+ // We don't handle config subpaths for now, but do not
+ // warn if we're asked for the children of a file, just
+ // return empty in that case
+ final File f = getConfigFile(path);
+ if(!f.exists()) {
+ getLog().warn("BundleListContentProvider cannot get children of config path: " + path);
+ }
+ return EMPTY_STRING_LIST.iterator();
+ }
+
+ private File getConfigFile(String path) {
+ return new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
+ }
public Iterator<String> getChildren(String path) {
Iterator<String> result = null;
@@ -230,6 +245,8 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
result = EMPTY_STRING_LIST.iterator();
} else if (path.equals(CONFIG_PATH_PREFIX)) {
result = handleConfigPath();
+ } else if (path.startsWith(CONFIG_PATH_PREFIX)) {
+ result = handleConfigSubpath(path);
} else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
result = handleBundlesSubfolder(path);
} else if (path.startsWith(INSTALL_PATH_PREFIX)) {
@@ -241,7 +258,7 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
// as our file URLs point to Maven artifacts
result = EMPTY_STRING_LIST.iterator();
} else {
- getLog().warn("BundleListContentProvider cannot handle path: " + path);
+ getLog().warn("BundleListContentProvider cannot get children of path: " + path);
}
return result;
@@ -249,7 +266,7 @@ abstract class BundleListContentProvider implements LaunchpadContentProvider {
public URL getResource(String path) {
if (path.startsWith(CONFIG_PATH_PREFIX)) {
- File configFile = new File(getConfigDirectory(), path.substring(CONFIG_PATH_PREFIX.length() + 1));
+ final File configFile = getConfigFile(path);
if (configFile.exists()) {
try {
return configFile.toURI().toURL();
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
index 21cbe53..056c018 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -42,7 +42,10 @@ import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
+import org.mockito.Matchers;
import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
/** Test the BundleListContentProvider */
public class BundleListContentProviderTest {
@@ -55,6 +58,7 @@ public class BundleListContentProviderTest {
private File resourceProviderRoot;
private File resourceProviderFile;
private File configDirectory;
+ private int logWarningsCount;
@Rule
public TemporaryFolder tempFolder = new TemporaryFolder();
@@ -99,6 +103,18 @@ public class BundleListContentProviderTest {
@Before
public void setupProvider() {
final Log log = Mockito.mock(Log.class);
+ final Answer<Void> countWarningAnswers = new Answer<Void>() {
+
+ public Void answer(InvocationOnMock invocation) throws Throwable {
+ logWarningsCount++;
+ return null;
+ }
+
+ };
+ Mockito.doAnswer(countWarningAnswers).when(log).warn(Matchers.any(String.class));
+ Mockito.doAnswer(countWarningAnswers).when(log).warn(Matchers.any(Throwable.class));
+ Mockito.doAnswer(countWarningAnswers).when(log).warn(Matchers.any(String.class), Matchers.any(Throwable.class));
+
provider = new BundleListContentProvider(resourceProviderRoot) {
@Override
@@ -229,6 +245,18 @@ public class BundleListContentProviderTest {
}
@Test
+ public void testConfigFile() {
+ assertChildren("resources/config/file1.txt");
+ assertEquals("Expecting no warnings", 0, logWarningsCount);
+ }
+
+ @Test
+ public void testConfigSubpath() {
+ assertChildren("resources/config/someFolder/someSubFolder");
+ assertEquals("Expecting a warning", 1, logWarningsCount);
+ }
+
+ @Test
public void testNonExistentConfigDirectory() {
configDirectory = new File("/NON_EXISTENT_" + System.currentTimeMillis());
assertChildren("resources/config");
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 23/45: SLING-3401 : Support multiple
bundles for jarWebSupport Implement toString and provide a way to get the
contained artifact definitions
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 5fb15830cd53467ad9edf6a1e73d76256af8dd27
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Feb 20 13:12:19 2014 +0000
SLING-3401 : Support multiple bundles for jarWebSupport
Implement toString and provide a way to get the contained artifact definitions
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1570182 13f79535-47bb-0310-9956-ffa450edef68
---
.../maven/projectsupport/ArtifactDefinition.java | 36 +++++++++++++++++-----
1 file changed, 29 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
index 29930a5..f9f6ab3 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -19,6 +19,7 @@ package org.apache.sling.maven.projectsupport;
import static org.apache.sling.maven.projectsupport.BundleListUtils.nodeValue;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.apache.maven.model.Dependency;
@@ -137,12 +138,20 @@ public class ArtifactDefinition {
this.version = version;
}
+ public ArtifactDefinition[] getContainedArtifacts() {
+ return this.bundles;
+ }
+
@Override
public String toString() {
- return "ArtifactDefinition [artifactId=" + artifactId + ", classifier="
- + classifier + ", groupId=" + groupId + ", startLevel="
- + startLevel + ", type=" + type + ", version=" + version
- + ", runModes=" + runModes + "]";
+ if ( this.bundles == null ) {
+ return "ArtifactDefinition [artifactId=" + artifactId + ", classifier="
+ + classifier + ", groupId=" + groupId + ", startLevel="
+ + startLevel + ", type=" + type + ", version=" + version
+ + ", runModes=" + runModes + "]";
+ } else {
+ return "ArtifactDefinition [artifacts=" + Arrays.toString(this.bundles) + "]";
+ }
}
/**
@@ -157,13 +166,26 @@ public class ArtifactDefinition {
* the comma-delimited list
*/
public void initDefaults(String commaDelimitedList) {
- String[] values = commaDelimitedList.split(",");
+ this.initDefaults(commaDelimitedList, ',');
+ }
+
+ /**
+ * Initialize this ArtifactDefinition with a set of default values from a
+ * delimited string. This string must have 6 items in it:
+ * [groupId],[artifactId],[version],[type],[classifier],[startLevel]
+ *
+ * @param valueList the delimited list
+ * @param delimiter the delimiter
+ */
+ public void initDefaults(final String valueList, final char delimiter) {
+ final String delString = "" + delimiter;
+ String[] values = valueList.split(delString);
if (values.length == 0 || values.length % 6 != 0 ) {
throw new IllegalArgumentException(
String
.format(
- "The string %s does not have the correct number of items (a multiple of 6).",
- commaDelimitedList));
+ "The string %s does not have the correct number of items (a multiple of 6) separated by %s",
+ valueList, delString));
}
if ( values.length == 6 ) {
initDefaults(values[0], values[1], values[2], values[3], values[4],
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 06/45: [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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 900df939464f766200ba000e7b7272963aae90d7
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Nov 16 07:50:33 2012 +0000
[maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1410234 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index c0ba955..97a5388 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
</parent>
<artifactId>maven-launchpad-plugin</artifactId>
- <version>2.2.0</version>
+ <version>2.2.1-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Apache Sling Launchpad Maven Plugin</name>
@@ -31,9 +31,9 @@
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.2.0</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.2.0</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.2.0</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 21/45: SLING-3401 Support multiple
bundles for the jarWebSupport
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 066b97b1ed8f453283e3693daa38b71b29dc03cb
Author: Felix Meschberger <fm...@apache.org>
AuthorDate: Thu Feb 20 11:47:18 2014 +0000
SLING-3401 Support multiple bundles for the jarWebSupport
The solution is to extend the ArtifactDefinition to internally support
a collection of ArtifactDefinitions named "bundles".
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1570154 13f79535-47bb-0310-9956-ffa450edef68
---
.../AbstractLaunchpadStartingMojo.java | 2 +-
.../AbstractUsingBundleListMojo.java | 4 +-
.../maven/projectsupport/ArtifactDefinition.java | 113 +++++++++++++--------
.../LaunchpadPluginLifecycleParticipant.java | 28 ++---
.../maven/projectsupport/PreparePackageMojo.java | 2 +-
.../projectsupport/bundlelist/BaseBundleList.java | 21 ++--
6 files changed, 103 insertions(+), 67 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
index 3c5e22b..636a470 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -234,6 +234,6 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
*/
@Override
protected void initBundleList(BundleList bundleList) {
- bundleList.add(jarWebSupport.toBundle());
+ bundleList.add(jarWebSupport.toBundleList());
}
}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 146a134..ac6a0ba 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -255,7 +255,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
// add additional bundles
if (additionalBundles != null) {
for (ArtifactDefinition def : additionalBundles) {
- initializedBundleList.add(def.toBundle());
+ initializedBundleList.add(def.toBundleList());
}
}
@@ -273,7 +273,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
// handle exclusions
if (bundleExclusions != null) {
for (ArtifactDefinition def : bundleExclusions) {
- initializedBundleList.remove(def.toBundle(), false);
+ initializedBundleList.remove(def.toBundleList(), false);
}
}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
index 2183c2e..10285dc 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -18,6 +18,9 @@ package org.apache.sling.maven.projectsupport;
import static org.apache.sling.maven.projectsupport.BundleListUtils.nodeValue;
+import java.util.ArrayList;
+import java.util.List;
+
import org.apache.maven.model.Dependency;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
import org.codehaus.plexus.util.StringUtils;
@@ -49,6 +52,8 @@ public class ArtifactDefinition {
/** The artifact run modes */
private String runModes;
+ private ArtifactDefinition[] bundles;
+
public ArtifactDefinition() {
}
@@ -176,54 +181,80 @@ public class ArtifactDefinition {
*/
public void initDefaults(String groupId, String artifactId, String version,
String type, String classifier, int startLevel) {
- if (this.groupId == null && StringUtils.isNotEmpty(groupId)) {
- this.groupId = groupId;
- }
- if (this.artifactId == null && StringUtils.isNotEmpty(artifactId)) {
- this.artifactId = artifactId;
- }
- if (this.version == null && StringUtils.isNotEmpty(version)) {
- this.version = version;
- }
- if (this.type == null && StringUtils.isNotEmpty(groupId)) {
- this.type = type;
- }
- if (this.classifier == null && StringUtils.isNotEmpty(classifier)) {
- this.classifier = classifier;
- }
- if (this.startLevel == 0) {
- this.startLevel = startLevel;
+ if (this.bundles == null) {
+ if (this.groupId == null && StringUtils.isNotEmpty(groupId)) {
+ this.groupId = groupId;
+ }
+ if (this.artifactId == null && StringUtils.isNotEmpty(artifactId)) {
+ this.artifactId = artifactId;
+ }
+ if (this.version == null && StringUtils.isNotEmpty(version)) {
+ this.version = version;
+ }
+ if (this.type == null && StringUtils.isNotEmpty(groupId)) {
+ this.type = type;
+ }
+ if (this.classifier == null && StringUtils.isNotEmpty(classifier)) {
+ this.classifier = classifier;
+ }
+ if (this.startLevel == 0) {
+ this.startLevel = startLevel;
+ }
+ } else {
+ for (ArtifactDefinition bundle : this.bundles) {
+ bundle.initDefaults(groupId, artifactId, version, type, classifier, startLevel);
+ }
}
}
- public Bundle toBundle() {
- Bundle bnd = new Bundle();
- bnd.setArtifactId(artifactId);
- bnd.setGroupId(groupId);
- bnd.setVersion(version);
- if (type != null) {
- bnd.setType(type);
+ public List<Bundle> toBundleList() {
+ ArrayList<Bundle> bundleList = new ArrayList<Bundle>();
+
+ if (bundles == null) {
+ Bundle bnd = new Bundle();
+ bnd.setArtifactId(artifactId);
+ bnd.setGroupId(groupId);
+ bnd.setVersion(version);
+ if (type != null) {
+ bnd.setType(type);
+ }
+ bnd.setClassifier(classifier);
+ bnd.setStartLevel(startLevel);
+ bundleList.add(bnd);
+ } else {
+ for (ArtifactDefinition bundle : bundles) {
+ bundleList.addAll(bundle.toBundleList());
+ }
}
- bnd.setClassifier(classifier);
- bnd.setStartLevel(startLevel);
- return bnd;
- }
-
- public Dependency toDependency(String scope) {
- Dependency dep = new Dependency();
- dep.setArtifactId(artifactId);
- dep.setGroupId(groupId);
- dep.setVersion(version);
- if (type != null) {
- dep.setType(type);
+
+ return bundleList;
+ }
+
+ public List<Dependency> toDependencyList(String scope) {
+ ArrayList<Dependency> depList = new ArrayList<Dependency>();
+
+ if (bundles == null) {
+ Dependency dep = new Dependency();
+ dep.setArtifactId(artifactId);
+ dep.setGroupId(groupId);
+ dep.setVersion(version);
+ if (type != null) {
+ dep.setType(type);
+ }
+ dep.setClassifier(classifier);
+ dep.setScope(scope);
+ depList.add(dep);
+ } else {
+ for (ArtifactDefinition bundle : bundles) {
+ depList.addAll(bundle.toDependencyList(scope));
+ }
}
- dep.setClassifier(classifier);
- dep.setScope(scope);
- return dep;
+
+ return depList;
}
- public static Dependency toDependency(Bundle bundle, String scope) {
- return new ArtifactDefinition(bundle, 0).toDependency(scope);
+ public static List<Dependency> toDependencyList(Bundle bundle, String scope) {
+ return new ArtifactDefinition(bundle, 0).toDependencyList(scope);
}
}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java b/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java
index 57dd147..b7dc8d1 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/LaunchpadPluginLifecycleParticipant.java
@@ -5,9 +5,9 @@
* licenses this file to You under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -50,7 +50,7 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
public class LaunchpadPluginLifecycleParticipant extends AbstractMavenLifecycleParticipant {
private static final String PLUGIN_ID = "maven-launchpad-plugin";
-
+
private static final String PROVIDED = "provided";
@Requirement
@@ -100,43 +100,43 @@ public class LaunchpadPluginLifecycleParticipant extends AbstractMavenLifecycleP
void addDependencies() throws Exception {
readConfiguration();
-
+
addBundleListDependencies();
if (hasPreparePackageExecution()) {
if (includeDefaultBundles && !isCurrentArtifact(project, defaultBundleList)) {
log.debug(String.format("adding default bundle list (%s) to dependencies of project %s", defaultBundleList, project));
- project.getDependencies().add(defaultBundleList.toDependency(PROVIDED));
+ project.getDependencies().addAll(defaultBundleList.toDependencyList(PROVIDED));
}
if (hasJarPackagingExecution()) {
log.debug(String.format("adding jar web support (%s) to dependencies of project %s", jarWebSupport, project));
- project.getDependencies().add(jarWebSupport.toDependency(PROVIDED));
+ project.getDependencies().addAll(jarWebSupport.toDependencyList(PROVIDED));
}
}
}
private void addBundleListDependencies() throws IOException, XmlPullParserException, MojoExecutionException {
BundleList bundleList;
-
+
if (bundleListFile.exists()) {
bundleList = readBundleList(bundleListFile);
} else {
bundleList = new BundleList();
}
-
+
if (additionalBundles != null) {
for (ArtifactDefinition def : additionalBundles) {
- bundleList.add(def.toBundle());
+ bundleList.add(def.toBundleList());
}
}
-
+
interpolateProperties(bundleList, project, session);
-
+
for (StartLevel startLevel : bundleList.getStartLevels()) {
for (Bundle bundle : startLevel.getBundles()) {
log.debug(String.format("adding bundle (%s) from bundle list to dependencies of project %s", bundle, project));
- project.getDependencies().add(ArtifactDefinition.toDependency(bundle, PROVIDED));
+ project.getDependencies().addAll(ArtifactDefinition.toDependencyList(bundle, PROVIDED));
}
}
}
@@ -161,10 +161,10 @@ public class LaunchpadPluginLifecycleParticipant extends AbstractMavenLifecycleP
if (bundleListFileConfig != null) {
bundleListFile = new File(project.getBasedir(), bundleListFileConfig.getValue());
}
-
+
configureAdditionalBundles(configuration);
}
-
+
for (PluginExecution execution : plugin.getExecutions()) {
Xpp3Dom executionConfiguration = (Xpp3Dom) execution.getConfiguration();
if (executionConfiguration != null) {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
index 521472d..e5c3612 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -136,7 +136,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
@Override
protected void initBundleList(BundleList bundleList) {
if (packaging.equals(JAR)) {
- bundleList.add(jarWebSupport.toBundle());
+ bundleList.add(jarWebSupport.toBundleList());
}
}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
index 1c7bc56..230aa49 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/bundlelist/BaseBundleList.java
@@ -39,16 +39,19 @@ public abstract class BaseBundleList {
return null;
}
- public boolean remove(Bundle bundle, boolean compareVersions) {
- for (StartLevel sl : getStartLevels()) {
- if (sl.removeBundle(bundle, compareVersions)) {
- return true;
+ public boolean remove(List<Bundle> bundles, boolean compareVersions) {
+ boolean result = false;
+ for (Bundle bundle : bundles) {
+ for (StartLevel sl : getStartLevels()) {
+ if (sl.removeBundle(bundle, compareVersions)) {
+ result = true;
+ break;
+ }
}
}
- return false;
+ return result;
}
-
/**
* Merge the current bundle list with an additional list.
* @see #add(Bundle)
@@ -69,8 +72,10 @@ public abstract class BaseBundleList {
*
* @param newBnd the bundle to add
*/
- public void add(Bundle newBnd) {
- add(null, newBnd);
+ public void add(List<Bundle> newBnd) {
+ for (Bundle bundle : newBnd) {
+ add(null, bundle);
+ }
}
/**
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 16/45: SLING-3142 :
NullPointerException with Java8 in AbstractUsingBundleList
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 477f0b1d0fd5b6916ae402fca2ab23300e208f15
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Oct 4 05:56:14 2013 +0000
SLING-3142 : NullPointerException with Java8 in AbstractUsingBundleList
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1529083 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java | 2 +-
.../sling/maven/projectsupport/AbstractUsingBundleListMojo.java | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
index bb27287..2b45cc6 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -300,7 +300,7 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
File tmp = null;
try {
tmp = File.createTempFile("sling", "props");
- mavenFileFilter.copyFile(propertiesFile, tmp, true, project, null, true,
+ mavenFileFilter.copyFile(propertiesFile, tmp, true, project, Collections.EMPTY_LIST, true,
System.getProperty("file.encoding"), mavenSession);
Properties loadedProps = PropertyUtils.loadPropertyFile(tmp, null);
for (Object key : loadedProps.keySet()) {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 41e45a4..146a134 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -23,6 +23,7 @@ import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Set;
@@ -408,7 +409,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
File tmp = null;
try {
tmp = File.createTempFile("sling", "props");
- mavenFileFilter.copyFile(propsFile, tmp, true, project, null, true,
+ mavenFileFilter.copyFile(propsFile, tmp, true, project, Collections.EMPTY_LIST, true,
System.getProperty("file.encoding"), mavenSession);
final Properties loadedProps = PropertyUtils.loadPropertyFile(tmp, null);
if ( mode == 0 ) {
@@ -482,7 +483,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
Reader reader = null;
try {
tmp = File.createTempFile("sling", "bootstrap");
- mavenFileFilter.copyFile(bootstrapFile, tmp, true, project, null, true,
+ mavenFileFilter.copyFile(bootstrapFile, tmp, true, project, Collections.EMPTY_LIST, true,
System.getProperty("file.encoding"), mavenSession);
reader = new FileReader(tmp);
final StringBuilder sb = new StringBuilder();
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 04/45: SLING-2662 : Enhance run mode
handling
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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit e032914e752837c3a07283847aa20609d505f9ea
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Nov 15 08:04:01 2012 +0000
SLING-2662 : Enhance run mode handling
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1409683 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 5 +++
.../projectsupport/AbstractBundleListMojo.java | 37 ++++++++++++++++++++++
.../AbstractUsingBundleListMojo.java | 19 ++++++-----
.../maven/projectsupport/AttachBundleListMojo.java | 4 +--
.../AttachPartialBundleListMojo.java | 4 +--
.../maven/projectsupport/PreparePackageMojo.java | 6 ++--
6 files changed, 61 insertions(+), 14 deletions(-)
diff --git a/pom.xml b/pom.xml
index 04a33dd..f0e0ff9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -148,6 +148,11 @@
<version>1.5.15</version>
</dependency>
<dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>2.4</version>
+ </dependency>
+ <dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.1</version>
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 eca43fe..a2f5566 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -17,6 +17,8 @@
package org.apache.sling.maven.projectsupport;
import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
import java.util.List;
import org.apache.maven.artifact.Artifact;
@@ -35,6 +37,7 @@ import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
+import org.codehaus.plexus.util.SelectorUtils;
import org.codehaus.plexus.util.StringUtils;
public abstract class AbstractBundleListMojo extends AbstractMojo {
@@ -219,4 +222,38 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
return artifact;
}
+ /**
+ * Helper method to copy a whole directory
+ */
+ protected void copyDirectory(final File source, final File target, final String[] includes, final String[] excludes)
+ throws IOException {
+ final String prefix = source.getAbsolutePath() + File.separatorChar;
+ final int prefixLength = prefix.length();
+ org.apache.commons.io.FileUtils.copyDirectory(source, target, new FileFilter() {
+
+ public boolean accept(final File file) {
+ final String path = file.getAbsolutePath().substring(prefixLength).replace(File.separatorChar, '/');
+ if ( includes != null ) {
+ boolean matched = false;
+ for(int i = 0; i<includes.length && !matched; i++) {
+ if ( SelectorUtils.matchPath(includes[i], path)) {
+ matched = true;
+ }
+ }
+ if ( !matched ) {
+ return false;
+ }
+ }
+ if ( excludes != null ) {
+ for(final String pattern:excludes) {
+ if ( SelectorUtils.matchPath(pattern, path)) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+ });
+ }
+
}
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 5640cba..41e45a4 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -38,7 +38,6 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
@@ -293,8 +292,7 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
}
// copy own config files
if ( this.overlayConfigDir != null && super.getConfigDirectory().exists() ) {
- FileUtils.copyDirectory(super.getConfigDirectory(), this.overlayConfigDir,
- null, FileUtils.getDefaultExcludesAsString());
+ copyDirectory(super.getConfigDirectory(), this.overlayConfigDir, null, FileUtils.getDefaultExcludes());
}
}
@@ -337,15 +335,20 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
this.tempConfigDir.mkdirs();
this.overlayConfigDir = this.tempConfigDir;
}
- String excludes = FileUtils.getDefaultExcludesAsString();
+ final String[] defaultExcludes = FileUtils.getDefaultExcludes();
+ String[] excludes;
if ( this.configExcludes != null ) {
- excludes = excludes + ',' + StringUtils.join(this.configExcludes, ",");
+ excludes = new String[defaultExcludes.length + this.configExcludes.length];
+ System.arraycopy(defaultExcludes, 0, excludes, 0, defaultExcludes.length);
+ System.arraycopy(this.configExcludes, 0, excludes, defaultExcludes.length, this.configExcludes.length);
+ } else {
+ excludes = defaultExcludes;
}
- String includes = null;
+ String[] includes = null;
if ( this.configIncludes != null ) {
- includes = StringUtils.join(this.configIncludes, ",");
+ includes = this.configIncludes;
}
- FileUtils.copyDirectory(configDir, this.overlayConfigDir,
+ copyDirectory(configDir, this.overlayConfigDir,
includes, excludes);
}
} catch (final ArchiverException ae) {
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 6f40dc0..fe9d538 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
@@ -142,8 +142,8 @@ public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
if ( this.checkFile(this.getConfigDirectory()) ) {
final File configDir = new File(this.configOutputDir, "config");
configDir.mkdirs();
- FileUtils.copyDirectory(this.getConfigDirectory(), configDir,
- null, FileUtils.getDefaultExcludesAsString());
+ copyDirectory(this.getConfigDirectory(), configDir,
+ null, FileUtils.getDefaultExcludes());
}
final File destFile = new File(this.configOutputDir.getParent(), this.configOutputDir.getName() + ".zip");
zipArchiver.setDestFile(destFile);
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
index f909a35..2f4caf5 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -178,8 +178,8 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
if ( this.checkFile(this.getConfigDirectory()) ) {
final File configDir = new File(this.configOutputDir, "config");
configDir.mkdirs();
- FileUtils.copyDirectory(this.getConfigDirectory(), configDir,
- null, FileUtils.getDefaultExcludesAsString());
+ copyDirectory(this.getConfigDirectory(), configDir,
+ null, FileUtils.getDefaultExcludes());
}
final File destFile = new File(this.configOutputDir.getParent(), this.configOutputDir.getName() + ".zip");
zipArchiver.setDestFile(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 378857c..5a541cd 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -107,6 +107,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
*/
private JarArchiver jarArchiver;
+ @Override
public void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
copyBaseArtifact();
copyBundles(getInitializedBundleList(), getOutputDirectory());
@@ -116,6 +117,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
}
}
+ @Override
protected void initArtifactDefinitions(Properties dependencies) {
if (base == null) {
base = new ArtifactDefinition();
@@ -278,7 +280,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
}
private Artifact getBaseDependency() {
- return (Artifact) project.getArtifactMap().get(
+ return project.getArtifactMap().get(
base.getGroupId() + ":" + base.getArtifactId());
}
@@ -303,7 +305,7 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
private void copyConfigurationFiles() throws MojoExecutionException {
try {
- FileUtils.copyDirectory(this.getConfigDirectory(), new File(getOutputDirectory(), CONFIG_PATH_PREFIX), null, FileUtils.getDefaultExcludesAsString());
+ copyDirectory(this.getConfigDirectory(), new File(getOutputDirectory(), CONFIG_PATH_PREFIX), null, FileUtils.getDefaultExcludes());
} 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] 38/45: SLING-4698 - Set
parent.relativePath to empty for all modules
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit e53611ba59496a0fc9df55003a928c51b497be1e
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu May 7 10:14:40 2015 +0000
SLING-4698 - Set parent.relativePath to empty for all modules
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1678154 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 4b77d1f..9f407d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,7 +18,7 @@
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
<version>22</version>
- <relativePath>../../parent/pom.xml</relativePath>
+ <relativePath/>
</parent>
<artifactId>maven-launchpad-plugin</artifactId>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 42/45: SLING-5107 - Switch to Java
annotations for Maven plugins
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 52e8f45aee94ddc4ad67b72c3811c4b8b2517711
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Oct 7 07:58:15 2015 +0000
SLING-5107 - Switch to Java annotations for Maven plugins
Switch to Java annotations for the maven-launchpad-plugin
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1707200 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 29 ++++++--
.../projectsupport/AbstractBundleListMojo.java | 86 +++++-----------------
.../AbstractLaunchpadFrameworkMojo.java | 10 +--
.../AbstractLaunchpadStartingMojo.java | 18 ++---
.../AbstractUsingBundleListMojo.java | 43 ++++-------
.../maven/projectsupport/AttachBundleListMojo.java | 23 +++---
.../AttachPartialBundleListMojo.java | 21 +++---
.../CheckBundleListForSnapshotsMojo.java | 11 ++-
.../maven/projectsupport/CreateBundleJarMojo.java | 25 +++----
.../CreateKarafFeatureDescriptorMojo.java | 28 +++----
.../CreatePaxRunnerBundleProvisionFileMojo.java | 13 ++--
.../projectsupport/DisplayBundleUpdatesMojo.java | 61 +++++----------
.../maven/projectsupport/OutputBundleListMojo.java | 7 +-
.../maven/projectsupport/PreparePackageMojo.java | 38 ++++------
.../projectsupport/PrepareTestWebAppMojo.java | 24 +++---
.../apache/sling/maven/projectsupport/RunMojo.java | 7 +-
.../sling/maven/projectsupport/StartMojo.java | 16 ++--
.../sling/maven/projectsupport/StatusMojo.java | 15 ++--
.../sling/maven/projectsupport/StopMojo.java | 15 ++--
19 files changed, 182 insertions(+), 308 deletions(-)
diff --git a/pom.xml b/pom.xml
index f0eafe7..a12e40f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -39,6 +39,23 @@
<build>
<plugins>
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>default-descriptor</id>
+ <phase>process-classes</phase>
+ </execution>
+ <execution>
+ <id>help-goal</id>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<version>1.8.1</version>
@@ -96,11 +113,6 @@
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-plugin-plugin</artifactId>
- <version>2.5.1</version>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<!-- No javadocs -->
@@ -227,5 +239,12 @@
<version>1.9.5</version>
<scope>test</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-annotations</artifactId>
+ <version>3.4</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
</project>
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
index a2f5566..17e548c 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractBundleListMojo.java
@@ -35,6 +35,8 @@ import org.apache.maven.artifact.versioning.VersionRange;
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
import org.codehaus.plexus.util.SelectorUtils;
@@ -47,117 +49,67 @@ public abstract class AbstractBundleListMojo extends AbstractMojo {
*/
protected static final String PARTIAL = "partialbundlelist";
- /**
- * @parameter default-value="${basedir}/src/main/bundles/list.xml"
- */
+ @Parameter(defaultValue = "${basedir}/src/main/bundles/list.xml")
protected File bundleListFile;
/**
* The Maven project.
- *
- * @parameter expression="${project}"
- * @required
- * @readonly
*/
+ @Parameter(defaultValue = "${project}", readonly = true)
protected MavenProject project;
- /**
- * @component
- */
+ @Component
protected MavenProjectHelper projectHelper;
- /**
- * @parameter expression="${configDirectory}"
- * default-value="src/main/config"
- */
+ @Parameter(property = "configDirectory", defaultValue = "src/main/config")
private File configDirectory;
- /**
- * @parameter expression="${commonSlingProps}"
- * default-value="src/main/sling/common.properties"
- */
+ @Parameter(property = "commonSlingProps", defaultValue = "src/main/sling/common.properties")
protected File commonSlingProps;
- /**
- * @parameter expression="${commonSlingBootstrap}"
- * default-value="src/main/sling/common.bootstrap.txt"
- */
+ @Parameter(property = "commonSlingBootstrap", defaultValue = "src/main/sling/common.bootstrap.txt")
protected File commonSlingBootstrap;
- /**
- * @parameter expression="${webappSlingProps}"
- * default-value="src/main/sling/webapp.properties"
- */
+ @Parameter(property = "webappSlingProps", defaultValue = "src/main/sling/webapp.properties")
protected File webappSlingProps;
- /**
- * @parameter expression="${webappSlingBootstrap}"
- * default-value="src/main/sling/webapp.bootstrap.txt"
- */
+ @Parameter(property = "webappSlingBootstrap", defaultValue = "src/main/sling/webapp.bootstrap.txt")
protected File webappSlingBootstrap;
- /**
- * @parameter expression="${standaloneSlingProps}"
- * default-value="src/main/sling/standalone.properties"
- */
+ @Parameter(property = "standaloneSlingProps", defaultValue = "src/main/sling/standalone.properties")
protected File standaloneSlingProps;
- /**
- * @parameter expression="${standaloneSlingBootstrap}"
- * default-value="src/main/sling/standalone.bootstrap.txt"
- */
+ @Parameter(property = "standaloneSlingBootstrap", defaultValue = "src/main/sling/standalone.bootstrap.txt")
protected File standaloneSlingBootstrap;
- /**
- * @parameter expression="${ignoreBundleListConfig}"
- * default-value="false"
- */
+ @Parameter(property="ignoreBundleListConfig", defaultValue = "false")
protected boolean ignoreBundleListConfig;
- /**
- * @parameter expression="${session}
- * @required
- * @readonly
- */
+ @Parameter(defaultValue = "${session}", readonly = true)
protected MavenSession mavenSession;
/**
* Used to look up Artifacts in the remote repository.
- *
- * @component
*/
+ @Component
private ArtifactFactory factory;
/**
* Used to look up Artifacts in the remote repository.
- *
- * @component hint="maven"
*/
+ @Component(hint = "maven")
private ArtifactMetadataSource metadataSource;
/**
* Location of the local repository.
- *
- * @parameter expression="${localRepository}"
- * @readonly
- * @required
*/
+ @Parameter( defaultValue = "${localRepository}", readonly = true, required = true)
private ArtifactRepository local;
- /**
- * List of Remote Repositories used by the resolver.
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- * @readonly
- * @required
- */
+ @Parameter( defaultValue = "${project.remoteArtifactRepositories}", readonly = true, required = true)
private List<ArtifactRepository> remoteRepos;
- /**
- * Used to look up Artifacts in the remote repository.
- *
- * @component
- */
+ @Component
private ArtifactResolver resolver;
protected File getConfigDirectory() {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
index 23d16d0..551b665 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadFrameworkMojo.java
@@ -23,6 +23,7 @@ import java.util.TreeSet;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
@@ -37,23 +38,20 @@ public abstract class AbstractLaunchpadFrameworkMojo extends AbstractUsingBundle
/**
* The name of the directory within the output directory into which the base
* JAR should be installed.
- *
- * @parameter default-value="resources"
*/
+ @Parameter(defaultValue = "resources")
protected String baseDestination;
/**
* The directory which contains the start-level bundle directories.
- *
- * @parameter default-value="bundles"
*/
+ @Parameter(defaultValue = "bundles")
private String bundlesDirectory;
/**
* The directory which contains the bootstrap bundle directories.
- *
- * @parameter
*/
+ @Parameter
private String bootDirectory;
protected String getPathForArtifact(final int startLevel, final String artifactName, final String runModes) {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
index 636a470..9c64df0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractLaunchpadStartingMojo.java
@@ -29,6 +29,7 @@ import org.apache.felix.framework.Logger;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.shared.filtering.MavenFilteringException;
import org.apache.maven.shared.filtering.PropertyUtils;
import org.apache.sling.launchpad.api.LaunchpadContentProvider;
@@ -71,26 +72,17 @@ public abstract class AbstractLaunchpadStartingMojo extends AbstractUsingBundleL
/**
* The definition of the package to be included to provide web support for
* JAR-packaged projects (i.e. pax-web).
- *
- * @parameter
*/
+ @Parameter
private ArtifactDefinition jarWebSupport;
- /**
- * @parameter expression="${felix.log.level}"
- */
+ @Parameter(property = "felix.log.level")
private String logLevel;
- /**
- * @parameter expression="${propertiesFile}"
- * default-value="src/test/config/sling.properties"
- */
+ @Parameter(property = "propertiesFile", defaultValue = "src/test/config/sling.properties")
private File propertiesFile;
- /**
- * @parameter expression="${resourceProviderRoot}"
- * default-value="src/test/resources"
- */
+ @Parameter(property = "resourceProviderRoot", defaultValue = "src/test/resources")
private File resourceProviderRoot;
private LaunchpadContentProvider resourceProvider = new BundleListContentProvider(resourceProviderRoot) {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index 4605275..b8ded24 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -31,12 +31,15 @@ import java.util.Set;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.shared.filtering.MavenFileFilter;
import org.apache.maven.shared.filtering.MavenFilteringException;
import org.apache.maven.shared.filtering.PropertyUtils;
import org.apache.sling.maven.projectsupport.BundleListUtils.ArtifactDefinitionsCallback;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -74,73 +77,61 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
/**
* The definition of the defaultBundleList artifact.
- *
- * @parameter
*/
+ @Parameter
protected ArtifactDefinition defaultBundleList;
/**
* Any additional bundles to include in the project's bundles directory.
- *
- * @parameter
*/
+ @Parameter
private ArtifactDefinition[] additionalBundles;
private BundleList initializedBundleList;
/**
* Bundles which should be removed from the project's bundles directory.
- *
- * @parameter
*/
+ @Parameter
private ArtifactDefinition[] bundleExclusions;
/**
* If true, include the default bundles.
- *
- * @parameter expression="${includeDefaultBundles}" default-value="true"
*/
+ @Parameter( property = "includeDefaultBundles", defaultValue = "true")
private boolean includeDefaultBundles;
- /**
- * @parameter
- */
+ @Parameter
private File[] rewriteRuleFiles;
/**
* The list of tokens to include when copying configs
* from partial bundle lists.
- *
- * @parameter default-value="**"
*/
+ @Parameter( defaultValue = "**")
private String[] configIncludes;
/**
* The list of tokens to exclude when copying the configs
* from partial bundle lists.
- *
- * @parameter
*/
+ @Parameter
private String[] configExcludes;
/**
* The list of names to exclude when copying properties
* from partial bundle lists.
- *
- * @parameter
*/
+ @Parameter
private String[] propertiesExcludes;
- /**
- * @component
- */
+ @Component
protected MavenFileFilter mavenFileFilter;
/**
* The zip unarchiver.
- *
- * @component role="org.codehaus.plexus.archiver.UnArchiver" roleHint="zip"
*/
+ @Component(role = UnArchiver.class, hint = "zip")
private ZipUnArchiver zipUnarchiver;
private Properties slingProperties;
@@ -155,14 +146,10 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
private String slingStandaloneBootstrapCommand;
- /**
- * @parameter default-value="${project.build.directory}/tmpBundleListconfig"
- */
+ @Parameter(defaultValue = "${project.build.directory}/tmpBundleListconfig")
private File tmpOutputDir;
- /**
- * @parameter default-value="${project.build.directory}/tmpConfigDir"
- */
+ @Parameter(defaultValue = "${project.build.directory}/tmpConfigDir")
private File tempConfigDir;
private File overlayConfigDir;
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
index fe9d538..4e1529f 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachBundleListMojo.java
@@ -23,36 +23,33 @@ import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Writer;
import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.zip.ZipArchiver;
import org.codehaus.plexus.util.FileUtils;
/**
* Attaches the bundle list as a project artifact.
- *
- * @goal attach-bundle-list
- * @phase package
- * @requiresDependencyResolution test
- * @description attach the bundle list as a project artifact
*/
+@Mojo(name = "attach-bundle-list", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
public class AttachBundleListMojo extends AbstractUsingBundleListMojo {
- /**
- * @parameter default-value="${project.build.directory}/bundleList.xml"
- */
+ @Parameter(defaultValue = "${project.build.directory}/bundleList.xml")
private File outputFile;
- /**
- * @parameter default-value="${project.build.directory}/bundleListconfig"
- */
+ @Parameter(defaultValue = "${project.build.directory}/bundleListconfig")
private File configOutputDir;
/**
* The zip archiver.
- *
- * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="zip"
*/
+ @Component(role = UnArchiver.class, hint = "zip")
private ZipArchiver zipArchiver;
private final BundleListXpp3Writer writer = new BundleListXpp3Writer();
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
index 2f4caf5..5719068 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AttachPartialBundleListMojo.java
@@ -25,21 +25,23 @@ import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Writer;
import org.codehaus.plexus.archiver.ArchiverException;
+import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.zip.ZipArchiver;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
/**
* Attaches the bundle list as a project artifact.
- *
- * @goal attach-partial-bundle-list
- * @phase package
- * @requiresDependencyResolution test
- * @description attach the partial bundle list as a project artifact
*/
+@Mojo( name = "attach-partial-bundle-list", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
public static final String CONFIG_CLASSIFIER = "bundlelistconfig";
@@ -62,14 +64,10 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
public static final String SLING_STANDALONE_BOOTSTRAP = "standalone.bootstrap.txt";
- /**
- * @parameter default-value="${project.build.directory}/bundleListconfig"
- */
+ @Parameter( defaultValue = "${project.build.directory}/bundleListconfig")
private File configOutputDir;
- /**
- * @parameter default-value="${project.build.directory}/list.xml"
- */
+ @Parameter( defaultValue = "${project.build.directory}/list.xml")
private File bundleListOutput;
/**
@@ -77,6 +75,7 @@ public class AttachPartialBundleListMojo extends AbstractBundleListMojo {
*
* @component role="org.codehaus.plexus.archiver.Archiver" roleHint="zip"
*/
+ @Component(role = UnArchiver.class, hint = "zip")
private ZipArchiver zipArchiver;
public void execute() throws MojoExecutionException, MojoFailureException {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
index 59e92cf..8bd6c17 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CheckBundleListForSnapshotsMojo.java
@@ -21,6 +21,9 @@ import java.util.List;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
@@ -28,18 +31,14 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
/**
* Validate that the bundle list file (if it exists) does not contain references
* to SNAPSHOT versions.
- *
- * @goal check-bundle-list-for-snapshots
- * @requiresDependencyResolution test
- *
*/
+@Mojo(name = "check-bundle-list-for-snapshots", requiresDependencyResolution = ResolutionScope.TEST)
public class CheckBundleListForSnapshotsMojo extends AbstractUsingBundleListMojo {
/**
* True if the build should be failed if a snapshot is found.
- *
- * @parameter default-value="true"
*/
+ @Parameter( defaultValue = "true")
private boolean failOnSnapshot;
@Override
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
index c46da9b..160828f 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateBundleJarMojo.java
@@ -23,9 +23,15 @@ import org.apache.maven.artifact.Artifact;
import org.apache.maven.model.Resource;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
+import org.codehaus.plexus.archiver.Archiver;
import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.jar.JarArchiver;
import org.codehaus.plexus.util.DirectoryScanner;
@@ -33,41 +39,32 @@ import org.codehaus.plexus.util.DirectoryScanner;
/**
* Create and attach a JAR file containing the resolved artifacts from the
* bundle list.
- *
- * @goal create-bundle-jar
- * @requiresDependencyResolution test
- * @phase package
- *
*/
+@Mojo( name = "create-bundle-jar", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
public class CreateBundleJarMojo extends AbstractLaunchpadFrameworkMojo {
/**
* The list of resources we want to add to the bundle JAR file.
- *
- * @parameter
*/
+ @Parameter
private Resource[] resources;
/**
* The output directory.
- *
- * @parameter default-value="${project.build.directory}"
*/
+ @Parameter( defaultValue = "${project.build.directory}")
private File outputDirectory;
/**
* Name of the generated JAR.
- *
- * @parameter default-value="${project.artifactId}-${project.version}"
- * @required
*/
+ @Parameter( defaultValue = "${project.artifactId}-${project.version}", required = true)
private String jarName;
/**
* The Jar archiver.
- *
- * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
*/
+ @Component( role = Archiver.class, hint = "jar")
private JarArchiver jarArchiver;
private static final String CLASSIFIER = "bundles";
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
index 504d9cd..1e4aca0 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreateKarafFeatureDescriptorMojo.java
@@ -22,6 +22,10 @@ import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
@@ -32,38 +36,24 @@ import org.jdom.output.XMLOutputter;
/**
* Create and attach a karaf feature descriptor XML file.
- *
- * @goal create-karaf-descriptor
- * @phase package
- * @description create a karaf feature descriptor
- * @requiresDependencyResolution test
*/
+@Mojo(name = "create-karaf-descriptor", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
public class CreateKarafFeatureDescriptorMojo extends AbstractUsingBundleListMojo {
private static final String CLASSIFIER = "features";
private static final String TYPE = "xml";
- /**
- * @parameter default-value="sling"
- */
+ @Parameter(defaultValue = "sling")
private String featureName;
- /**
- * @parameter default-value="sling-2.0"
- */
+ @Parameter(defaultValue = "sling-2.0")
private String featuresName;
- /**
- * @parameter default-value="${project.version}"
- */
+ @Parameter(defaultValue = "${project.version}")
private String featureVersion;
- /**
- * The output directory.
- *
- * @parameter default-value="${project.build.directory}/features.xml"
- */
+ @Parameter(defaultValue = "{project.build.directory}/features.xml")
private File outputFile;
@Override
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java
index 9e98997..716f8d6 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java
@@ -22,18 +22,18 @@ import java.io.IOException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
/**
* Create and attach a Pax Runner bundle provision file.
- *
- * @goal create-paxrunner-provision-file
- * @phase package
- * @description create a Pax Runner bundle provision file
- * @requiresDependencyResolution test
*/
+@Mojo(name = "create-paxrunner-provision-file", defaultPhase = LifecyclePhase.PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
public class CreatePaxRunnerBundleProvisionFileMojo extends AbstractUsingBundleListMojo {
private static final String CLASSIFIER = "bundles";
@@ -42,9 +42,8 @@ public class CreatePaxRunnerBundleProvisionFileMojo extends AbstractUsingBundleL
/**
* The output directory.
- *
- * @parameter default-value="${project.build.directory}/bundles-pax"
*/
+ @Parameter(defaultValue = "${project.build.directory}/bundles-pax")
private File outputFile;
@Override
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
index 7f11573..5aeb3af 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/DisplayBundleUpdatesMojo.java
@@ -35,6 +35,9 @@ import org.apache.maven.model.Dependency;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.path.PathTranslator;
import org.apache.maven.settings.Settings;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
@@ -53,9 +56,9 @@ import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
* display-dependency-updates goal from the Versions plugin.
*
* @since 2.0.8
- * @goal display-bundle-updates
*
*/
+@Mojo(name = "display-bundle-updates")
public class DisplayBundleUpdatesMojo extends AbstractMojo {
/**
@@ -63,91 +66,61 @@ public class DisplayBundleUpdatesMojo extends AbstractMojo {
*/
private static final int INFO_PAD_SIZE = 72;
- /**
- * @component
- */
+ @Component
private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory;
/**
* The artifact metadata source to use.
- *
- * @component
- * @required
- * @readonly
*/
+ @Component
private ArtifactMetadataSource artifactMetadataSource;
- /**
- * @parameter expression="${project.remoteArtifactRepositories}"
- * @readonly
- */
+ @Parameter( defaultValue = "${project.remoteArtifactRepositories}", readonly = true)
private List<ArtifactRepository> remoteArtifactRepositories;
- /**
- * @parameter expression="${project.pluginArtifactRepositories}"
- * @readonly
- */
+ @Parameter( defaultValue = "${project.pluginArtifactRepositories}", readonly = true)
private List<ArtifactRepository> remotePluginRepositories;
- /**
- * @parameter expression="${localRepository}"
- * @readonly
- */
+ @Parameter( defaultValue = "${localRepository}", readonly = true)
private ArtifactRepository localRepository;
- /**
- * @component
- */
+ @Component
private WagonManager wagonManager;
- /**
- * @parameter expression="${settings}"
- * @readonly
- */
+ @Parameter(defaultValue = "${settings}", readonly = true)
private Settings settings;
/**
* settings.xml's server id for the URL. This is used when wagon needs extra
* authentication information.
- *
- * @parameter expression="${maven.version.rules.serverId}"
- * default-value="serverId";
*/
+ @Parameter(property = "maven.version.rules.serverId", defaultValue = "serverId")
private String serverId;
/**
* The Wagon URI of a ruleSet file containing the rules that control how to
* compare version numbers.
- *
- * @parameter expression="${maven.version.rules}"
*/
+ @Parameter(defaultValue = "maven.version.rules")
private String rulesUri;
/**
* The Maven Session.
- *
- * @parameter expression="${session}"
- * @required
- * @readonly
*/
+ @Parameter(defaultValue = "${session}", required = true)
private MavenSession session;
- /**
- * @component
- */
+ @Component
private PathTranslator pathTranslator;
- /**
- * @parameter default-value="${basedir}/src/main/bundles/list.xml"
- */
+ @Parameter(defaultValue = "${basedir}/src/main/bundles/list.xml")
private File bundleListFile;
/**
* Whether to allow snapshots when searching for the latest version of an
* artifact.
- *
- * @parameter expression="${allowSnapshots}" default-value="false"
*/
+ @Parameter(property = "allowSnapshots", defaultValue = "false")
private boolean allowSnapshots;
/**
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
index 31d0523..354a67a 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/OutputBundleListMojo.java
@@ -21,15 +21,14 @@ import java.io.OutputStreamWriter;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.io.xpp3.BundleListXpp3Writer;
/**
* Output the bundle list back to the console.
- *
- * @goal output-bundle-list
- * @requiresDependencyResolution test
- *
*/
+@Mojo( name = "output-bundle-list", requiresDependencyResolution = ResolutionScope.TEST)
public class OutputBundleListMojo extends AbstractUsingBundleListMojo {
@Override
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
index e5c3612..f416c28 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -27,7 +27,13 @@ import java.util.Properties;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.codehaus.plexus.archiver.Archiver;
import org.codehaus.plexus.archiver.ArchiverException;
import org.codehaus.plexus.archiver.UnArchiver;
import org.codehaus.plexus.archiver.jar.JarArchiver;
@@ -38,73 +44,59 @@ import org.codehaus.plexus.util.FileUtils;
/**
* Initialize a Sling application project by extracting bundles into the correct
* locations.
- *
- * @goal prepare-package
- * @requiresDependencyResolution test
- * @phase prepare-package
- * @description initialize a Sling application project
*/
+@Mojo(name = "prepare-package", defaultPhase = LifecyclePhase.PREPARE_PACKAGE, requiresDependencyResolution = ResolutionScope.TEST)
public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
/**
* The output directory for the default bundles in a WAR-packaged project,
* the base JAR (in the subdirectory named in the baseDestination
* parameter), and any additional bundles.
- *
- * @parameter default-value="${project.build.directory}/launchpad-bundles"
*/
+ @Parameter(defaultValue = "${project.build.directory}/launchpad-bundles")
private File warOutputDirectory;
/**
* The project's packaging type.
- *
- * @parameter expression="${project.packaging}"
*/
+ @Parameter(property = "project.packaging")
private String packaging;
/**
* The definition of the base JAR.
- *
- * @parameter
*/
+ @Parameter
private ArtifactDefinition base;
/**
* The definition of the package to be included to provide web support for
* JAR-packaged projects (i.e. pax-web).
- *
- * @parameter
*/
+ @Parameter
private ArtifactDefinition jarWebSupport;
/**
* The project's build output directory (i.e. target/classes).
- *
- * @parameter expression="${project.build.outputDirectory}"
- * @readonly
*/
+ @Parameter(property = "project.build.outputDirectory", readonly = true)
private File buildOutputDirectory;
/**
* The temp directory (i.e. target/maven-launchpad-plugintmp).
- *
- * @parameter expression="${project.build.directory}/maven-launchpad-plugintmp"
- * @readonly
*/
+ @Parameter(defaultValue = "${project.build.outputDirectory}/maven-launchpad-plugintmp", readonly = true)
private File tempDirectory;
/**
* To look up Archiver/UnArchiver implementations
- *
- * @component
*/
+ @Component
private ArchiverManager archiverManager;
/**
* The Jar archiver.
- *
- * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
*/
+ @Component(role = Archiver.class, hint = "jar")
private JarArchiver jarArchiver;
@Override
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
index d38d1cf..97a31de 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PrepareTestWebAppMojo.java
@@ -22,42 +22,38 @@ import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Component;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
/**
* Initialize a Sling integration test webapp by extracting bundles into the
* correct locations, including the current artifact.
- *
- * @goal prepare-test-webapp
- * @requiresDependencyResolution test
- * @phase package
*/
+@Mojo( name = "prepare-test-webapp", requiresDependencyResolution = ResolutionScope.TEST, defaultPhase = LifecyclePhase.PACKAGE)
public class PrepareTestWebAppMojo extends PreparePackageMojo {
/**
* The project's build directory (i.e. target).
- *
- * @parameter expression="${project.build.directory}"
- * @readonly
*/
+ @Parameter( property = "project.build.directory", readonly = true)
private File buildDirectory;
/**
* The start level for the current artifact.
- *
- * @parameter default-value="16"
*/
+ @Parameter( defaultValue = "16")
private int startLevel;
/**
* The output directory for bundles.
- *
- * @parameter default-value="${project.build.directory}/launchpad-bundles"
*/
+ @Parameter( defaultValue = "${project.build.directory}/launchpad-bundles")
private File outputDirectory;
- /**
- * @component
- */
+ @Component
private ArtifactHandlerManager artifactHandlerManager;
@Override
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java
index feaecd5..f34f321 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/RunMojo.java
@@ -19,17 +19,16 @@ package org.apache.sling.maven.projectsupport;
import java.util.Map;
import org.apache.felix.framework.Logger;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.sling.launchpad.api.LaunchpadContentProvider;
import org.apache.sling.launchpad.base.impl.Sling;
import org.osgi.framework.BundleException;
/**
* Run a Launchpad application.
- *
- * @goal run
- * @requiresDependencyResolution test
- *
*/
+@Mojo( name = "run", requiresDependencyResolution = ResolutionScope.TEST)
public class RunMojo extends AbstractLaunchpadStartingMojo {
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java
index 4a48571..75dfc17 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/StartMojo.java
@@ -19,27 +19,23 @@ package org.apache.sling.maven.projectsupport;
import java.util.Map;
import org.apache.felix.framework.Logger;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.sling.launchpad.api.LaunchpadContentProvider;
import org.apache.sling.launchpad.base.impl.Sling;
import org.osgi.framework.BundleException;
/**
* Start a Launchpad application.
- *
- * @goal start
- * @requiresDependencyResolution test
- *
*/
+@Mojo( name = "start", requiresDependencyResolution = ResolutionScope.TEST)
public class StartMojo extends AbstractLaunchpadStartingMojo {
- /**
- * @parameter expression="${sling.control.port}" default-value="63000"
- */
+ @Parameter( property = "sling.control.port", defaultValue = "63000")
private int controlPort;
- /**
- * @parameter expression="${sling.control.host}"
- */
+ @Parameter(property = "sling.control.host")
private String controlHost;
/**
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java
index 95388e5..990dd97 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/StatusMojo.java
@@ -19,24 +19,19 @@ package org.apache.sling.maven.projectsupport;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
/**
* Gets the status a running Launchpad standalone application.
- *
- * @goal status
- * @requiresProject false
- *
*/
+@Mojo( name = "status", requiresProject = false)
public class StatusMojo extends AbstractMojo {
- /**
- * @parameter expression="${sling.control.port}" default-value="63000"
- */
+ @Parameter( property = "sling.control.port", defaultValue = "63000")
private int controlPort;
- /**
- * @parameter expression="${sling.control.host}" default-value="localhost"
- */
+ @Parameter( property = "sling.control.host")
private String controlHost;
/**
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java
index 8fe3a8f..5d2def9 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/StopMojo.java
@@ -19,24 +19,19 @@ package org.apache.sling.maven.projectsupport;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
/**
* Stop a running Launchpad standalone application.
- *
- * @goal stop
- * @requiresProject false
- *
*/
+@Mojo( name = "stop", requiresProject = false)
public class StopMojo extends AbstractMojo {
- /**
- * @parameter expression="${sling.control.port}" default-value="63000"
- */
+ @Parameter( property = "sling.control.port", defaultValue = "63000")
private int controlPort;
- /**
- * @parameter expression="${sling.control.host}" default-value="localhost"
- */
+ @Parameter( property = "sling.control.host")
private String controlHost;
/**
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 18/45: SLING-3205 - refactor if
statement into more readable methods
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 8925b33438b6fc2d568516162731ddaf9d47ca1c
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Thu Oct 24 14:34:35 2013 +0000
SLING-3205 - refactor if statement into more readable methods
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1535392 13f79535-47bb-0310-9956-ffa450edef68
---
.../projectsupport/BundleListContentProvider.java | 136 ++++++++++++---------
.../BundleListContentProviderTest.java | 11 +-
2 files changed, 87 insertions(+), 60 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
index cfe1c46..472ec6c 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/BundleListContentProvider.java
@@ -46,82 +46,100 @@ import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
abstract class BundleListContentProvider implements LaunchpadContentProvider {
private final File resourceProviderRoot;
+ private final static List<String> EMPTY_STRING_LIST = Collections.emptyList();
BundleListContentProvider(File resourceProviderRoot) {
this.resourceProviderRoot = resourceProviderRoot;
}
-
- public Iterator<String> getChildren(String path) {
- if (path.equals(BUNDLE_PATH_PREFIX)) {
- final Set<String> levels = new HashSet<String>();
- for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
- // we treat the boot level as level 1
- if ( level.getStartLevel() == -1 ) {
- levels.add(BUNDLE_PATH_PREFIX + "/1/");
- } else {
- levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
- }
+
+ private Iterator<String> handleBundlePathRoot(String path) {
+ final Set<String> levels = new HashSet<String>();
+ for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+ // we treat the boot level as level 1
+ if ( level.getStartLevel() == -1 ) {
+ levels.add(BUNDLE_PATH_PREFIX + "/1/");
+ } else {
+ levels.add(BUNDLE_PATH_PREFIX + "/" + level.getLevel() + "/");
}
- return levels.iterator();
- } else if (path.equals("resources/corebundles")) {
- List<String> empty = Collections.emptyList();
- return empty.iterator();
- } else if (path.equals(CONFIG_PATH_PREFIX)) {
- if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
- File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
+ }
+ return levels.iterator();
+ }
+
+ private Iterator<String> handleConfigPath() {
+ if (getConfigDirectory().exists() && getConfigDirectory().isDirectory()) {
+ File[] configFiles = getConfigDirectory().listFiles(new FileFilter() {
- public boolean accept(File file) {
- return file.isFile();
- }
- });
+ public boolean accept(File file) {
+ return file.isFile();
+ }
+ });
- List<String> fileNames = new ArrayList<String>();
- for (File cfgFile : configFiles) {
- if (cfgFile.isFile()) {
- fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
- }
+ List<String> fileNames = new ArrayList<String>();
+ for (File cfgFile : configFiles) {
+ if (cfgFile.isFile()) {
+ fileNames.add(CONFIG_PATH_PREFIX + "/" + cfgFile.getName());
}
+ }
- return fileNames.iterator();
+ return fileNames.iterator();
- } else {
- List<String> empty = Collections.emptyList();
- return empty.iterator();
- }
- } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
- final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
- try {
- final int startLevel = Integer.parseInt(startLevelInfo);
-
- final List<String> bundles = new ArrayList<String>();
- for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
- if (level.getStartLevel() == startLevel || (startLevel == 1 && level.getStartLevel() == -1)) {
- for (final Bundle bundle : level.getBundles()) {
- final ArtifactDefinition d = new ArtifactDefinition(bundle, startLevel);
- try {
- final Artifact artifact = getArtifact(d);
- bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
- } catch (Exception e) {
- getLog().error("Unable to resolve artifact ", e);
- }
+ } else {
+ return EMPTY_STRING_LIST.iterator();
+ }
+ }
+
+ private Iterator<String> handleBundlePathFolder(String path) {
+ final String startLevelInfo = path.substring(BUNDLE_PATH_PREFIX.length() + 1);
+ try {
+ final int startLevel = Integer.parseInt(startLevelInfo);
+
+ final List<String> bundles = new ArrayList<String>();
+ for (final StartLevel level : getInitializedBundleList().getStartLevels()) {
+ if (level.getStartLevel() == startLevel || (startLevel == 1 && level.getStartLevel() == -1)) {
+ for (final Bundle bundle : level.getBundles()) {
+ final ArtifactDefinition d = new ArtifactDefinition(bundle, startLevel);
+ try {
+ final Artifact artifact = getArtifact(d);
+ bundles.add(artifact.getFile().toURI().toURL().toExternalForm());
+ } catch (Exception e) {
+ getLog().error("Unable to resolve artifact ", e);
}
}
}
- return bundles.iterator();
-
- } catch (NumberFormatException e) {
- // we ignore this
}
+ return bundles.iterator();
+
+ } catch (NumberFormatException e) {
+ // we ignore this
+ }
+ return null;
+ }
+
+ private Iterator<String> handleResourcesRoot() {
+ final Set<String> subDirs = new HashSet<String>();
+ subDirs.add(BUNDLE_PATH_PREFIX);
+ subDirs.add(CONFIG_PATH_PREFIX);
+ subDirs.add("resources/corebundles");
+ return subDirs.iterator();
+ }
+
+ public Iterator<String> getChildren(String path) {
+ Iterator<String> result = null;
+ if (path.equals(BUNDLE_PATH_PREFIX)) {
+ result = handleBundlePathRoot(path);
+ } else if (path.equals("resources/corebundles")) {
+ result = EMPTY_STRING_LIST.iterator();
+ } else if (path.equals(CONFIG_PATH_PREFIX)) {
+ result = handleConfigPath();
+ } else if (path.startsWith(BUNDLE_PATH_PREFIX)) {
+ result = handleBundlePathFolder(path);
} else if (path.equals("resources") ) {
- final Set<String> subDirs = new HashSet<String>();
- subDirs.add(BUNDLE_PATH_PREFIX);
- subDirs.add(CONFIG_PATH_PREFIX);
- subDirs.add("resources/corebundles");
- return subDirs.iterator();
+ result = handleResourcesRoot();
+ } else {
+ getLog().warn("un-handlable " + getClass().getSimpleName() + " path: " + path);
}
- getLog().warn("un-handlable path " + path);
- return null;
+ return result;
}
public URL getResource(String path) {
diff --git a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
index 7cd9039..b4c3905 100644
--- a/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
+++ b/src/test/java/org/apache/sling/maven/projectsupport/BundleListContentProviderTest.java
@@ -53,6 +53,7 @@ public class BundleListContentProviderTest {
private LaunchpadContentProvider provider;
private File resourceProviderRoot;
private File resourceProviderFile;
+ private File configDirectory;
@Rule
public TemporaryFolder tempFolder = new TemporaryFolder();
@@ -82,6 +83,7 @@ public class BundleListContentProviderTest {
f.createNewFile();
assertTrue("Expecting temporary config file to have been created: " + f.getAbsolutePath(), f.exists());
}
+ configDirectory = tempFolder.getRoot();
resourceProviderRoot = new File(tempFolder.getRoot(), "RESOURCE_PROVIDER_ROOT");
resourceProviderRoot.mkdirs();
@@ -105,7 +107,7 @@ public class BundleListContentProviderTest {
@Override
File getConfigDirectory() {
- return tempFolder.getRoot();
+ return configDirectory;
}
@Override
@@ -186,6 +188,12 @@ public class BundleListContentProviderTest {
}
@Test
+ public void testNonExistentConfigDirectory() {
+ configDirectory = new File("/NON_EXISTENT_" + System.currentTimeMillis());
+ assertChildren("resources/config");
+ }
+
+ @Test
public void testBundles0() {
assertChildren("resources/bundles/0",
"file:/commons-io/0/null",
@@ -262,4 +270,5 @@ public class BundleListContentProviderTest {
public void testNullResult() {
assertNull(provider.getChildren("/FOO/bar"));
}
+
}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 14/45: SLING-3011 - Bind the
launchpad:prepare-package goal to the prepare-package lifecycle phase
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit c775975ebfba050f8bf7ab9868c76ef540ab28d5
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Aug 12 11:42:02 2013 +0000
SLING-3011 - Bind the launchpad:prepare-package goal to the
prepare-package lifecycle phase
Changed the phase from process-sources to prepare-package.
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1513114 13f79535-47bb-0310-9956-ffa450edef68
---
.../java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
index a221434..521472d 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -41,7 +41,7 @@ import org.codehaus.plexus.util.FileUtils;
*
* @goal prepare-package
* @requiresDependencyResolution test
- * @phase process-sources
+ * @phase prepare-package
* @description initialize a Sling application project
*/
public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 33/45: [maven-release-plugin]
prepare release maven-launchpad-plugin-2.3.2
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 02994872d93c9fb648e0cdc86ffd69648848f3b3
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 12 06:15:13 2014 +0000
[maven-release-plugin] prepare release maven-launchpad-plugin-2.3.2
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1624457 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index 666c513..eef98d0 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
</parent>
<artifactId>maven-launchpad-plugin</artifactId>
- <version>2.3.1-SNAPSHOT</version>
+ <version>2.3.2</version>
<packaging>maven-plugin</packaging>
<name>Apache Sling Launchpad Maven Plugin</name>
@@ -31,9 +31,9 @@
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-launchpad-plugin</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.2</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.2</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.2</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 28/45: Update to parent pom v19
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit b627e436449ee3b09cc18deb0ba922b5e9d42f1b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 31 14:39:20 2014 +0000
Update to parent pom v19
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1583337 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 88d9aad..2444327 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>18</version>
+ <version>19</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 10/45: SLING-2843 : Launchpad plugin
should check if configuration directory exists
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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit fd785a4fb3c89762be3b47f1cc2f960cf483df9b
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Apr 29 05:39:40 2013 +0000
SLING-2843 : Launchpad plugin should check if configuration directory exists
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1476892 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/maven/projectsupport/PreparePackageMojo.java | 12 +++++++-----
1 file changed, 7 insertions(+), 5 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 5a541cd..a221434 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/PreparePackageMojo.java
@@ -304,12 +304,14 @@ public class PreparePackageMojo extends AbstractLaunchpadFrameworkMojo {
}
private void copyConfigurationFiles() throws MojoExecutionException {
- try {
- copyDirectory(this.getConfigDirectory(), new File(getOutputDirectory(), CONFIG_PATH_PREFIX), null, FileUtils.getDefaultExcludes());
- } catch (IOException e) {
- throw new MojoExecutionException("Unable to copy configuration files", e);
+ final File configDir = this.getConfigDirectory();
+ if (configDir.exists() ) {
+ try {
+ copyDirectory(configDir, new File(getOutputDirectory(), CONFIG_PATH_PREFIX), null, FileUtils.getDefaultExcludes());
+ } catch (IOException e) {
+ throw new MojoExecutionException("Unable to copy configuration files", e);
+ }
}
-
}
private void unpack(File source, File destination)
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 07/45: SLING-1245 - adding
pax-runner support. Thansk to Alex Collignon for the patch
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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 05ce8616ef9eb50748ab8af60781b89451e1c18b
Author: Justin Edelson <ju...@apache.org>
AuthorDate: Wed Nov 21 16:23:52 2012 +0000
SLING-1245 - adding pax-runner support. Thansk to Alex Collignon for the patch
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1412174 13f79535-47bb-0310-9956-ffa450edef68
---
.../CreatePaxRunnerBundleProvisionFileMojo.java | 77 ++++++++++++++++++++++
1 file changed, 77 insertions(+)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java
new file mode 100644
index 0000000..9e98997
--- /dev/null
+++ b/src/main/java/org/apache/sling/maven/projectsupport/CreatePaxRunnerBundleProvisionFileMojo.java
@@ -0,0 +1,77 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.maven.projectsupport;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.Bundle;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.BundleList;
+import org.apache.sling.maven.projectsupport.bundlelist.v1_0_0.StartLevel;
+
+/**
+ * Create and attach a Pax Runner bundle provision file.
+ *
+ * @goal create-paxrunner-provision-file
+ * @phase package
+ * @description create a Pax Runner bundle provision file
+ * @requiresDependencyResolution test
+ */
+public class CreatePaxRunnerBundleProvisionFileMojo extends AbstractUsingBundleListMojo {
+
+ private static final String CLASSIFIER = "bundles";
+
+ private static final String TYPE = "pax";
+
+ /**
+ * The output directory.
+ *
+ * @parameter default-value="${project.build.directory}/bundles-pax"
+ */
+ private File outputFile;
+
+ @Override
+ protected void executeWithArtifacts() throws MojoExecutionException, MojoFailureException {
+ FileWriter out = null;
+ try {
+ out = new FileWriter(outputFile);
+
+ BundleList bundleList = getInitializedBundleList();
+ for (StartLevel level : bundleList.getStartLevels()) {
+ for (Bundle bundle : level.getBundles()) {
+ String line = String.format("mvn:%s/%s/%s@%d\n", bundle.getGroupId(), bundle.getArtifactId(),
+ bundle.getVersion(), level.getStartLevel());
+ out.write(line);
+ }
+ }
+
+ projectHelper.attachArtifact(project, TYPE, CLASSIFIER, outputFile);
+ } catch (IOException e) {
+ throw new MojoExecutionException("Unable to write " + outputFile.getName(), e);
+ } finally {
+ if (out != null) {
+ try {
+ out.close();
+ } catch (IOException e) {
+ }
+ }
+ }
+ }
+}
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 30/45: SLING-3681 - Enable the
maven-launchpad-plugin to generate the XSD for bundles list XML document
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 6d4f4595a8e9c757cd51e2395b57446ab4203f36
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jul 3 12:22:18 2014 +0000
SLING-3681 - Enable the maven-launchpad-plugin to generate the XSD for bundles list XML document
Update the target namespace.
Submitted by: Simone Tripodi
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1607605 13f79535-47bb-0310-9956-ffa450edef68
---
src/main/mdo/bundle-list.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/mdo/bundle-list.xml b/src/main/mdo/bundle-list.xml
index c82f9fc..f0f5414 100644
--- a/src/main/mdo/bundle-list.xml
+++ b/src/main/mdo/bundle-list.xml
@@ -19,7 +19,7 @@
-->
<model xmlns="http://modello.codehaus.org/MODELLO/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://modello.codehaus.org/MODELLO/1.0.0 http://modello.codehaus.org/xsd/modello-1.0.0.xsd"
- xsd.namespace="http://sling.apache.org/maven/1.0.0">
+ xsd.namespace="http://sling.apache.org/bundles/1.0.0">
<id>bundle-list</id>
<name>BundleList</name>
<description>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 44/45: [maven-release-plugin]
prepare release maven-launchpad-plugin-2.3.4
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit ff441fa35a8f0ab88c04a50e8e6a5267777317b0
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Wed Oct 21 11:39:42 2015 +0000
[maven-release-plugin] prepare release maven-launchpad-plugin-2.3.4
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1709802 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/pom.xml b/pom.xml
index a12e40f..9f96dd9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -18,11 +18,11 @@
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
<version>25</version>
- <relativePath/>
+ <relativePath />
</parent>
<artifactId>maven-launchpad-plugin</artifactId>
- <version>2.3.3-SNAPSHOT</version>
+ <version>2.3.4</version>
<packaging>maven-plugin</packaging>
<name>Apache Sling Launchpad Maven Plugin</name>
@@ -31,9 +31,9 @@
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-launchpad-plugin</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.4</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.4</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.4</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 09/45: Update to latest parent pom
and use latest releases in launchpad
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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit b41924590a6a4fbb99b32d0ade809d4c686c2bbf
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Feb 18 08:38:52 2013 +0000
Update to latest parent pom and use latest releases in launchpad
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1447147 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 123d041..eb75a6d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>14</version>
+ <version>15</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 05/45: [maven-release-plugin]
prepare release maven-launchpad-plugin-2.2.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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 061abd9e0108d196770b9987eac9ce5a52d8abf4
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Nov 16 07:50:11 2012 +0000
[maven-release-plugin] prepare release maven-launchpad-plugin-2.2.0
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/maven/maven-launchpad-plugin@1410232 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index f0e0ff9..c0ba955 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
</parent>
<artifactId>maven-launchpad-plugin</artifactId>
- <version>2.1.3-SNAPSHOT</version>
+ <version>2.2.0</version>
<packaging>maven-plugin</packaging>
<name>Apache Sling Launchpad Maven Plugin</name>
@@ -31,9 +31,9 @@
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/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.2.0</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.2.0</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.2.0</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 35/45: Update to Sling Parent POM 22
with baselining enabled
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 38bd73e171816f737f9ebaabe9e9d35a931d7157
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Wed Oct 1 06:34:43 2014 +0000
Update to Sling Parent POM 22 with baselining enabled
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1628609 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 193133e..4b77d1f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>20</version>
+ <version>22</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 15/45: Update to parent pom 18
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 056c137ec748991d35d58ac11c15f4c3ff2eecb5
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 6 12:15:57 2013 +0000
Update to parent pom 18
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1520554 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 3c8a4b6..11ff2af 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>17</version>
+ <version>18</version>
<relativePath>../../parent/pom.xml</relativePath>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 27/45: [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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit fda7f2d7c02423274b7f08b46f85a4c3bd22c29f
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Mar 3 07:30:35 2014 +0000
[maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1573468 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index f1bdc66..88d9aad 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
</parent>
<artifactId>maven-launchpad-plugin</artifactId>
- <version>2.3.0</version>
+ <version>2.3.1-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Apache Sling Launchpad Maven Plugin</name>
@@ -31,9 +31,9 @@
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.0</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.0</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.0</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-launchpad-plugin</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 40/45: set parent version to 24 and
add empty relativePath where missing
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 7ffded05a765952137b8f3f0d290f85482932346
Author: Oliver Lietz <ol...@apache.org>
AuthorDate: Tue Jul 7 08:09:17 2015 +0000
set parent version to 24 and add empty relativePath where missing
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1689593 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pom.xml b/pom.xml
index 00c0ad8..3dd72a4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,7 +17,7 @@
<parent>
<groupId>org.apache.sling</groupId>
<artifactId>sling</artifactId>
- <version>23</version>
+ <version>24</version>
<relativePath/>
</parent>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 34/45: [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.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit dcaba22a11304fe55447201740949eaf73811c6c
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 12 06:15:27 2014 +0000
[maven-release-plugin] prepare for next development iteration
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1624459 13f79535-47bb-0310-9956-ffa450edef68
---
pom.xml | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index eef98d0..193133e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
</parent>
<artifactId>maven-launchpad-plugin</artifactId>
- <version>2.3.2</version>
+ <version>2.3.3-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Apache Sling Launchpad Maven Plugin</name>
@@ -31,9 +31,9 @@
</description>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.2</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/tags/maven-launchpad-plugin-2.3.2</developerConnection>
- <url>http://svn.apache.org/viewvc/sling/tags/maven-launchpad-plugin-2.3.2</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin</developerConnection>
+ <url>http://svn.apache.org/viewvc/sling/trunk/tooling/maven/maven-launchpad-plugin</url>
</scm>
<build>
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 32/45: SLING-3883 : Merging partial
bundle list with properties fails. Apply patch from Marcel Reutegger
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 7b26d650d5eea1154bd90042090484f5b9aef9a1
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Sep 12 06:10:57 2014 +0000
SLING-3883 : Merging partial bundle list with properties fails. Apply patch from Marcel Reutegger
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1624456 13f79535-47bb-0310-9956-ffa450edef68
---
.../apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
index ac6a0ba..4605275 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
@@ -259,6 +259,8 @@ public abstract class AbstractUsingBundleListMojo extends AbstractBundleListMojo
}
}
+ interpolateProperties(initializedBundleList, project, mavenSession);
+
// check for partial bundle lists
final Set<Artifact> dependencies = project.getDependencyArtifacts();
for (Artifact artifact : dependencies) {
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.
[sling-maven-launchpad-plugin] 22/45: SLING-3401 : Support multiple
bundles for jarWebSupport Add support for reading multiple bundles when
directly reading the maven xml (lifecycle participant) and add support to
define several bundles in the dependencies.properties file
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag maven-launchpad-plugin-2.3.4
in repository https://gitbox.apache.org/repos/asf/sling-maven-launchpad-plugin.git
commit 81e074a194beb4d24bf39b28c6d2e0408ab89b43
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Feb 20 12:58:47 2014 +0000
SLING-3401 : Support multiple bundles for jarWebSupport
Add support for reading multiple bundles when directly reading the maven xml (lifecycle participant) and add support to define several bundles in the dependencies.properties file
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/maven-launchpad-plugin@1570178 13f79535-47bb-0310-9956-ffa450edef68
---
.../maven/projectsupport/ArtifactDefinition.java | 40 +++++++++++++++-------
1 file changed, 28 insertions(+), 12 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
index 10285dc..29930a5 100644
--- a/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
+++ b/src/main/java/org/apache/sling/maven/projectsupport/ArtifactDefinition.java
@@ -67,14 +67,22 @@ public class ArtifactDefinition {
this.runModes = bundle.getRunModes();
}
- public ArtifactDefinition(Xpp3Dom config) {
- this.groupId = nodeValue(config, "groupId", null);
- this.artifactId = nodeValue(config, "artifactId", null);
- this.type = nodeValue(config, "type", null);
- this.version = nodeValue(config, "version", null);
- this.classifier = nodeValue(config, "classifier", null);
- this.startLevel = nodeValue(config, "startLevel", 0);
- this.runModes = nodeValue(config, "runModes", null);
+ public ArtifactDefinition(final Xpp3Dom config) {
+ if ( config.getChild("bundles") != null ) {
+ final Xpp3Dom[] children = config.getChild("bundles").getChildren("bundle");
+ this.bundles = new ArtifactDefinition[children.length];
+ for(int i=0; i<this.bundles.length; i++) {
+ this.bundles[i] = new ArtifactDefinition(children[i]);
+ }
+ } else {
+ this.groupId = nodeValue(config, "groupId", null);
+ this.artifactId = nodeValue(config, "artifactId", null);
+ this.type = nodeValue(config, "type", null);
+ this.version = nodeValue(config, "version", null);
+ this.classifier = nodeValue(config, "classifier", null);
+ this.startLevel = nodeValue(config, "startLevel", 0);
+ this.runModes = nodeValue(config, "runModes", null);
+ }
}
public String getArtifactId() {
@@ -150,15 +158,23 @@ public class ArtifactDefinition {
*/
public void initDefaults(String commaDelimitedList) {
String[] values = commaDelimitedList.split(",");
- if (values.length != 6) {
+ if (values.length == 0 || values.length % 6 != 0 ) {
throw new IllegalArgumentException(
String
.format(
- "The string %s does not have the correct number of items (6).",
+ "The string %s does not have the correct number of items (a multiple of 6).",
commaDelimitedList));
}
- initDefaults(values[0], values[1], values[2], values[3], values[4],
- Integer.valueOf(values[5]));
+ if ( values.length == 6 ) {
+ initDefaults(values[0], values[1], values[2], values[3], values[4],
+ Integer.valueOf(values[5]));
+ }
+ this.bundles = new ArtifactDefinition[values.length / 6];
+ for(int i=0; i<values.length / 6; i++) {
+ this.bundles[i] = new ArtifactDefinition();
+ this.bundles[i].initDefaults(values[i*6 + 0], values[i*6 + 1], values[i*6 + 2], values[i*6 + 3], values[i*6 + 4],
+ Integer.valueOf(values[i*6 + 5]));
+ }
}
/**
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.