Moved test classpath before main so test classpath resources override main ones

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@190759 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
carlos 2005-06-15 15:22:57 +00:00
parent 6ea24eca41
commit c50b7519d3
2 changed files with 59 additions and 55 deletions

View File

@ -27,67 +27,12 @@
trim="true"> trim="true">
<classpath> <classpath>
<!-- Add any generated source directories as seperate src directories -->
<u:available file="${maven.gen.src}">
<u:file var="genSrcRootDir" name="${maven.gen.src}"/>
<j:forEach var="genSrcDir" items="${genSrcRootDir.listFiles()}">
<maven:makeRelativePath var="srcDir" basedir="${basedir}" path="${genSrcDir}" separator="/"/>
<classpathentry kind="src" path="${srcDir}"/>
</j:forEach>
</u:available>
<j:if test="${unitTestSourcesPresent}"> <j:if test="${unitTestSourcesPresent}">
<ant:echo>Contains JUnit tests</ant:echo> <ant:echo>Contains JUnit tests</ant:echo>
<maven:makeRelativePath var="testSrcDir" basedir="${basedir}" path="${pom.build.unitTestSourceDirectory}" separator="/"/> <maven:makeRelativePath var="testSrcDir" basedir="${basedir}" path="${pom.build.unitTestSourceDirectory}" separator="/"/>
</j:if> </j:if>
<j:if test="${sourcesPresent}">
<maven:makeRelativePath var="srcDir" basedir="${basedir}" path="${pom.build.sourceDirectory}" separator="/"/>
<j:set var="excluding" value=""/>
<j:forEach var="sm" items="${pom.build.sourceModifications}">
<ant:available property="classPresent" classname="${sm.className}"/>
<j:if test="${classPresent != 'true'}">
<j:forEach var="exclude" items="${sm.excludes}">
<j:choose>
<j:when test="${excluding.length() == 0}">
<j:set var="excluding" value="${exclude}"/>
</j:when>
<j:otherwise>
<j:set var="excluding" value="${excluding},${exclude}"/>
</j:otherwise>
</j:choose>
</j:forEach>
</j:if>
</j:forEach>
<classpathentry kind="src" path="${srcDir}" excluding="${excluding}" />
<j:if test="${maven.eclipse.resources.addtoclasspath}">
<j:if test="${!pom.build.resources.isEmpty()}">
<j:forEach var="resource" items="${pom.build.resources}">
<j:set var="includingAsString" value="" />
<j:forEach var="res" items="${resource.includes}">
<j:set var="includingAsString" value="${includingAsString}${res}|" />
</j:forEach>
<j:set var="excludingAsString" value="" />
<j:forEach var="res" items="${resource.excludes}">
<j:set var="excludingAsString" value="${excludingAsString}${res}|" />
</j:forEach>
<maven:makeRelativePath var="resourceDirectory" basedir="${basedir}" path="${resource.directory}" separator="/"/>
<!-- don't add duplicate directories -->
<j:if test="${!resourceDirectory.equals(srcDir) and (!resourceDirectory.equals(testSrcDir) or !unitTestSourcesPresent)}">
<classpathentry kind="src" path="${resourceDirectory}" including="${includingAsString}" excluding="${excludingAsString}" />
</j:if>
</j:forEach>
</j:if>
</j:if>
</j:if>
<!-- Add the list of additional directories for the classpath from ${maven.eclipse.classpath.include}-->
<u:tokenize var="maven.eclipse.classpath.include.split" delim=",">${maven.eclipse.classpath.include}</u:tokenize>
<!-- add extra directories to be included in the classpath -->
<j:forEach var="res" items="${maven.eclipse.classpath.include.split}">
<maven:makeRelativePath var="srcDir" basedir="${basedir}" path="${res}" separator="/"/>
<classpathentry kind="src" path="${srcDir}"/>
</j:forEach>
<!-- set a flag so JUnit jar is included only once --> <!-- set a flag so JUnit jar is included only once -->
<j:set var="ignoreJUnit" value="false" /> <j:set var="ignoreJUnit" value="false" />
<j:if test="${unitTestSourcesPresent}"> <j:if test="${unitTestSourcesPresent}">
@ -159,6 +104,64 @@
</j:if> </j:if>
</j:if> </j:if>
<!-- Add any generated source directories as seperate src directories -->
<u:available file="${maven.gen.src}">
<u:file var="genSrcRootDir" name="${maven.gen.src}"/>
<j:forEach var="genSrcDir" items="${genSrcRootDir.listFiles()}">
<maven:makeRelativePath var="srcDir" basedir="${basedir}" path="${genSrcDir}" separator="/"/>
<classpathentry kind="src" path="${srcDir}"/>
</j:forEach>
</u:available>
<j:if test="${sourcesPresent}">
<maven:makeRelativePath var="srcDir" basedir="${basedir}" path="${pom.build.sourceDirectory}" separator="/"/>
<j:set var="excluding" value=""/>
<j:forEach var="sm" items="${pom.build.sourceModifications}">
<ant:available property="classPresent" classname="${sm.className}"/>
<j:if test="${classPresent != 'true'}">
<j:forEach var="exclude" items="${sm.excludes}">
<j:choose>
<j:when test="${excluding.length() == 0}">
<j:set var="excluding" value="${exclude}"/>
</j:when>
<j:otherwise>
<j:set var="excluding" value="${excluding},${exclude}"/>
</j:otherwise>
</j:choose>
</j:forEach>
</j:if>
</j:forEach>
<classpathentry kind="src" path="${srcDir}" excluding="${excluding}" />
<j:if test="${maven.eclipse.resources.addtoclasspath}">
<j:if test="${!pom.build.resources.isEmpty()}">
<j:forEach var="resource" items="${pom.build.resources}">
<j:set var="includingAsString" value="" />
<j:forEach var="res" items="${resource.includes}">
<j:set var="includingAsString" value="${includingAsString}${res}|" />
</j:forEach>
<j:set var="excludingAsString" value="" />
<j:forEach var="res" items="${resource.excludes}">
<j:set var="excludingAsString" value="${excludingAsString}${res}|" />
</j:forEach>
<maven:makeRelativePath var="resourceDirectory" basedir="${basedir}" path="${resource.directory}" separator="/"/>
<!-- don't add duplicate directories -->
<j:if test="${!resourceDirectory.equals(srcDir) and (!resourceDirectory.equals(testSrcDir) or !unitTestSourcesPresent)}">
<classpathentry kind="src" path="${resourceDirectory}" including="${includingAsString}" excluding="${excludingAsString}" />
</j:if>
</j:forEach>
</j:if>
</j:if>
</j:if>
<!-- Add the list of additional directories for the classpath from ${maven.eclipse.classpath.include}-->
<u:tokenize var="maven.eclipse.classpath.include.split" delim=",">${maven.eclipse.classpath.include}</u:tokenize>
<!-- add extra directories to be included in the classpath -->
<j:forEach var="res" items="${maven.eclipse.classpath.include.split}">
<maven:makeRelativePath var="srcDir" basedir="${basedir}" path="${res}" separator="/"/>
<classpathentry kind="src" path="${srcDir}"/>
</j:forEach>
<maven:get var="cactusSrcDir" plugin='cactus-maven' property='cactus.src.dir' /> <maven:get var="cactusSrcDir" plugin='cactus-maven' property='cactus.src.dir' />
<u:available file="${cactusSrcDir}"> <u:available file="${cactusSrcDir}">
<j:set var="cactusSourcePresent" value="true"/> <j:set var="cactusSourcePresent" value="true"/>

View File

@ -25,6 +25,7 @@
</properties> </properties>
<body> <body>
<release version="1.10" date="IN CVS"> <release version="1.10" date="IN CVS">
<action dev="carlos" type="fix">Moved test classpath before main so test classpath resources override main ones</action>
<action dev="epugh" type="fix" issue="MPECLIPSE-68">eclipse:add-maven-repo doesn't update correct Eclipse property file for Eclipse 3.x</action> <action dev="epugh" type="fix" issue="MPECLIPSE-68">eclipse:add-maven-repo doesn't update correct Eclipse property file for Eclipse 3.x</action>
<action dev="epugh" type="fix" issue="MPECLIPSE-67">add-maven-repo fails if Eclipse hasn't been started yet. Property file needs to be created <action dev="epugh" type="fix" issue="MPECLIPSE-67">add-maven-repo fails if Eclipse hasn't been started yet. Property file needs to be created
by the plugin.</action> by the plugin.</action>