Hi. Surefire seems to include dependency artifacts with <scope> provided in the classpath when running unit tests. Is this a bug? Shouldn't such artifacts only be included in the compile-time classpath?
The output from 'mvn -X test' is shown below. The artifact that is causing problems for me is the javaee5-api.jar which should not be present in the runtime classpath (should be substituted with a real Java EE 5 container jar, not shown in the example below). + Error stacktraces are turned on. Maven version: 2.0.7 Java version: 1.6.0_01 OS name: "windows xp" version: "5.1" arch: "x86" ... [DEBUG] Configuring mojo ' org.apache.maven.plugins:maven-surefire-plugin:2.2:test' --> ... [DEBUG] (f) classpathElements = [..., ...\.m2\repository\javaee\javaee-api\5\javaee-api-5.jar, ...] ... [DEBUG] (f) projectArtifactMap = {javaee:javaee-api=javaee:javaee-api:jar:5:provided, junit:junit=junit:junit:jar:3.8.1:test} ... [DEBUG] -- end configuration -- ... [DEBUG] Test Classpath : ... [DEBUG] ...\.m2\repository\javaee\javaee-api\5\javaee-api-5.jar [DEBUG] ...\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar