epugh 2004/08/09 07:28:15
Modified: eclipse/src/plugin-resources/templates classpath.jelly
eclipse/src/plugin-test project.xml maven.xml
eclipse/xdocs changes.xml
Log:
MPECLIPSE-36 JUnit jar not add in a specific condition
Revision Changes Path
1.19 +4 -2
maven-plugins/eclipse/src/plugin-resources/templates/classpath.jelly
Index: classpath.jelly
===================================================================
RCS file:
/home/cvs/maven-plugins/eclipse/src/plugin-resources/templates/classpath.jelly,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- classpath.jelly 23 Jul 2004 09:09:23 -0000 1.18
+++ classpath.jelly 9 Aug 2004 14:28:14 -0000 1.19
@@ -64,7 +64,8 @@
<maven:makeRelativePath var="srcDir" basedir="${basedir}" path="${res}" />
<classpathentry kind="src" path="${srcDir}"/>
</j:forEach>
-
+ <!-- set a flag so JUnit jar is included only once -->
+ <j:set var="ignoreJUnit" value="false" />
<j:if test="${unitTestSourcesPresent}">
<ant:echo>Contains JUnit tests</ant:echo>
<maven:makeRelativePath var="testSrcDir" basedir="${basedir}"
path="${pom.build.unitTestSourceDirectory}"/>
@@ -105,6 +106,7 @@
</j:if>
<j:if test="${depVersion != 'none'}">
+ <j:set var="ignoreJUnit" value="true" />
<classpathentry kind="var"
path="MAVEN_REPO/junit/jars/junit-${depVersion}.jar"/>
</j:if>
</j:if>
@@ -135,7 +137,7 @@
<j:when test="${eclipseDependency == 'false'}">
<!-- ignore specific dependencies -->
</j:when>
- <j:when test="${lib.dependency.groupId == 'junit'}">
+ <j:when test="${lib.dependency.groupId == 'junit' and ignoreJUnit}">
<!-- ignoring junit dependency as we've already created it -->
</j:when>
<j:otherwise>
1.5 +5 -0 maven-plugins/eclipse/src/plugin-test/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven-plugins/eclipse/src/plugin-test/project.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- project.xml 10 May 2004 23:36:56 -0000 1.4
+++ project.xml 9 Aug 2004 14:28:14 -0000 1.5
@@ -58,5 +58,10 @@
<artifactId>commons-jelly-tags-xml</artifactId>
<version>20030211.142705</version>
</dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
</dependencies>
</project>
1.7 +10 -5 maven-plugins/eclipse/src/plugin-test/maven.xml
Index: maven.xml
===================================================================
RCS file: /home/cvs/maven-plugins/eclipse/src/plugin-test/maven.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- maven.xml 5 Jul 2004 14:32:10 -0000 1.6
+++ maven.xml 9 Aug 2004 14:28:14 -0000 1.7
@@ -28,17 +28,22 @@
<j:set var="dotClasspath" value="${basedir}/.classpath"/>
</goal>
- <goal name="test-eclipse">
+ <goal name="test-eclipse" prereqs="test-init">
<delete file="${dotProject}" failonerror="false"/>
<delete file="${dotClasspath}" failonerror="false"/>
<attainGoal name="eclipse"/>
<assert:assertFileExists file="${dotProject}" />
<assert:assertFileExists file="${dotClasspath}" />
+
+ <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"/>
</goal>
- <goal name="test-natures">
+ <goal name="test-natures" prereqs="test-init">
<delete file="${dotProject}" failonerror="false"/>
<j:set var="maven.eclipse.projectnatures" value="n1,a.b.c.n2"/>
<attainGoal name="eclipse:generate-project"/>
@@ -52,7 +57,7 @@
<assert:assertEquals expected="a.b.c.n2" value="${natures[2].text}"
msg="a.b.c.n2 is not the third nature"/>
</goal>
- <goal name="test-builders">
+ <goal name="test-builders" prereqs="test-init">
<j:set var="maven.eclipse.buildcommands" value="c1,c2,c3"/>
<delete file="${dotProject}" failonerror="false"/>
<attainGoal name="eclipse:generate-project"/>
@@ -68,7 +73,7 @@
</goal>
- <goal name="test-natures-and-builders">
+ <goal name="test-natures-and-builders" prereqs="test-init">
<delete file="${dotProject}" failonerror="false"/>
<j:set var="maven.eclipse.projectnatures" value="n7,n9,n11"/>
<j:set var="maven.eclipse.buildcommands" value="c11,c21,c31"/>
@@ -91,7 +96,7 @@
<assert:assertEquals expected="c31" value="${builders[3].text}" msg="c31 is not
the second build command name"/>
</goal>
- <goal name="test-classpath-has-generated-source">
+ <goal name="test-classpath-has-generated-source" prereqs="test-init">
<delete file="${dotProject}" failonerror="false"/>
<delete file="${dotClasspath}" failonerror="false"/>
<mkdir dir="${maven.gen.src}/gensrc1"/>
1.24 +1 -0 maven-plugins/eclipse/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/maven-plugins/eclipse/xdocs/changes.xml,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- changes.xml 9 Aug 2004 13:46:13 -0000 1.23
+++ changes.xml 9 Aug 2004 14:28:15 -0000 1.24
@@ -25,6 +25,7 @@
</properties>
<body>
<release version="1.8" date="In CVS">
+ <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>
<action dev="epugh" type="add" issue="MPECLIPSE-10" due-to="Thierry Lack">Set
eclipse.dependency=false to explicity ignore dependencies in classpath
generation</action>
<action dev="evenisse" type="fix" issue="MPECLIPSE-29" due-to="Marc-Antoine
Garrigue">Fix classpath generation when tests are not present</action>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]