You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2006/04/10 02:42:18 UTC
svn commit: r392858 [1/3] - in /maven/plugins/trunk/maven-dependency-plugin:
./ src/ src/changes/ src/it/ src/it/it0100/ src/it/it0100/test-dep/
src/it/it0100/test-dep/src/ src/it/it0100/test-dep/src/main/
src/it/it0100/test-dep/src/main/java/ src/it/i...
Author: brianf
Date: Sun Apr 9 17:42:11 2006
New Revision: 392858
URL: http://svn.apache.org/viewcvs?rev=392858&view=rev
Log:
Initial import of dependency plugin from the mojo project. This code represents a refactored version of the plugin 2.0. It is near complete but not ready for use yet.
Added:
maven/plugins/trunk/maven-dependency-plugin/
maven/plugins/trunk/maven-dependency-plugin/LICENSE.txt
maven/plugins/trunk/maven-dependency-plugin/pom-it.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/pom.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/src/
maven/plugins/trunk/maven-dependency-plugin/src/changes/
maven/plugins/trunk/maven-dependency-plugin/src/changes/changes.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/src/it/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/expected-results.txt
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/goals.txt
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/log.txt
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/pom.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/pom.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/org/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/org/apache/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/org/apache/maven/coreit/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/org/apache/maven/coreit/testdep/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/org/apache/maven/coreit/testdep/QuotableSolutions.java
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/org/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/org/apache/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/org/apache/maven/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/org/apache/maven/coreit/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/org/apache/maven/coreit/testdep/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/org/apache/maven/coreit/testdep/quotes.properties
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/target/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/pom.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/org/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/org/apache/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/org/apache/maven/plugin/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/org/apache/maven/plugin/coreit/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/target/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/target/classes/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/target/classes/META-INF/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/target/classes/META-INF/maven/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/target/classes/META-INF/maven/plugin.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-project/
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-project/pom.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-project/target/
maven/plugins/trunk/maven-dependency-plugin/src/it/pom.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/src/main/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/ArtifactItem.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/CopyMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/UnpackMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/GoOfflineMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependenciesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolveDependencySourcesMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/resolvers/ResolvePluginsMojo.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyStatusSets.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/DependencyUtil.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/SilentLog.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ArtifactsFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/FilterArtifacts.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/MarkerFileFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/ScopeFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/TransitivityFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/filters/TypeFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/DefaultFileMarkerHandler.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/MarkerHandler.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/markers/SourcesFileMarkerHandler.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/resolvers/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/resolvers/ArtifactsResolver.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/resolvers/DefaultArtifactsResolver.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ArtifactTranslator.java
maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/utils/translators/ClassifierTypeTranslator.java
maven/plugins/trunk/maven-dependency-plugin/src/site/
maven/plugins/trunk/maven-dependency-plugin/src/site/apt/
maven/plugins/trunk/maven-dependency-plugin/src/site/apt/howto.apt
maven/plugins/trunk/maven-dependency-plugin/src/site/apt/introduction.apt
maven/plugins/trunk/maven-dependency-plugin/src/site/site.xml (with props)
maven/plugins/trunk/maven-dependency-plugin/src/test/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/TestDependencyUtil.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestMarkerFileFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestScopeFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTransitivityFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/filters/TestTypeFilter.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/markers/
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/markers/TestDefaultMarkerFileHandler.java
maven/plugins/trunk/maven-dependency-plugin/src/test/java/org/apache/maven/plugin/dependency/utils/markers/TestSourcesMarkerFileHandler.java
Added: maven/plugins/trunk/maven-dependency-plugin/LICENSE.txt
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/LICENSE.txt?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/LICENSE.txt (added)
+++ maven/plugins/trunk/maven-dependency-plugin/LICENSE.txt Sun Apr 9 17:42:11 2006
@@ -0,0 +1,14 @@
+
+ Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
Added: maven/plugins/trunk/maven-dependency-plugin/pom-it.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/pom-it.xml?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/pom-it.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/pom-it.xml Sun Apr 9 17:42:11 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>maven-plugins</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <version>1</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin-it-launcher</artifactId>
+ <packaging>maven-plugin</packaging>
+ <name>Dependency Maven Plugin</name>
+ <version>2.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Maven Dependency Plugin - Integration tests</name>
+
+ <modules>
+ <module>/src/it</module>
+ </modules>
+<build>
+<defaultGoal>install</defaultGoal>
+</build>
+</project>
Propchange: maven/plugins/trunk/maven-dependency-plugin/pom-it.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: maven/plugins/trunk/maven-dependency-plugin/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/pom.xml?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/pom.xml Sun Apr 9 17:42:11 2006
@@ -0,0 +1,88 @@
+<?xml version="1.0"?><project>
+ <parent>
+ <artifactId>maven-plugins</artifactId>
+ <groupId>org.apache.maven.plugins</groupId>
+ <version>1</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <packaging>maven-plugin</packaging>
+ <name>Dependency Maven Plugin</name>
+ <version>2.0-SNAPSHOT</version>
+ <developers>
+ <developer>
+ <id>brianfox</id>
+ <name>Brian Fox</name>
+ <email>brianefox@gmail.com</email>
+ <roles>
+ <role>Lead Developer</role>
+ </roles>
+ <timezone>5</timezone>
+ </developer>
+ <developer>
+ <id>dtran</id>
+ <name>Dan T. Tran</name>
+ <email>dantran@gmail.com</email>
+ <organization></organization>
+ <roles>
+ <role>Developer</role>
+ </roles>
+ </developer>
+ </developers>
+ <licenses>
+ <license>
+ <name>Apache License 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ <comments>Copyright 2005-2006 Brian Fox</comments>
+ </license>
+ </licenses>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <source>1.4</source>
+ <destDir>${project.build.directory}/site/javadoc</destDir>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-archiver</artifactId>
+ <version>1.0-alpha-5</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>[1.1,]</version>
+ </dependency>
+ </dependencies>
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.mojo</groupId>
+ <artifactId>changes-maven-plugin</artifactId>
+ <version>2.0-beta-1</version>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-dependency-plugin/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: maven/plugins/trunk/maven-dependency-plugin/src/changes/changes.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/changes/changes.xml?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/changes/changes.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/changes/changes.xml Sun Apr 9 17:42:11 2006
@@ -0,0 +1,16 @@
+<document>
+ <properties>
+ <title>Dependency Maven Plugin</title>
+ <author email="brianefox@gmail.com">Brian Fox</author>
+ </properties>
+ <body>
+
+ <release version="1.0" date="01/01/2006">
+ <action dev="brianfox" type="update">
+ Initial Release of Plugin
+ </action>
+ <action dev="brianfox" type="add" issue="MOJO-173"> Issue for initial import of plugin </action>
+ <action dev="brianfox" type="add" issue="MOJO-198"> Add strip version functionality to copyMojo</action>
+ </release>
+ </body>
+</document>
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/changes/changes.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/expected-results.txt
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/expected-results.txt?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/expected-results.txt (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/expected-results.txt Sun Apr 9 17:42:11 2006
@@ -0,0 +1 @@
+test-project/target/mojo.success
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/goals.txt
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/goals.txt?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/goals.txt (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/goals.txt Sun Apr 9 17:42:11 2006
@@ -0,0 +1 @@
+install
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/log.txt
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/log.txt?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/log.txt (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/log.txt Sun Apr 9 17:42:11 2006
@@ -0,0 +1,82 @@
++ Error stacktraces are turned on.
+[INFO] Scanning for projects...
+[INFO] Reactor build order:
+[INFO] Test Mojo ClassLoader
+[INFO] Test Mojo
+[INFO] Test Project
+[INFO] Searching repository for plugin with prefix: 'clean'.
+[INFO] ----------------------------------------------------------------------------
+[INFO] Building Test Mojo ClassLoader
+[INFO] task-segment: [clean:clean, install]
+[INFO] ----------------------------------------------------------------------------
+[INFO] [clean:clean]
+[INFO] [install:install]
+[INFO] Installing C:\code\maven\maven-trunk\maven-core-it\it0100\pom.xml to C:\java\.m2-repo\test\test-classloader\0.1\test-classloader-0.1.pom
+[INFO] ----------------------------------------------------------------------------
+[INFO] Building Test Mojo
+[INFO] task-segment: [clean:clean, install]
+[INFO] ----------------------------------------------------------------------------
+[INFO] [clean:clean]
+[INFO] Deleting directory C:\code\maven\maven-trunk\maven-core-it\it0100\test-mojo\target
+[INFO] [plugin:descriptor]
+[INFO] Using 2 extractors.
+[INFO] Applying extractor for language: java
+[INFO] Extractor for language: java found 1 mojo descriptors.
+[INFO] Applying extractor for language: bsh
+[INFO] Extractor for language: bsh found 0 mojo descriptors.
+[INFO] [resources:resources]
+[INFO] Using default encoding to copy filtered resources.
+[INFO] [compiler:compile]
+Compiling 1 source file to C:\code\maven\maven-trunk\maven-core-it\it0100\test-mojo\target\classes
+[INFO] [resources:testResources]
+[INFO] Using default encoding to copy filtered resources.
+[INFO] [compiler:testCompile]
+[INFO] No sources to compile
+[INFO] [surefire:test]
+[INFO] No tests to run.
+[INFO] [jar:jar]
+[INFO] Building jar: C:\code\maven\maven-trunk\maven-core-it\it0100\test-mojo\target\test-mojo-0.1.jar
+[INFO] [plugin:addPluginArtifactMetadata]
+[INFO] [install:install]
+[INFO] Installing C:\code\maven\maven-trunk\maven-core-it\it0100\test-mojo\target\test-mojo-0.1.jar to C:\java\.m2-repo\test\test-mojo\0.1\test-mojo-0.1.jar
+[INFO] [plugin:updateRegistry]
+[INFO] ----------------------------------------------------------------------------
+[INFO] Building Test Project
+[INFO] task-segment: [clean:clean, install]
+[INFO] ----------------------------------------------------------------------------
+[INFO] [clean:clean]
+[INFO] Deleting directory C:\code\maven\maven-trunk\maven-core-it\it0100\test-project\target
+[INFO] [resources:resources]
+[INFO] Using default encoding to copy filtered resources.
+[INFO] [compiler:compile]
+[INFO] No sources to compile
+[INFO] [resources:testResources]
+[INFO] Using default encoding to copy filtered resources.
+[INFO] [compiler:testCompile]
+[INFO] No sources to compile
+[INFO] [surefire:test]
+[INFO] No tests to run.
+[INFO] [test-mojo:test {execution: default}]
+[INFO] Two paradoxes are better than one; they may even suggest a solution. - Edward Teller (1908 - 2003)
+[INFO] When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong. - R. Buckminster Fuller (1895 - 1983)
+[INFO] [jar:jar]
+[WARNING] JAR will be empty - no content was marked for inclusion!
+[INFO] Building jar: C:\code\maven\maven-trunk\maven-core-it\it0100\test-project\target\test-project-0.1.jar
+[INFO] [install:install]
+[INFO] Installing C:\code\maven\maven-trunk\maven-core-it\it0100\test-project\target\test-project-0.1.jar to C:\java\.m2-repo\test\test-project\0.1\test-project-0.1.jar
+[INFO]
+[INFO]
+[INFO] ----------------------------------------------------------------------------
+[INFO] Reactor Summary:
+[INFO] ----------------------------------------------------------------------------
+[INFO] Test Mojo ClassLoader .................................. SUCCESS [0.828s]
+[INFO] Test Mojo .............................................. SUCCESS [5.672s]
+[INFO] Test Project ........................................... SUCCESS [0.437s]
+[INFO] ----------------------------------------------------------------------------
+[INFO] ----------------------------------------------------------------------------
+[INFO] BUILD SUCCESSFUL
+[INFO] ----------------------------------------------------------------------------
+[INFO] Total time: 7 seconds
+[INFO] Finished at: Sun Jan 15 20:55:43 EST 2006
+[INFO] Final Memory: 6M/12M
+[INFO] ----------------------------------------------------------------------------
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/pom.xml?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/pom.xml Sun Apr 9 17:42:11 2006
@@ -0,0 +1,14 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>test</groupId>
+ <artifactId>test-classloader</artifactId>
+ <version>0.1</version>
+ <name>Test Mojo ClassLoader</name>
+ <description></description>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>test-project</module>
+ <module>test-mojo</module>
+ </modules>
+</project>
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/pom.xml?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/pom.xml Sun Apr 9 17:42:11 2006
@@ -0,0 +1,15 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>test-classloader</artifactId>
+ <groupId>test</groupId>
+ <version>0.1</version>
+ </parent>
+
+ <groupId>test</groupId>
+ <artifactId>test-dep</artifactId>
+ <version>0.1</version>
+ <packaging>jar</packaging>
+ <name>Test Dependency</name>
+
+</project>
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/org/apache/maven/coreit/testdep/QuotableSolutions.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/org/apache/maven/coreit/testdep/QuotableSolutions.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/org/apache/maven/coreit/testdep/QuotableSolutions.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/java/org/apache/maven/coreit/testdep/QuotableSolutions.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,75 @@
+package org.apache.maven.coreit.testdep;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Properties;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class QuotableSolutions
+{
+ private final static String RESOURCE = "/org/apache/maven/coreit/testdep/quotes.properties";
+
+ public QuotableSolutions()
+ {
+ /* do nothing */
+ }
+
+ public String getQuoteViaThread( String who )
+ {
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ return getQuote( cl, who );
+ }
+
+ public String getQuoteViaThis( String who )
+ {
+ ClassLoader cl = this.getClass().getClassLoader();
+ return getQuote( cl, who );
+ }
+
+ public String getQuote( ClassLoader cl, String who )
+ {
+
+ URL url = cl.getResource( RESOURCE );
+ if ( url == null )
+ {
+ System.err.println( "Unable to find Resource " + RESOURCE );
+ return null;
+ }
+
+ try
+ {
+ InputStream is = url.openStream();
+ if ( is == null )
+ {
+ System.err.println( "Unabel to open stream for " + RESOURCE );
+ return null;
+ }
+ Properties props = new Properties();
+ props.load( is );
+
+ return props.getProperty( "quote." + who );
+ }
+ catch ( IOException e )
+ {
+ System.err.println( "Unable to open resource " + RESOURCE + ": " + e.getMessage() );
+ }
+
+ return null;
+ }
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/org/apache/maven/coreit/testdep/quotes.properties
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/org/apache/maven/coreit/testdep/quotes.properties?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/org/apache/maven/coreit/testdep/quotes.properties (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-dep/src/main/resources/org/apache/maven/coreit/testdep/quotes.properties Sun Apr 9 17:42:11 2006
@@ -0,0 +1,2 @@
+quote.teller=Two paradoxes are better than one; they may even suggest a solution. - Edward Teller (1908 - 2003)
+quote.fuller=When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong. - R. Buckminster Fuller (1895 - 1983)
\ No newline at end of file
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/pom.xml?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/pom.xml Sun Apr 9 17:42:11 2006
@@ -0,0 +1,26 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>test-classloader</artifactId>
+ <groupId>test</groupId>
+ <version>0.1</version>
+ </parent>
+
+ <groupId>test</groupId>
+ <artifactId>test-mojo</artifactId>
+ <packaging>maven-plugin</packaging>
+ <version>0.1</version>
+ <name>Test Mojo</name>
+ <dependencies>
+ <dependency>
+ <groupId>test</groupId>
+ <artifactId>test-dep</artifactId>
+ <version>0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/src/main/java/org/apache/maven/plugin/coreit/CoreItMojo.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,104 @@
+package org.apache.maven.plugin.coreit;
+
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.coreit.testdep.QuotableSolutions;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+
+/**
+ * test goal.
+ *
+ * @goal test
+ * @phase test
+ */
+public class CoreItMojo
+ extends AbstractMojo
+{
+ /**
+ * @parameter expression="${project.build.directory}"
+ * @required
+ */
+ private File outputDirectory;
+
+ public void execute()
+ throws MojoExecutionException
+ {
+ String quote;
+ boolean pass = true;
+
+ QuotableSolutions quotes = new QuotableSolutions();
+ quote = quotes.getQuoteViaThread( "teller" );
+ if ( quote == null )
+ {
+ getLog().error( "Error using Thread.currentThread().getContextClassLoader()." );
+ pass = false;
+ }
+ else
+ {
+ getLog().info( quote );
+ }
+
+ quote = quotes.getQuoteViaThis( "fuller" );
+ if ( quote == null )
+ {
+ getLog().error( "Error using this.getClass().getClassLoader()" );
+ pass = false;
+ }
+ else
+ {
+ getLog().info( quote );
+ }
+
+ if ( pass )
+ {
+ touch( outputDirectory, "mojo.success" );
+ }
+ else
+ {
+ throw new MojoExecutionException( "ClassLoader tests failed!" );
+ }
+ }
+
+ private static void touch( File dir, String file )
+ throws MojoExecutionException
+ {
+ try
+ {
+ if ( !dir.exists() )
+ {
+ dir.mkdirs();
+ }
+
+ File touch = new File( dir, file );
+
+ FileWriter w = new FileWriter( touch );
+
+ w.write( file );
+
+ w.close();
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( "Error touching file", e );
+ }
+ }
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/target/classes/META-INF/maven/plugin.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/target/classes/META-INF/maven/plugin.xml?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/target/classes/META-INF/maven/plugin.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/target/classes/META-INF/maven/plugin.xml Sun Apr 9 17:42:11 2006
@@ -0,0 +1,39 @@
+<plugin>
+ <description></description>
+ <groupId>test</groupId>
+ <artifactId>test-mojo</artifactId>
+ <version>0.1</version>
+ <goalPrefix>test-mojo</goalPrefix>
+ <isolatedRealm>false</isolatedRealm>
+ <inheritedByDefault>true</inheritedByDefault>
+ <mojos>
+ <mojo>
+ <goal>test</goal>
+ <description>test goal.</description>
+ <requiresDirectInvocation>false</requiresDirectInvocation>
+ <requiresProject>true</requiresProject>
+ <requiresReports>false</requiresReports>
+ <aggregator>false</aggregator>
+ <requiresOnline>false</requiresOnline>
+ <inheritedByDefault>true</inheritedByDefault>
+ <phase>test</phase>
+ <implementation>org.apache.maven.plugin.coreit.CoreItMojo</implementation>
+ <language>java</language>
+ <instantiationStrategy>per-lookup</instantiationStrategy>
+ <executionStrategy>once-per-session</executionStrategy>
+ <parameters>
+ <parameter>
+ <name>outputDirectory</name>
+ <type>java.io.File</type>
+ <required>true</required>
+ <editable>true</editable>
+ <description></description>
+ </parameter>
+ </parameters>
+ <configuration>
+ <outputDirectory implementation="java.io.File">${project.build.directory}</outputDirectory>
+ </configuration>
+ </mojo>
+ </mojos>
+ <dependencies/>
+</plugin>
\ No newline at end of file
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-mojo/target/classes/META-INF/maven/plugin.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-project/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-project/pom.xml?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-project/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-project/pom.xml Sun Apr 9 17:42:11 2006
@@ -0,0 +1,30 @@
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>test-classloader</artifactId>
+ <groupId>test</groupId>
+ <version>0.1</version>
+ </parent>
+
+ <groupId>test</groupId>
+ <artifactId>test-project</artifactId>
+ <version>0.1</version>
+ <name>Test Project</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>test</groupId>
+ <artifactId>test-mojo</artifactId>
+ <version>0.1</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/it/it0100/test-project/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: maven/plugins/trunk/maven-dependency-plugin/src/it/pom.xml
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/it/pom.xml?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/it/pom.xml (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/it/pom.xml Sun Apr 9 17:42:11 2006
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.mojo</groupId>
+ <artifactId>mojo</artifactId>
+ <version>6</version>
+ </parent>
+ <artifactId>dependency-maven-plugin-it</artifactId>
+ <version>2.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>Maven Dependency Plugin - Integration tests</name>
+
+ <modules>
+ <module>it0100</module>
+ </modules>
+
+</project>
Propchange: maven/plugins/trunk/maven-dependency-plugin/src/it/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyFilterMojo.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,199 @@
+/*
+ * Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.dependency;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.dependency.utils.DependencyStatusSets;
+import org.apache.maven.plugin.dependency.utils.filters.FilterArtifacts;
+import org.apache.maven.plugin.dependency.utils.filters.MarkerFileFilter;
+import org.apache.maven.plugin.dependency.utils.filters.ScopeFilter;
+import org.apache.maven.plugin.dependency.utils.filters.TransitivityFilter;
+import org.apache.maven.plugin.dependency.utils.filters.TypeFilter;
+import org.apache.maven.plugin.dependency.utils.resolvers.ArtifactsResolver;
+import org.apache.maven.plugin.dependency.utils.resolvers.DefaultArtifactsResolver;
+import org.apache.maven.plugin.dependency.utils.translators.ArtifactTranslator;
+import org.apache.maven.plugin.dependency.utils.translators.ClassifierTypeTranslator;
+import org.codehaus.plexus.util.StringUtils;
+
+/**
+ * @author brianf
+ *
+ */
+public abstract class AbstractDependencyFilterMojo
+ extends AbstractDependencyMojo
+{
+ /**
+ * If we should exclude transitive dependencies
+ * @parameter expression="${excludeTransitive}" default-value="false"
+ */
+ protected boolean excludeTransitive;
+
+
+ /**
+ * Comma Separated list of Types to include. Empty String indicates include everything (default).
+ * @parameter expression="${includeTypes}" default-value=""
+ * @optional
+ */
+ protected String includeTypes;
+
+ /**
+ * Comma Separated list of Types to exclude. Empty String indicates don't exclude anything (default). Ignored if includeTypes is used.
+ * @parameter expression="${excludeTypes}" default-value=""
+ * @optional
+ */
+ protected String excludeTypes;
+
+ /**
+ * Scope to include. An Empty string indicates all scopes (default).
+ * @parameter expression="${scope}" default-value=""
+ * @readonly
+ * @required
+ */
+ protected String scope;
+
+ /**
+ * Specify classifier to look for. Example: sources
+ * @parameter expression="${classifier}" default-value=""
+ */
+ protected String classifier;
+
+ /**
+ * Specify type to look for when constructing artifact based on classifier. Example: java-source,jar,war
+ * @parameter expression="${type}" default-value="java-source"
+ */
+ protected String type;
+
+ /**
+ * Directory to store flag files
+ * @parameter expression="${project.build.directory}/dependency-maven-plugin-markers"
+ * @required
+ */
+ protected File markersDirectory;
+
+ /**
+ * Overwrite release artifacts
+ * @parameter expression="${overWriteReleases}" default-value="false"
+ */
+ protected boolean overWriteReleases;
+
+ /**
+ * Overwrite snapshot artifacts
+ * @parameter expression="${overWriteSnapshots}" default-value="true"
+ */
+ protected boolean overWriteSnapshots;
+
+
+ /**
+ * Retrieves dependencies, either direct only or all including transitive.
+ *
+ * @return A HashSet of artifacts
+ * @throws MojoExecutionException if an error occured.
+ */
+ protected Set getDependencies() throws MojoExecutionException
+ {
+ DependencyStatusSets status = getDependencySets();
+
+ return status.getResolvedDependencies();
+ }
+
+ protected DependencyStatusSets getDependencySets()
+ throws MojoExecutionException
+ {
+ //start with all artifacts.
+ Set artifacts = project.getArtifacts();
+
+ //add filters in well known order, least specific to most specific
+ FilterArtifacts filter = new FilterArtifacts();
+ //TODO: dependencies is empty.
+ filter.addFilter( new TransitivityFilter( project.getDependencyArtifacts(), this.excludeTransitive ) );
+ filter.addFilter( new ScopeFilter( this.scope ) );
+ filter.addFilter( new TypeFilter( this.includeTypes, this.excludeTypes ) );
+
+ //perform filtering
+ artifacts = filter.filter( artifacts, log );
+
+ //transform artifacts if classifier is set
+ DependencyStatusSets status = null;
+ if (StringUtils.isNotEmpty(classifier))
+ {
+ status = getClassifierTranslatedDependencies(artifacts,false);
+ }
+ else
+ {
+ status = filterMarkedDependencies(artifacts);
+ }
+
+ return status;
+ }
+
+ protected DependencyStatusSets getClassifierTranslatedDependencies(Set artifacts,boolean stopOnFailure) throws MojoExecutionException
+ {
+ Set unResolvedArtifacts = new HashSet();
+ Set resolvedArtifacts = artifacts;
+ DependencyStatusSets status = new DependencyStatusSets();
+
+ //possibly translate artifacts into a new set of artifacts based on the classifier and type
+ //if this did something, we need to resolve the new artifacts
+ if ( StringUtils.isNotEmpty(classifier))
+ {
+ ArtifactTranslator translator = new ClassifierTypeTranslator( this.classifier, this.type, this.factory );
+ artifacts = translator.translate( artifacts, log );
+
+ status = filterMarkedDependencies(artifacts);
+
+ //the unskipped artifacts are in the resolved set.
+ artifacts = status.getResolvedDependencies();
+
+ //resolve the rest of the artifacts
+ ArtifactsResolver artifactsResolver = new DefaultArtifactsResolver( this.resolver, this.local,
+ this.remoteRepos, stopOnFailure );
+ resolvedArtifacts = artifactsResolver.resolve(artifacts,log);
+
+ //calculate the artifacts not resolved.
+ unResolvedArtifacts.addAll(artifacts);
+ unResolvedArtifacts.removeAll(resolvedArtifacts);
+ }
+
+ //return a bean of all 3 sets.
+ status.setResolvedDependencies(resolvedArtifacts);
+ status.setUnResolvedDependencies(unResolvedArtifacts);
+
+ return status;
+ }
+
+ private DependencyStatusSets filterMarkedDependencies(Set artifacts) throws MojoExecutionException
+ {
+ //remove files that have markers already
+ FilterArtifacts filter = new FilterArtifacts();
+ filter.clearFilters();
+ filter.addFilter(new MarkerFileFilter(this.overWriteReleases,this.overWriteSnapshots,this.markersDirectory));
+
+ Set unMarkedArtifacts = filter.filter(artifacts,log);
+
+ //calculate the skipped artifacts
+ Set skippedArtifacts = new HashSet();
+ skippedArtifacts.addAll(artifacts);
+ skippedArtifacts.removeAll(unMarkedArtifacts);
+
+ return new DependencyStatusSets(unMarkedArtifacts,null,skippedArtifacts);
+ }
+
+ //TODO: Set marker files.
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractDependencyMojo.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,118 @@
+/*
+ * Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.dependency;
+
+import java.util.List;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.plugin.dependency.utils.SilentLog;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+
+/**
+ * @author brianf
+ *
+ */
+public abstract class AbstractDependencyMojo
+ extends AbstractMojo
+{
+ /**
+ * Used to look up Artifacts in the remote repository.
+ * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}"
+ * @required
+ * @readonly
+ */
+ protected org.apache.maven.artifact.factory.ArtifactFactory factory;
+
+ /**
+ * Used to look up Artifacts in the remote repository.
+ * @parameter expression="${component.org.apache.maven.artifact.resolver.ArtifactResolver}"
+ * @required
+ * @readonly
+ */
+ protected org.apache.maven.artifact.resolver.ArtifactResolver resolver;
+
+ /**
+ * Location of the local repository.
+ * @parameter expression="${localRepository}"
+ * @readonly
+ * @required
+ */
+ protected org.apache.maven.artifact.repository.ArtifactRepository local;
+
+ /**
+ * List of Remote Repositories used by the resolver
+ * @parameter expression="${project.remoteArtifactRepositories}"
+ * @readonly
+ * @required
+ */
+ protected java.util.List remoteRepos;
+
+ /**
+ * To look up Archiver/UnArchiver implementations
+ *
+ * @parameter expression="${component.org.codehaus.plexus.archiver.manager.ArchiverManager}"
+ * @required
+ * @readonly
+ */
+ protected ArchiverManager archiverManager;
+
+ /**
+ * POM
+ * @parameter expression="${project}"
+ * @readonly
+ * @required
+ */
+ protected MavenProject project;
+
+ /**
+ * Contains the full list of projects in the reactor.
+ * @parameter expression="${reactorProjects}"
+ * @required
+ * @readonly
+ */
+ protected List reactorProjects;
+
+ /**
+ * If the plugin should be silent.
+ * @parameter expression="${silent}" default-value="false"
+ */
+ protected boolean silent;
+
+ protected Log log;
+
+ public AbstractDependencyMojo ()
+ {
+ if (silent)
+ {
+ log = new SilentLog();
+ }
+ else
+ {
+ log = super.getLog();
+ }
+ }
+
+ /**
+ * @return Returns the log.
+ */
+ public Log getLog()
+ {
+ return this.log;
+ }
+
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractFromDependenciesMojo.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.dependency;
+
+import java.io.File;
+
+/**
+ * Abstract Parent class used by mojos that get Artifact information from the project dependencies.
+ * @author brianf
+ *
+ */
+public abstract class AbstractFromDependenciesMojo
+ extends AbstractDependencyFilterMojo
+{
+
+ /**
+ * Default location used for mojo unless overridden in ArtifactItem
+ * @parameter expression="${outputDirectory}" default-value="${project.build.directory}/dependency"
+ * @required
+ */
+ protected File outputDirectory;
+
+ /**
+ * Place each type of file in a separate subdirectory. (example /outputDirectory/jars /outputDirectory/wars etc)
+ * @parameter expression="${useSubDirectoryPerType}" default-value="false"
+ * @optional
+ */
+ protected boolean useSubDirectoryPerType;
+
+ /**
+ * Place each file in a separate subdirectory. (example /outputDirectory/junit-junit-3.8.1)
+ * @parameter expression="${useSubDirectoryPerArtifact}" default-value="false"
+ * @optional
+ */
+ protected boolean useSubDirectoryPerArtifact;
+
+ }
Added: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/AbstractResolveMojo.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.dependency;
+
+import org.apache.maven.project.MavenProjectBuilder;
+
+
+/**
+ * @author brianf
+ *
+ */
+public abstract class AbstractResolveMojo
+ extends AbstractDependencyFilterMojo
+{
+ /**
+ * Artifact factory, needed to download source jars.
+ *
+ * @component role="org.apache.maven.project.MavenProjectBuilder"
+ * @required
+ * @readonly
+ */
+ protected MavenProjectBuilder mavenProjectBuilder;
+
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/ArtifactItem.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/ArtifactItem.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/ArtifactItem.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/ArtifactItem.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.dependency;
+
+import java.io.File;
+
+import org.apache.maven.artifact.Artifact;
+
+/**
+ * ArtifactItem represents information specified in the plugin configuration section for each artifact.
+ * @author brianf
+ */
+public class ArtifactItem
+{
+ /**
+ * Group Id of Artifact
+ * @parameter
+ * @required
+ */
+ private String groupId;
+
+ /**
+ * Name of Artifact
+ * @parameter
+ * @required
+ */
+ private String artifactId;
+
+ /**
+ * Version of Artifact
+ * @parameter
+ */
+ private String version = null;
+
+ /**
+ * Type of Artifact (War,Jar,etc)
+ * @parameter
+ * @required
+ */
+ private String type = "jar";
+
+ /**
+ * Classifier for Artifact (tests,sources,etc)
+ * @parameter
+ */
+ private String classifier;
+
+ /**
+ * Location to use for this Artifact. Overrides default location.
+ * @parameter
+ */
+ private File outputDirectory;
+
+ /**
+ * Provides ability to change destination file name
+ * @parameter
+ */
+ private String destFileName;
+
+ /**
+ * Force Overwrite..this is the one to set in pom
+ */
+ private String overWrite;
+
+ /**
+ * Force Overwrite
+ */
+ private boolean doOverWrite;
+
+ /**
+ * Artifact Item
+ */
+ private Artifact artifact;
+
+ /**
+ * @return Returns the artifactId.
+ */
+ public String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ /**
+ * @param artifactId The artifactId to set.
+ */
+ public void setArtifactId( String artifact )
+ {
+ this.artifactId = artifact;
+ }
+
+ /**
+ * @return Returns the groupId.
+ */
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ /**
+ * @param groupId The groupId to set.
+ */
+ public void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+
+ /**
+ * @return Returns the type.
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ /**
+ * @param type The type to set.
+ */
+ public void setType( String type )
+ {
+ this.type = type;
+ }
+
+ /**
+ * @return Returns the version.
+ */
+ public String getVersion()
+ {
+ return version;
+ }
+
+ /**
+ * @param version The version to set.
+ */
+ public void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ /**
+ * @return Classifier.
+ */
+ public String getClassifier()
+ {
+ return classifier;
+ }
+
+ /**
+ * @param classifier Classifier.
+ */
+ public void setClassifier( String classifier )
+ {
+ this.classifier = classifier;
+ }
+
+ public String toString()
+ {
+ return groupId + ":" + artifactId + ":" + classifier + ":" + version + ":" + type;
+ }
+
+ /**
+ * @return Returns the location.
+ */
+ public File getOutputDirectory()
+ {
+ return outputDirectory;
+ }
+
+ /**
+ * @param location The location to set.
+ */
+ public void setOutputDirectory( File outputDirectory )
+ {
+ this.outputDirectory = outputDirectory;
+ }
+
+ /**
+ * @return Returns the location.
+ */
+ public String getDestFileName()
+ {
+ return destFileName;
+ }
+
+ /**
+ * @param destFileName The destFileName to set.
+ */
+ public void setDestFileName( String destFileName )
+ {
+ this.destFileName = destFileName;
+ }
+
+ /**
+ * @return Returns the doOverWrite.
+ */
+ public boolean isDoOverWrite()
+ {
+ return this.doOverWrite;
+ }
+
+ /**
+ * @param doOverWrite The doOverWrite to set.
+ */
+ public void setDoOverWrite( boolean doOverWrite )
+ {
+ this.doOverWrite = doOverWrite;
+ }
+
+ /**
+ * @return Returns the overWriteSnapshots.
+ */
+ public String getOverWrite()
+ {
+ return this.overWrite;
+ }
+
+ /**
+ * @param overWriteSnapshots The overWriteSnapshots to set.
+ */
+ public void setOverWrite( String overWrite )
+ {
+ this.overWrite = overWrite;
+ }
+
+ /**
+ * @return Returns the artifact.
+ */
+ public Artifact getArtifact()
+ {
+ return this.artifact;
+ }
+
+ /**
+ * @param artifact The artifact to set.
+ */
+ public void setArtifact( Artifact artifact )
+ {
+ this.artifact = artifact;
+ }
+
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/CopyDependenciesMojo.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,106 @@
+/*
+ * Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.maven.plugin.dependency;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DefaultArtifact;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugin.dependency.utils.DependencyUtil;
+
+/**
+ * Goal that copies the project dependencies from the repository to a defined location.
+ *
+ * @goal copy-dependencies
+ * @requiresDependencyResolution compile
+ * @phase process-sources
+ * @author brianf
+ */
+public class CopyDependenciesMojo
+ extends AbstractFromDependenciesMojo
+{
+
+ /**
+ * Strip artifact version during copy
+ * @parameter expression="${stripVersion}" default-value="false"
+ * @parameter
+ */
+ private boolean stripVersion = false;
+
+ /**
+ * Main entry into mojo. Gets the list of dependencies and iterates through calling copyArtifact.
+ *
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
+ *
+ * @see #getDependencies
+ * @see #copyArtifact(Artifact, boolean)
+ */
+ public void execute()
+ throws MojoExecutionException
+ {
+ Set artifacts = getDependencies();
+
+ for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+ {
+ copyArtifact( (DefaultArtifact) i.next(), this.stripVersion );
+ }
+ }
+
+ /**
+ * Copies the Artifact after building the destination file name if overridden. This method also checks if the
+ * classifier is set and adds it to the destination file name if needed.
+ *
+ * @param artifact
+ * representing the object to be copied.
+ * @param removeVersion
+ * specifies if the version should be removed from the file name when copying.
+ *
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
+ *
+ * @see DependencyUtil#copyFile(File, File, Log)
+ * @see DependencyUtil#getFormattedFileName(Artifact, boolean)
+ */
+ protected void copyArtifact( Artifact artifact, boolean removeVersion )
+ throws MojoExecutionException
+ {
+
+ String destFileName = DependencyUtil.getFormattedFileName( artifact, removeVersion );
+
+ File destDir = DependencyUtil.getFormattedOutputDirectory( this.useSubDirectoryPerType,
+ this.useSubDirectoryPerArtifact,
+ this.outputDirectory, artifact );
+ File destFile = new File( destDir, destFileName );
+
+ boolean overWrite = true;
+ if ( artifact.isSnapshot() )
+ {
+ overWrite = this.overWriteSnapshots;
+ }
+ else
+ {
+ overWrite = this.overWriteReleases;
+ }
+
+ DependencyUtil.copyFile( artifact.getFile(), destFile, this.getLog(), overWrite );
+ }
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/UnpackDependenciesMojo.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,79 @@
+/*
+ * Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.maven.plugin.dependency;
+
+import java.io.File;
+import java.util.Iterator;
+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.maven.plugin.dependency.utils.DependencyUtil;
+import org.codehaus.plexus.archiver.manager.ArchiverManager;
+
+/**
+ * Goal that unpacks the project dependencies from the repository to a defined location.
+ *
+ * @goal unpack-dependencies
+ * @requiresDependencyResolution compile
+ * @phase process-sources
+ * @author brianf
+ */
+public class UnpackDependenciesMojo
+ extends AbstractFromDependenciesMojo
+{
+
+
+
+ /**
+ * Main entry into mojo. This method gets the dependencies and iterates through each one passing
+ * it to DependencyUtil.unpackFile().
+ *
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
+ *
+ * @see #getDependencies
+ * @see DependencyUtil#unpackFile(Artifact, File, File, ArchiverManager, Log)
+ */
+ public void execute()
+ throws MojoExecutionException
+ {
+ Set artifacts = getDependencies();
+
+ for ( Iterator i = artifacts.iterator(); i.hasNext(); )
+ {
+ Artifact artifact = (Artifact) i.next();
+ File destDir = DependencyUtil.getFormattedOutputDirectory( this.useSubDirectoryPerType,
+ this.useSubDirectoryPerArtifact,
+ this.outputDirectory, artifact );
+
+ boolean overWrite = true;
+ if ( artifact.isSnapshot() )
+ {
+ overWrite = this.overWriteSnapshots;
+ }
+ else
+ {
+ overWrite = this.overWriteReleases;
+ }
+
+ DependencyUtil.unpackFile( artifact, destDir, this.markersDirectory, this.archiverManager, this
+ .getLog(), overWrite );
+ }
+ }
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/AbstractFromConfigurationMojo.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,202 @@
+/*
+ * Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.dependency.fromConfiguration;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.dependency.AbstractDependencyMojo;
+
+/**
+ * Abstract Parent class used by mojos that get Artifact information from the plugin configuration as an ArrayList of ArtifactItems
+ * @see ArtifactItem
+ * @author brianf
+ *
+ */
+public abstract class AbstractFromConfigurationMojo
+ extends AbstractDependencyMojo
+{
+
+ /**
+ * Default location used for mojo unless overridden in ArtifactItem
+ * @parameter expression="${outputDirectory}" default-value="${project.build.directory}/dependency"
+ * @required
+ */
+ protected File outputDirectory;
+
+ /**
+ * Overwrite release artifacts
+ * @parameter expression="${overWriteReleases}" default-value="false"
+ */
+ protected boolean overWriteReleases;
+
+ /**
+ * Overwrite snapshot artifacts
+ * @parameter expression="${overWriteSnapshots}" default-value="true"
+ */
+ protected boolean overWriteSnapshots;
+
+ /**
+ * Collection of ArtifactItems to work on. (ArtifactItem contains groupId, artifactId, version, type, location, destFile, markerFile and overwrite.)
+ * See "How To Use" and "Javadoc" for details.
+ * @parameter
+ * @required
+ */
+ private ArrayList artifactItems;
+
+
+ /**
+ * Preprocesses the list of ArtifactItems. This method defaults the outputDirectory if not set
+ * and creates the output Directory if it doesn't exist.
+
+ * @return An ArrayList of preprocessed ArtifactItems
+ *
+ * @throws MojoExecutionException
+ * with a message if an error occurs.
+ *
+ * @see ArtifactItem
+ */
+ protected ArrayList getArtifactItems()
+ throws MojoExecutionException
+ {
+
+ Iterator iter = artifactItems.iterator();
+ while ( iter.hasNext() )
+ {
+ ArtifactItem artifactItem = (ArtifactItem) iter.next();
+ this.getLog().info( "Configured Artifact: " + artifactItem.toString() );
+
+ if ( artifactItem.getOutputDirectory() == null )
+ {
+ artifactItem.setOutputDirectory( this.outputDirectory );
+ }
+ artifactItem.getOutputDirectory().mkdirs();
+
+ artifactItem.setArtifact( this.getArtifact( artifactItem ) );
+
+ String overWrite = artifactItem.getOverWrite();
+ if ( overWrite == null )
+ {
+ if ( artifactItem.getArtifact().isSnapshot() )
+ {
+ artifactItem.setDoOverWrite( this.overWriteSnapshots );
+ }
+ else
+ {
+ artifactItem.setDoOverWrite( this.overWriteReleases );
+ }
+ }
+ else
+ {
+ artifactItem.setDoOverWrite( overWrite.equalsIgnoreCase( "true" ) );
+ }
+ }
+ return artifactItems;
+ }
+
+ /**
+ * Resolves the Artifact from the remote repository if nessessary. If no version is specified, it will
+ * be retrieved from the DependencyManagement section of the pom.
+ *
+ * @param artifactItem
+ * containing information about artifact from plugin configuration.
+ * @return Artifact
+ * object representing the specified file.
+ *
+ * @throws MojoExecutionException
+ * with a message if the version can't be found in DependencyManagement.
+ */
+ protected Artifact getArtifact( ArtifactItem artifactItem )
+ throws MojoExecutionException
+ {
+ Artifact artifact;
+
+ if ( artifactItem.getVersion() == null )
+ {
+ fillArtifactVersionFromDependencyManagement( artifactItem );
+
+ if ( artifactItem.getVersion() == null )
+ {
+ throw new MojoExecutionException( "Unable to find artifact version of " + artifactItem.getGroupId()
+ + ":" + artifactItem.getArtifactId() + " in project's dependency management." );
+ }
+
+ }
+
+ //use classifer if set.
+ String classifier = artifactItem.getClassifier();
+
+ if ( classifier == null || classifier.equals( "" ) )
+ {
+ artifact = factory.createArtifact( artifactItem.getGroupId(), artifactItem.getArtifactId(), artifactItem
+ .getVersion(), Artifact.SCOPE_PROVIDED, artifactItem.getType() );
+ }
+ else
+ {
+ artifact = factory.createArtifactWithClassifier( artifactItem.getGroupId(), artifactItem.getArtifactId(),
+ artifactItem.getVersion(), artifactItem.getType(),
+ artifactItem.getClassifier() );
+ }
+
+ try
+ {
+ resolver.resolve( artifact, remoteRepos, local );
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ throw new MojoExecutionException( "Unable to resolve artifact.", e );
+ }
+ catch ( ArtifactNotFoundException e )
+ {
+ throw new MojoExecutionException( "Unable to find artifact.", e );
+ }
+
+ return artifact;
+ }
+
+ /**
+ * Tries to find missing version from dependancy management. If found, the artifact is updated with
+ * the correct version.
+ * @param artifact representing configured file.
+ */
+ private void fillArtifactVersionFromDependencyManagement( ArtifactItem artifact )
+ {
+ this.getLog().debug( "Attempting to find missing version from dependency management." );
+
+ List list = this.project.getDependencyManagement().getDependencies();
+
+ for ( int i = 0; i < list.size(); ++i )
+ {
+ Dependency dependency = (Dependency) list.get( i );
+
+ if ( dependency.getGroupId().equals( artifact.getGroupId() )
+ && dependency.getArtifactId().equals( artifact.getArtifactId() )
+ && dependency.getType().equals( artifact.getType() ) )
+ {
+ this.getLog().debug( "Found missing version: " + dependency.getVersion() );
+
+ artifact.setVersion( dependency.getVersion() );
+ }
+ }
+ }
+}
Added: maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java?rev=392858&view=auto
==============================================================================
--- maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java (added)
+++ maven/plugins/trunk/maven-dependency-plugin/src/main/java/org/apache/maven/plugin/dependency/fromConfiguration/ArtifactItem.java Sun Apr 9 17:42:11 2006
@@ -0,0 +1,253 @@
+/*
+ * Copyright 2005-2006 Brian Fox (brianefox@gmail.com)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.maven.plugin.dependency.fromConfiguration;
+
+import java.io.File;
+
+import org.apache.maven.artifact.Artifact;
+
+/**
+ * ArtifactItem represents information specified in the plugin configuration section for each artifact.
+ * @author brianf
+ */
+public class ArtifactItem
+{
+ /**
+ * Group Id of Artifact
+ * @parameter
+ * @required
+ */
+ private String groupId;
+
+ /**
+ * Name of Artifact
+ * @parameter
+ * @required
+ */
+ private String artifactId;
+
+ /**
+ * Version of Artifact
+ * @parameter
+ */
+ private String version = null;
+
+ /**
+ * Type of Artifact (War,Jar,etc)
+ * @parameter
+ * @required
+ */
+ private String type = "jar";
+
+ /**
+ * Classifier for Artifact (tests,sources,etc)
+ * @parameter
+ */
+ private String classifier;
+
+ /**
+ * Location to use for this Artifact. Overrides default location.
+ * @parameter
+ */
+ private File outputDirectory;
+
+ /**
+ * Provides ability to change destination file name
+ * @parameter
+ */
+ private String destFileName;
+
+ /**
+ * Force Overwrite..this is the one to set in pom
+ */
+ private String overWrite;
+
+ /**
+ * Force Overwrite
+ */
+ private boolean doOverWrite;
+
+ /**
+ * Artifact Item
+ */
+ private Artifact artifact;
+
+ /**
+ * @return Returns the artifactId.
+ */
+ public String getArtifactId()
+ {
+ return artifactId;
+ }
+
+ /**
+ * @param artifactId The artifactId to set.
+ */
+ public void setArtifactId( String artifact )
+ {
+ this.artifactId = artifact;
+ }
+
+ /**
+ * @return Returns the groupId.
+ */
+ public String getGroupId()
+ {
+ return groupId;
+ }
+
+ /**
+ * @param groupId The groupId to set.
+ */
+ public void setGroupId( String groupId )
+ {
+ this.groupId = groupId;
+ }
+
+ /**
+ * @return Returns the type.
+ */
+ public String getType()
+ {
+ return type;
+ }
+
+ /**
+ * @param type The type to set.
+ */
+ public void setType( String type )
+ {
+ this.type = type;
+ }
+
+ /**
+ * @return Returns the version.
+ */
+ public String getVersion()
+ {
+ return version;
+ }
+
+ /**
+ * @param version The version to set.
+ */
+ public void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ /**
+ * @return Classifier.
+ */
+ public String getClassifier()
+ {
+ return classifier;
+ }
+
+ /**
+ * @param classifier Classifier.
+ */
+ public void setClassifier( String classifier )
+ {
+ this.classifier = classifier;
+ }
+
+ public String toString()
+ {
+ return groupId + ":" + artifactId + ":" + classifier + ":" + version + ":" + type;
+ }
+
+ /**
+ * @return Returns the location.
+ */
+ public File getOutputDirectory()
+ {
+ return outputDirectory;
+ }
+
+ /**
+ * @param location The location to set.
+ */
+ public void setOutputDirectory( File outputDirectory )
+ {
+ this.outputDirectory = outputDirectory;
+ }
+
+ /**
+ * @return Returns the location.
+ */
+ public String getDestFileName()
+ {
+ return destFileName;
+ }
+
+ /**
+ * @param destFileName The destFileName to set.
+ */
+ public void setDestFileName( String destFileName )
+ {
+ this.destFileName = destFileName;
+ }
+
+ /**
+ * @return Returns the doOverWrite.
+ */
+ public boolean isDoOverWrite()
+ {
+ return this.doOverWrite;
+ }
+
+ /**
+ * @param doOverWrite The doOverWrite to set.
+ */
+ public void setDoOverWrite( boolean doOverWrite )
+ {
+ this.doOverWrite = doOverWrite;
+ }
+
+ /**
+ * @return Returns the overWriteSnapshots.
+ */
+ public String getOverWrite()
+ {
+ return this.overWrite;
+ }
+
+ /**
+ * @param overWriteSnapshots The overWriteSnapshots to set.
+ */
+ public void setOverWrite( String overWrite )
+ {
+ this.overWrite = overWrite;
+ }
+
+ /**
+ * @return Returns the artifact.
+ */
+ public Artifact getArtifact()
+ {
+ return this.artifact;
+ }
+
+ /**
+ * @param artifact The artifact to set.
+ */
+ public void setArtifact( Artifact artifact )
+ {
+ this.artifact = artifact;
+ }
+
+}