use maven:pluginVar to retrieve reference to junit

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115670 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
epugh 2004-07-05 21:26:29 +00:00
parent a22fa33dfe
commit 6d309fa82e

View File

@ -437,15 +437,10 @@
<!-- Finally, if there are unit tests and we still do not have a specific <!-- Finally, if there are unit tests and we still do not have a specific
dependency on jUnit, use the version from the test plugin. --> dependency on jUnit, use the version from the test plugin. -->
<j:if test="${unitTestSourcesPresent and junitArtifact == null}" > <j:if test="${unitTestSourcesPresent and junitArtifact == null}" >
<!-- This goal forces the test plugin to be loaded.
TODO: In Maven beta 9, use the special test:eclipse tag instead. --> <maven:pluginVar var="testPlugin" plugin='maven-test-plugin' property='plugin' />
<attainGoal name="test:prepare-filesystem" /> <j:set var="junitArtifact">${testPlugin.getDependency('junit')}</j:set>
<j:set var="testPluginProject" value="${pom.getPluginContext('maven-test-plugin').getVariable('plugin')}"/>
<j:forEach var="testPluginArtifact" items="${testPluginProject.artifacts}">
<j:if test="${testPluginArtifact.dependency.artifactId == 'junit'}">
<j:set var="junitArtifact" value="${testPluginArtifact}"/>
</j:if>
</j:forEach>
<jbuilder:generateArtifactLibrary <jbuilder:generateArtifactLibrary
artifact="${junitArtifact}" artifact="${junitArtifact}"
userHome="${jbUserHome}" userHome="${jbUserHome}"