MPANT-14 fix

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@115185 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
aheritier 2004-05-04 00:18:10 +00:00
parent 8347ca55f9
commit eca727336d
3 changed files with 88 additions and 46 deletions

View File

@ -62,6 +62,16 @@
<role>Release Manager</role> <role>Release Manager</role>
</roles> </roles>
</developer> </developer>
<developer>
<name>Arnaud Heritier</name>
<id>aheritier</id>
<email>aheritier@apache.org</email>
<organization/>
<roles>
<role>Java Developer</role>
</roles>
<timezone>+1</timezone>
</developer>
</developers> </developers>
<dependencies> <dependencies>
<dependency> <dependency>

View File

@ -73,53 +73,75 @@
<mkdir dir="$${classesdir}"/> <mkdir dir="$${classesdir}"/>
<javac <j:if test="${sourcesPresent}">
destdir="$${classesdir}" <javac
excludes="**/package.html" destdir="$${classesdir}"
debug="true" excludes="**/package.html"
deprecation="true" debug="true"
optimize="false"> deprecation="true"
<src> optimize="false">
<pathelement location="${srcDir}"/> <src>
</src> <pathelement location="${srcDir}"/>
<classpath> </src>
<fileset dir="$${libdir}"> <classpath>
<include name="*.jar"/> <fileset dir="$${libdir}">
</fileset> <include name="*.jar"/>
</classpath> </fileset>
</javac> </classpath>
</javac>
</j:if>
<!-- <!--
| Copy any resources that must be present in the deployed | Copy any resources that must be present in the deployed
| JAR file. | JAR file.
--> -->
<j:forEach var="resource" items="${pom.build.resources}"> <j:forEach var="resource" items="${pom.build.resources}">
<copy todir="$${classesdir}">
<maven:makeRelativePath var="dir" basedir="${basedir}" path="${resource.directory}" separator="/"/>
<j:if test="${empty dir}"> <j:choose trim="true">
<j:set var="dir" value="."/> <j:when test="${(resource.targetPath != null) &amp;&amp; (!resource.targetPath.equals(''))}">
</j:if> <j:set var="outputDir" value="$${classesdir}/${resource.targetPath}"/>
<mkdir dir="$${classesdir}/${resource.targetPath}"/>
<fileset dir="${dir}"> </j:when>
<j:otherwise>
<j:forEach var="res" items="${resource.includes}"> <j:set var="outputDir" value="$${classesdir}"/>
<include name="${res}"/> </j:otherwise>
</j:forEach> </j:choose>
<j:forEach var="res" items="${resource.excludes}">
<exclude name="${res}"/> <copy todir="${outputDir}">
</j:forEach>
</fileset> <maven:makeRelativePath var="dir" basedir="${basedir}" path="${resource.directory}" separator="/"/>
</copy>
<j:if test="${empty dir}">
<j:set var="dir" value="."/>
</j:if>
<fileset dir="${dir}">
<j:forEach var="res" items="${resource.includes}">
<include name="${res}"/>
</j:forEach>
<j:forEach var="res" items="${resource.excludes}">
<exclude name="${res}"/>
</j:forEach>
</fileset>
</copy>
</j:forEach> </j:forEach>
<!-- Copy any resources required for unit testing --> <!-- Copy any resources required for unit testing -->
<j:forEach var="resource" items="${pom.build.unitTest.resources}"> <j:forEach var="resource" items="${pom.build.unitTest.resources}">
<copy todir="$${testclassesdir}"> <j:choose trim="true">
<j:when test="${(resource.targetPath != null) &amp;&amp; (!resource.targetPath.equals(''))}">
<j:set var="outputDir" value="$${testclassesdir}/${resource.targetPath}"/>
<mkdir dir="$${testclassesdir}/${resource.targetPath}"/>
</j:when>
<j:otherwise>
<j:set var="outputDir" value="$${testclassesdir}"/>
</j:otherwise>
</j:choose>
<copy todir="${outputDir}">
<maven:makeRelativePath var="dir" basedir="${basedir}" path="${resource.directory}" separator="/"/> <maven:makeRelativePath var="dir" basedir="${basedir}" path="${resource.directory}" separator="/"/>
@ -259,18 +281,27 @@
</j:if> </j:if>
<j:if test="${maven.has.test.resource.patterns}"> <j:if test="${maven.has.test.resource.patterns}">
<copy todir="$${testclassesdir}"> <j:forEach var="resource" items="${pom.build.unitTest.resources}">
<fileset dir="${pom.build.unitTestSourceDirectory}"> <j:choose trim="true">
<j:forEach var="resource" items="${pom.build.unitTest.resources}"> <j:when test="${(resource.targetPath != null) &amp;&amp; (!resource.targetPath.equals(''))}">
<j:forEach var="res" items="${resource.includes}"> <j:set var="outputDir" value="$${testclassesdir}/${resource.targetPath}"/>
<include name="${res}"/> <mkdir dir="$${testclassesdir}/${resource.targetPath}"/>
</j:forEach> </j:when>
<j:forEach var="res" items="${resource.excludes}"> <j:otherwise>
<exclude name="${res}"/> <j:set var="outputDir" value="$${testclassesdir}"/>
</j:forEach> </j:otherwise>
</j:forEach> </j:choose>
</fileset> <copy todir="${outputDir}">
</copy> <fileset dir="${pom.build.unitTestSourceDirectory}">
<j:forEach var="res" items="${resource.includes}">
<include name="${res}"/>
</j:forEach>
<j:forEach var="res" items="${resource.excludes}">
<exclude name="${res}"/>
</j:forEach>
</fileset>
</copy>
</j:forEach>
</j:if> </j:if>
</j:if> </j:if>
</target> </target>

View File

@ -25,6 +25,7 @@
</properties> </properties>
<body> <body>
<release version="1.7" date="in CVS"> <release version="1.7" date="in CVS">
<action dev="aheritier" type="fix" issue="MPANT-14">Resources are correctly copied to the specified targetPath.</action>
<action dev="aheritier" type="fix" issue="MPANT-13">Corrects also NumberFormatException. <code>pom.build.unitTest.resources</code> is made up of several <code>resource</code> elements.</action> <action dev="aheritier" type="fix" issue="MPANT-13">Corrects also NumberFormatException. <code>pom.build.unitTest.resources</code> is made up of several <code>resource</code> elements.</action>
<action dev="aheritier" type="fix" issue="MPANT-12">Remove NumberFormatException if <code>pom.build.unitTest.resources</code> doesn't exist.</action> <action dev="aheritier" type="fix" issue="MPANT-12">Remove NumberFormatException if <code>pom.build.unitTest.resources</code> doesn't exist.</action>
<action dev="dion" type="fix" issue="MPANT-11">Change plugin tests to use 'assert' tags</action> <action dev="dion" type="fix" issue="MPANT-11">Change plugin tests to use 'assert' tags</action>