MPECLIPSE-37: Cactus jar added in a specific condition

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115945 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
epugh 2004-08-10 07:41:17 +00:00
parent 5e5035394b
commit fc1dd3c713
5 changed files with 17 additions and 3 deletions

View File

@ -116,6 +116,7 @@
<j:set var="cactusSourcePresent" value="true"/>
</u:available>
<j:set var="ignoreCactus" value="false" />
<j:if test="${cactusSourcePresent == 'true'}">
<ant:echo>Contains Cactus Tests!</ant:echo>
<maven:makeRelativePath var="testSrcDir" basedir="${basedir}" path="${cactusSrcDir}" />
@ -124,6 +125,7 @@
<maven:pluginVar var="cactusPlugin" plugin='cactus-maven' property='plugin' />
<j:set var="depVersion">${cactusPlugin.getDependency('cactus').getVersion()}</j:set>
<classpathentry kind="var" path="MAVEN_REPO/cactus/jars/cactus-${depVersion}.jar"/>
<j:set var="ignoreCactus" value="true" />
</j:if>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
@ -140,6 +142,9 @@
<j:when test="${lib.dependency.groupId == 'junit' and ignoreJUnit}">
<!-- ignoring junit dependency as we've already created it -->
</j:when>
<j:when test="${lib.dependency.groupId == 'cactus' and ignoreCactus}">
<!-- ignoring junit dependency as we've already created it -->
</j:when>
<j:otherwise>
<!-- make sure it's a classpath dependency -->
<j:set var="isClasspath" value="${lib.dependency.isAddedToClasspath()}"/>

View File

@ -38,8 +38,10 @@
<u:file var="classpathFile" name="${dotClasspath}"/>
<x:parse var="classpathDoc" xml="${classpathFile.toURL()}" />
<x:set var="count" select="count($classpathDoc/classpath/classpathentry[contains(@path,'MAVEN_REPO/junit/jars/junit-3.8.1.jar')])"/>
<assert:assertEquals expected="1" value="${count.intValue().toString()}" msg="JUnit dependency not found"/>
<x:set var="countJUnit" select="count($classpathDoc/classpath/classpathentry[contains(@path,'MAVEN_REPO/junit/jars/junit-3.8.1.jar')])"/>
<assert:assertEquals expected="1" value="${countJUnit.intValue().toString()}" msg="JUnit dependency not found"/>
<x:set var="countCactus" select="count($classpathDoc/classpath/classpathentry[contains(@path,'MAVEN_REPO/cactus/jars/cactus-13-1.6.1.jar')])"/>
<assert:assertEquals expected="1" value="${countCactus.intValue().toString()}" msg="More than one Cactus dependencies found"/>
</goal>
@ -109,7 +111,7 @@
<u:file var="classpathFile" name="${dotClasspath}"/>
<x:parse var="classpathDoc" xml="${classpathFile.toURL()}" />
<x:set var="count" select="count($classpathDoc/classpath/classpathentry[contains(@kind,'src')])"/>
<assert:assertEquals expected="2" value="${count.intValue().toString()}"/>
<assert:assertEquals expected="3" value="${count.intValue().toString()}"/>
</goal>

View File

@ -0,0 +1 @@
cactus.src.dir=.

View File

@ -63,5 +63,10 @@
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>cactus</groupId>
<artifactId>cactus</artifactId>
<version>13-1.6.1</version>
</dependency>
</dependencies>
</project>

View File

@ -25,6 +25,7 @@
</properties>
<body>
<release version="1.8" date="In CVS">
<action dev="epugh" type="fix" issue="MPECLIPSE-37" due-to="Felipe Leme">Fixed a 'race condition' where Cactus dependency is added twice to .classpath.</action>
<action dev="epugh" type="add" issue="MPECLIPSE-27" due-to="Kristopher Brown">Add eclipse:clean goal.</action>
<action dev="epugh" type="fix" issue="MPECLIPSE-36" due-to="Felipe Leme">Fixed a 'race condition' where JUnit dependency is not added to .classpath.</action>
<action dev="epugh" type="add">Add maven.gen.src property that points to a directory whose subdirectories are included as separate source directories.</action>