You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2008/11/01 21:00:34 UTC
svn commit: r709766 - in
/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit:
AbstractDependencyMojo.java CompileMojo.java RuntimeMojo.java TestMojo.java
Author: bentmann
Date: Sat Nov 1 13:00:34 2008
New Revision: 709766
URL: http://svn.apache.org/viewvc?rev=709766&view=rev
Log:
o Extended goals to also dump the raw artifact collection
Modified:
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileMojo.java
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/RuntimeMojo.java
maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/TestMojo.java
Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java?rev=709766&r1=709765&r2=709766&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/AbstractDependencyMojo.java Sat Nov 1 13:00:34 2008
@@ -29,8 +29,8 @@
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
+import java.util.Collection;
import java.util.Iterator;
-import java.util.List;
/**
* Provides common services for all mojos of this plugin.
@@ -59,7 +59,7 @@
* @param artifacts The list of artifacts to write to the file, may be <code>null</code>.
* @throws MojoExecutionException If the output file could not be written.
*/
- protected void writeArtifacts( String pathname, List artifacts )
+ protected void writeArtifacts( String pathname, Collection artifacts )
throws MojoExecutionException
{
if ( pathname == null || pathname.length() <= 0 )
@@ -90,6 +90,7 @@
Artifact artifact = (Artifact) it.next();
writer.write( artifact.getId() );
writer.newLine();
+ getLog().info( "[MAVEN-CORE-IT-LOG] " + artifact.getId() );
}
}
}
@@ -121,7 +122,7 @@
* @param classPath The list of class path elements to write to the file, may be <code>null</code>.
* @throws MojoExecutionException If the output file could not be written.
*/
- protected void writeClassPath( String pathname, List classPath )
+ protected void writeClassPath( String pathname, Collection classPath )
throws MojoExecutionException
{
if ( pathname == null || pathname.length() <= 0 )
@@ -152,6 +153,7 @@
Object element = it.next();
writer.write( element.toString() );
writer.newLine();
+ getLog().info( "[MAVEN-CORE-IT-LOG] " + element );
}
}
}
Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileMojo.java?rev=709766&r1=709765&r2=709766&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/CompileMojo.java Sat Nov 1 13:00:34 2008
@@ -37,6 +37,16 @@
{
/**
+ * The path to the output file for the project artifacts, relative to the project base directory. Each line of this
+ * UTF-8 encoded file specifies an artifact identifier. If not specified, the artifact list will not be written to
+ * disk. Unlike the compile artifacts, the collection of project artifacts additionally contains those artifacts
+ * that do not contribute to the class path.
+ *
+ * @parameter expression="${depres.projectArtifacts}"
+ */
+ private String projectArtifacts;
+
+ /**
* The path to the output file for the compile artifacts, relative to the project base directory. Each line of this
* UTF-8 encoded file specifies an artifact identifier. If not specified, the artifact list will not be written to
* disk.
@@ -64,6 +74,7 @@
{
try
{
+ writeArtifacts( projectArtifacts, project.getArtifacts() );
writeArtifacts( compileArtifacts, project.getCompileArtifacts() );
writeClassPath( compileClassPath, project.getCompileClasspathElements() );
}
Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/RuntimeMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/RuntimeMojo.java?rev=709766&r1=709765&r2=709766&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/RuntimeMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/RuntimeMojo.java Sat Nov 1 13:00:34 2008
@@ -37,6 +37,16 @@
{
/**
+ * The path to the output file for the project artifacts, relative to the project base directory. Each line of this
+ * UTF-8 encoded file specifies an artifact identifier. If not specified, the artifact list will not be written to
+ * disk. Unlike the runtime artifacts, the collection of project artifacts additionally contains those artifacts
+ * that do not contribute to the class path.
+ *
+ * @parameter expression="${depres.projectArtifacts}"
+ */
+ private String projectArtifacts;
+
+ /**
* The path to the output file for the runtime artifacts, relative to the project base directory. Each line of this
* UTF-8 encoded file specifies an artifact identifier. If not specified, the artifact list will not be written to
* disk.
@@ -64,6 +74,7 @@
{
try
{
+ writeArtifacts( projectArtifacts, project.getArtifacts() );
writeArtifacts( runtimeArtifacts, project.getRuntimeArtifacts() );
writeClassPath( runtimeClassPath, project.getRuntimeClasspathElements() );
}
Modified: maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/TestMojo.java
URL: http://svn.apache.org/viewvc/maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/TestMojo.java?rev=709766&r1=709765&r2=709766&view=diff
==============================================================================
--- maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/TestMojo.java (original)
+++ maven/core-integration-testing/trunk/core-it-support/core-it-plugins/maven-it-plugin-dependency-resolution/src/main/java/org/apache/maven/plugin/coreit/TestMojo.java Sat Nov 1 13:00:34 2008
@@ -37,6 +37,16 @@
{
/**
+ * The path to the output file for the project artifacts, relative to the project base directory. Each line of this
+ * UTF-8 encoded file specifies an artifact identifier. If not specified, the artifact list will not be written to
+ * disk. Unlike the test artifacts, the collection of project artifacts additionally contains those artifacts that
+ * do not contribute to the class path.
+ *
+ * @parameter expression="${depres.projectArtifacts}"
+ */
+ private String projectArtifacts;
+
+ /**
* The path to the output file for the test artifacts, relative to the project base directory. Each line of this
* UTF-8 encoded file specifies an artifact identifier. If not specified, the artifact list will not be written to
* disk.
@@ -64,6 +74,7 @@
{
try
{
+ writeArtifacts( projectArtifacts, project.getArtifacts() );
writeArtifacts( testArtifacts, project.getTestArtifacts() );
writeClassPath( testClassPath, project.getTestClasspathElements() );
}