I had some problems getting the eclipse plugin to work well with the Junit syntax.
I noticed that the eclipse plugin work with the following syntax in the project.xml:
----
<unitTestSourceDirectory> ${basedir}/src/test </unitTestSourceDirectory>
----
However, I noticed in the maven manual that you should use (I think the other is depriated):
-----
<unitTest>
<resources>
<resource>
<directory>${basedir}/src/test</directory>
</resource>
</resources>
</unitTest>
-----
So I changed the classpath.jelly a little bit of the maven-eclipse plugin.
I added the code below (simple changes, most of it is copied from existing code in the plugin but with other xml variables). This works fine (probably can be better but this is the first time I saw jelly code).
How is this code handled ? Will it be added to a new version of this plugin ??
Regards, Ed Bras
-----
<j:forEach var="resource" items="${pom.build.unitTest.resources}">
<ant:echo>Contains JUnit tests</ant:echo><maven:makeRelativePath var="testSrcDir" basedir="${basedir}" path="${resource.directory}"/>
<!-- Eclipse supports an output directory per input directory -->
<j:set var="testOutputDir" value="${maven.eclipse.test.output.dir}"/>
<j:if test="${empty testOutputDir}">
<j:set var="testOutputDir"
value="${pom.getPluginContext('maven-test-plugin').getVariable('maven.test.dest')}"/>
</j:if>
<maven:makeRelativePath var="testOutputDir" basedir="${basedir}" path="${testOutputDir}" />
<ant:echo>Setting compile of ${testSrcDir} to ${testOutputDir}</ant:echo>
<classpathentry kind="src" path="${testSrcDir}" output="${testOutputDir}"/>
<!-- Add JUNIT to classpath: Here are the rules:
If the project has maven.eclipse.junit property, add that ver of junit
If the project has maven.eclipse.junit property and it is empty, don't add junit
If the project has junit dep, use that.
Use the test plugin version
-->
<j:set var="verX" value="${maven.eclipse.junit}X"/>
<j:set var="depVersion">${pom.getPluginContext('maven-test-plugin').getVariable('plugin').getDependency('junit').getVersion()}</j:set>
<j:if test="${pom.getDependency('junit') != null}">
<j:set var="depVersion" value="${pom.getDependency('junit').getVersion()}"/>
</j:if>
<j:if test="${verX != 'X'}">
<j:set var="depVersion">${maven.eclipse.junit}</j:set>
</j:if> <j:if test="${verX == 'noneX'}">
<j:set var="depVersion" value="none"/>
</j:if><j:if test="${depVersion != 'none'}">
<classpathentry kind="var" path="MAVEN_REPO/junit/jars/junit-${depVersion}.jar"/>
</j:if>
</j:forEach>
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
