[jboss-svn-commits] JBL Code SVN: r13506 - labs/jbossbuild/maven-plugins/trunk/maven-test-ext-plugin/src/main/java/org/jboss/maven/plugins/test/ext.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Sat Jul 14 14:43:17 EDT 2007
Author: steve.ebersole at jboss.com
Date: 2007-07-14 14:43:17 -0400 (Sat, 14 Jul 2007)
New Revision: 13506
Modified:
labs/jbossbuild/maven-plugins/trunk/maven-test-ext-plugin/src/main/java/org/jboss/maven/plugins/test/ext/ExtenderMojo.java
Log:
fixed issue in how artifacts are pushed back to project
Modified: labs/jbossbuild/maven-plugins/trunk/maven-test-ext-plugin/src/main/java/org/jboss/maven/plugins/test/ext/ExtenderMojo.java
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/maven-test-ext-plugin/src/main/java/org/jboss/maven/plugins/test/ext/ExtenderMojo.java 2007-07-14 17:54:52 UTC (rev 13505)
+++ labs/jbossbuild/maven-plugins/trunk/maven-test-ext-plugin/src/main/java/org/jboss/maven/plugins/test/ext/ExtenderMojo.java 2007-07-14 18:43:17 UTC (rev 13506)
@@ -59,7 +59,8 @@
* plugins resources (extend.dtd)
*
* @goal extend
- * @phase generate-resources
+ * @phase test-compile
+ * @requiresDependencyResolution
*
* @author Steve Ebersole
*/
@@ -183,16 +184,18 @@
return new DocumentLoader( getLog() ).loadDocument( extenderConfigFile );
}
+
// extend classpath ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- protected void extendTestClasspath(Environment environment)
- throws MojoExecutionException {
+ protected void extendTestClasspath(Environment environment) throws MojoExecutionException {
attachDependencies( environment.getDependencies() );
attachResources( environment.getResources() );
}
protected void attachDependencies(List dependencies) throws MojoExecutionException {
- getLog().info( "extending via dependencies" );
+ Set combinedDependencyArtifacts = new HashSet();
+ combinedDependencyArtifacts.addAll( project.getDependencyArtifacts() );
+
Set artifacts = new HashSet();
Iterator itr = dependencies.iterator();
while ( itr.hasNext() ) {
@@ -240,6 +243,7 @@
if ( ! artifact.isResolved() ) {
artifactResolver.resolve( artifact, node.getRemoteRepositories(), localRepository );
}
+ getLog().info( "adding dependency artifact [" + extenderEnv + "] : " + artifact.getId() );
}
}
@@ -250,15 +254,9 @@
throw new MojoExecutionException( "Unable to resolve artifact " + buildInfo( e ) + " : " + e.getMessage(), e );
}
- ArrayList allDependencies = new ArrayList();
- allDependencies.addAll( project.getDependencies() );
- allDependencies.addAll( dependencies );
- project.setDependencies( allDependencies );
-
- HashSet allArtifacts = new HashSet();
- allArtifacts.addAll( project.getArtifacts() );
- allArtifacts.addAll( artifacts );
- project.setArtifacts( allArtifacts );
+ combinedDependencyArtifacts.addAll( artifacts );
+ project.setDependencyArtifacts( combinedDependencyArtifacts );
+ project.setArtifacts( null );
}
protected void attachResources(List resources) {
More information about the jboss-svn-commits
mailing list