From 28e2b08266908202958cf3b624f97d25f5b3c69c Mon Sep 17 00:00:00 2001 From: John Dennis Casey Date: Tue, 11 Oct 2005 21:20:13 +0000 Subject: [PATCH] Removing restrictions on adding pluginArtifacts to the test classpath in surefire, since they should go behind the classpath elements from the project...also adding system scope handling to the artifact facotry, so transitive dependencies on system-scoped deps are handled correctly. git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@312958 13f79535-47bb-0310-9956-ffa450edef68 --- .../maven/artifact/factory/DefaultArtifactFactory.java | 5 +++++ .../org/apache/maven/plugin/resources/ResourcesMojo.java | 2 +- .../main/java/org/apache/maven/test/SurefirePlugin.java | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java b/maven-artifact/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java index e65ff6b1b2..8c3fddc016 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/factory/DefaultArtifactFactory.java @@ -127,6 +127,11 @@ public class DefaultArtifactFactory // added to retain compile scope. Remove if you want compile inherited as runtime desiredScope = Artifact.SCOPE_COMPILE; } + else if ( Artifact.SCOPE_SYSTEM.equals( scope ) ) + { + // system scopes come through unchanged... + desiredScope = Artifact.SCOPE_SYSTEM; + } if ( Artifact.SCOPE_TEST.equals( inheritedScope ) ) { diff --git a/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java b/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java index 2cc5e3dccc..43af59c26c 100644 --- a/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java +++ b/maven-plugins/maven-resources-plugin/src/main/java/org/apache/maven/plugin/resources/ResourcesMojo.java @@ -163,7 +163,7 @@ public class ResourcesMojo private void initializeFiltering() throws MojoExecutionException { - filterProperties = new Properties(); + filterProperties = new Properties( System.getProperties() ); for ( Iterator i = filters.iterator(); i.hasNext(); ) { String filtersfile = (String) i.next(); diff --git a/maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java b/maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java index 9495b7ccbc..d465c43556 100644 --- a/maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java +++ b/maven-plugins/maven-surefire-plugin/src/main/java/org/apache/maven/test/SurefirePlugin.java @@ -272,12 +272,12 @@ public class SurefirePlugin { Artifact artifact = (Artifact) i.next(); - if ( "junit".equals( artifact.getArtifactId() ) || "surefire".equals( artifact.getArtifactId() ) ) - { - getLog().debug( artifact.getFile().getAbsolutePath() ); +// if ( "junit".equals( artifact.getArtifactId() ) || "surefire".equals( artifact.getArtifactId() ) ) +// { + getLog().debug( "Adding to surefire test classpath: " + artifact.getFile().getAbsolutePath() ); surefireBooter.addClassPathUrl( artifact.getFile().getAbsolutePath() ); - } +// } } addReporters(surefireBooter);