Update the .classpath output such that it utilises the per source directory

output path.

At the moment, 

source dir -> default output path (i.e. unset)
test dir -> test output path (eg. target/test-classes)
default output path ->  (eg. target/classes).

There could be some argument to go to a system like

source dir -> output path (eg. target/classes).
test dir -> test output path (eg. target/test-classes)
default output path ->  (eg. target/classes).

But it'd make the plugin.jelly a bit more complicated than it already is.

I'm very tempted to extract the code out into a separate jelly file and let it follow
the xdoc/navigation.jelly pattern. 

This also fixes the "missing target/test-classes" errors that eclipse was giving.


git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@113731 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
bwalding
2003-07-27 22:51:52 +00:00
parent 844c0078fc
commit 3da380e2e9

View File

@@ -85,7 +85,28 @@
<!-- cut off also slash or backslash -->
<j:set var="testSrcDir" value="${testSrcDir.substring(1)}"/>
</j:if>
<classpathentry kind="src" path="${testSrcDir}"/>
<!-- 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>
<j:if test="${ testOutputDir.startsWith( basedir ) }">
<ant:echo>Cutting off basedir from testOutputDir</ant:echo>
<j:set var="testOutputDir" value="${testOutputDir.substring(basedir.length())}"/>
<!--
cut off also slash or backslash from basedir.
Is there a way to make it in one step in Jelly?
-->
<j:set var="testOutputDir" value="${testOutputDir.substring(1)}"/>
</j:if>
<classpathentry kind="src" path="${testSrcDir}" output="${testOutputDir}"/>
<!-- 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
@@ -153,25 +174,6 @@
<!-- add the unit test build directory so that any files generated via Maven are available -->
<j:if test="${unitTestSourcesPresent}">
<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>
<j:if test="${ testOutputDir.startsWith( basedir ) }">
<ant:echo>Cutting off basedir from testOutputDir</ant:echo>
<j:set var="testOutputDir" value="${testOutputDir.substring(basedir.length())}"/>
<!--
cut off also slash or backslash from basedir.
Is there a way to make it in one step in Jelly?
-->
<j:set var="testOutputDir" value="${testOutputDir.substring(1)}"/>
</j:if>
<classpathentry kind="lib" path="${testOutputDir}"/>
</j:if>
<j:set var="outputDir" value="${maven.eclipse.output.dir}"/>
<j:if test="${empty outputDir}">
<j:set var="outputDir" value="${maven.build.dest}"/>