-
1. Re: Target directory is not correct for tests in new Maven b
adrian.brock Apr 4, 2007 9:26 AM (in response to adrian.brock)If I understand the code to the eclipse plugin correctly, it is not possible
to have a seperate output directory for tests unless you also build eclipse
classes into the same place as the normal maven build puts things:
org.apache.maven.plugin.eclipse.EclipsePlugin.buildDirectoryList(...)// If using the standard output location, don't mix the test output into it. String testOutput = null; boolean useStandardOutputDir = buildOutputDirectory .equals( new File( project.getBuild().getOutputDirectory() ) ); if ( useStandardOutputDir ) { testOutput = IdeUtils.toRelativeAndFixSeparator( projectBaseDir, new File( project.getBuild() .getTestOutputDirectory() ), false ); }
There's only one parameter that controls output so it is all or nothing.
We have this configured in jboss-parent<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-eclipse-plugin</artifactId> <configuration> <downloadSources>true</downloadSources> <buildOutputDirectory>target/eclipse-classes</buildOutputDirectory> </configuration> </plugin>
What we really want is the non-existant:<testOutputDirectory>target/eclipse-classes-tests</testOutputDirectory>
as well. -
2. Re: Target directory is not correct for tests in new Maven b
adrian.brock Apr 4, 2007 9:45 AM (in response to adrian.brock)This is the change that makes the AccessControl test work in eclipse.
- <classpathentry kind="src" path="src/tests"/> + <classpathentry kind="src" output="eclipse-classes-tests" path="src/tests"/>
-
3. Re: Target directory is not correct for tests in new Maven b
pgier Apr 4, 2007 12:49 PM (in response to adrian.brock)I removed the eclipse plugin configuration from the parent, and uploaded a new parent snapshot to snapshots.jboss.org.
Without the buildOutputDirectory parameter, the test classes are compiled to the default maven location test-classes.<classpathentry kind="src" path="src/tests" output="target/test-classes"/>
Does this work for you? -
4. Re: Target directory is not correct for tests in new Maven b
adrian.brock Apr 5, 2007 5:02 AM (in response to adrian.brock)That will work but introduces two other problems.
1) Whenever you do a maven clean, it will blow away the classes which
completely confuses eclipse's incremental compiler.
2) When I do a release, I don't want it to have classes compiled with eclipse's compiler.
I want to use the JDK compiler.
Those are the reasons why we use target/eclipse-classes[-tests] instead of the default
location. -
5. Re: Target directory is not correct for tests in new Maven b
kconner Apr 5, 2007 8:00 AM (in response to adrian.brock)"adrian@jboss.org" wrote:
Those are the reasons why we use target/eclipse-classes[-tests] instead of the default location.
This should be solvable using profiles. I'll give it a go once I have finished my current TS work. -
6. Re: Target directory is not correct for tests in new Maven b
kconner Apr 5, 2007 10:15 AM (in response to adrian.brock)"Kevin.Conner@jboss.com" wrote:
This should be solvable using profiles. I'll give it a go once I have finished my current TS work.
I have modified the root pom.xml and build/pom.xml to include an eclipse profile. This should create the eclipse configuration with separate build directories to the normal maven build.
Once these poms are updated execute the followingmvn -Peclipse
This will run eclipse:eclipse with a slightly different configuration to the normal build.
The directories used should be target/eclipse-classes and target/eclipse-tests-classes.
I had originally set the test directory to be eclipse-classes-tests but the eclipse plugin believed that this was a nested directory and thus ignored it (for resources anyway).
I am still seeing the eclipse configuration from jboss-parent so I have also had to override that in the build/pom.xml.