Brett Porter wrote:
Are you saying this is a regression or has always been a problem? We
need to decide whether this blocks the 2.0.2 release.
I don't think it's a regression. It doesn't work in 2.0, 2.0.1 and
2.1-SNAPSHOT. Take a look at the following:
I've got 19 unit tests and 22 integration-tests
[EMAIL PROTECTED]:~/cvsroot/webapp$ find src/tests/ -type f -name "*.java"|wc -l
19
[EMAIL PROTECTED]:~/cvsroot/webapp$ find src/integration-tests/ -type f
-name "*.java"|wc -l
22
[EMAIL PROTECTED]:~/cvsroot/webapp$ mvn -version
Maven version: 2.0*
[EMAIL PROTECTED]:~/cvsroot/webapp$ mvn clean test-compile
[cut]
[INFO] [compiler:compile]
Compiling 225 source files to /home/pablo/cvsroot/webapp/target/classes
[cut]
[INFO] [compiler:testCompile]
Compiling 19 source files to /home/pablo/cvsroot/webapp/target/test-classes
[cut]
[INFO] [compiler:testCompile {execution: testy}]
Compiling 19 source files to
/home/pablo/cvsroot/webapp/target/integration-tests
Conclusion - testCompile for [execution: testy] used src/tests instead
of src/integration-tests and the contents of
target/integration-tests-classes is exactly the same as the content of
target/test-classes.
[EMAIL PROTECTED]:~/cvsroot/webapp$ mvn -version
Maven version: 2.0.1*
[EMAIL PROTECTED]:~/cvsroot/webapp$ mvn clean test-compile
[cut]
[INFO] [compiler:compile]
Compiling 225 source files to /home/pablo/cvsroot/webapp/target/classes
[cut]
[INFO] [compiler:testCompile]
Compiling 19 source files to /home/pablo/cvsroot/webapp/target/test-classes
[cut]
[INFO] [compiler:testCompile {execution: testy}]
Compiling 19 source files to
/home/pablo/cvsroot/webapp/target/integration-tests
The same situation as above
[EMAIL PROTECTED]:~/cvsroot/webapp$ mvn -version
Maven version: 2.1-SNAPSHOT*
[EMAIL PROTECTED]:~/cvsroot/webapp$ mvn clean test-compile
[cut]
[INFO] [compiler:compile]
Compiling 225 source files to /home/pablo/cvsroot/webapp/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
Compiling 19 source files to /home/pablo/cvsroot/webapp/target/test-classes
[INFO] [compiler:testCompile {execution: testy}]
Compiling 19 source files to
/home/pablo/cvsroot/webapp/target/integration-tests
Exactly the same behavior so nothing has changed.
compiler:testCompile with execution: testy is configured in the
following way:
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<encoding>iso-8859-2</encoding>
</configuration>
<executions>
<execution>
<id>testy</id>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
<configuration>
<compileSourceRoots>
<compileSourceRoot>src/integration-tests</compileSourceRoot>
</compileSourceRoots>
<outputDirectory>${project.build.directory}/integration-tests</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
The above compileSourceRoots entry is ignored and plugin uses the
default value set in the Mojo: ${project.testCompileSourceRoots} which
defaults to src/tests/java set in
<testSourceDirectory>src/tests/java</testSourceDirectory>
However outputDirectory is set correctly (take a look at outputs)
because it's not a List.
And now I do the same but in a different way. I wrote a plugin that uses
code used in compiler plugin to compile integration tests by my own.
execution:testy for maven-compiler-plugin is disabled and my plugin is
enabled. In the above cases my plugin was disabled!
[EMAIL PROTECTED]:~/cvsroot/webapp$ mvn clean test-compile
[INFO] Scanning for projects...
[INFO]
----------------------------------------------------------------------------
[INFO] Building Webapp
[INFO] task-segment: [clean, test-compile]
[INFO]
----------------------------------------------------------------------------
[INFO] [clean:clean]
[INFO] Deleting directory /home/pablo/cvsroot/webapp/target
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
Compiling 225 source files to /home/pablo/cvsroot/webapp/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
Compiling 19 source files to /home/pablo/cvsroot/webapp/target/test-classes
[INFO] [ittomcat:compile {execution: default}]
Compiling 22 source files to
/home/pablo/cvsroot/webapp/target/integration-tests-classes
[INFO]
----------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
----------------------------------------------------------------------------
[INFO] Total time: 12 seconds
[INFO] Finished at: Thu Jan 12 12:42:05 CET 2006
[INFO] Final Memory: 8M/24M
[INFO]
----------------------------------------------------------------------------
My plugin is configured in the following way:
<configuration>
[cut]
<sources>
<source>src/integration-tests</source>
</sources>
[cut]
</configuration>
testOutputDirectory is set as @parameter expression =
"${project.build.directory}/integration-tests-classes"
Sources are set correctly.
However if I had set @parameter
expression="${some_field_representing_list}" for List sources, <sources>
in <configuration> in pom.xml would have been ignored. I've already
checked this before sending this bug report.
Cheers
Pablo
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]