Frode Stokke wrote on Tuesday, July 03, 2007 10:36 AM:

> 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?

Yes. Provided means, that the dependency will be available in the target 
runtime environment. But you don't run your tests there, so it must be 
available in the classpath running the test.

> 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

Why is it a problem for you, that it is available in the classpath for the test?

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to