History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: MPANT-13
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Arnaud Heritier
Reporter: Matthias Kerkhoff
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Maven 1.x Ant Plugin

pom.build.unitTest.resources.includes is illegal

Created: 28/Apr/04 03:17 PM   Updated: 29/Apr/04 01:06 AM
Component/s: None
Affects Version/s: 1.6, 1.7
Fix Version/s: 1.7

Time Tracking:
Not Specified

Environment: any
Issue Links:
dependent
 


 Description  « Hide
build.jelly, line 246 (as of 27/04/2004 ) contains the
following code block:

<j:choose trim="true">
<j:when test="${!pom.build.unitTest.resources.includes.isEmpty()}">
<j:set var="maven.has.test.resource.patterns" value="true"/>
</j:when>
<j:when test="${!pom.build.unitTest.resources.excludes.isEmpty()}">
<j:set var="maven.has.test.resource.patterns" value="true"/>
</j:when>
</j:choose>

<j:if test="${maven.has.test.resource.patterns}">

<copy todir="$${testclassesdir}">
<fileset dir="${pom.build.unitTestSourceDirectory}">
<j:forEach var="res" items="${pom.build.unitTest.resources.includes}">
<include name="${res}"/>
</j:forEach>
<j:forEach var="res" items="${pom.build.unitTest.resources.excludes}">
<exclude name="${res}"/>
</j:forEach>
</fileset>
</copy>
</j:if>

According to the schema definition, there can not be a
build.unitTest.resources.includes
element. Actually, there is an intermediate <resource>
level.

The above mentioned block causes jelly exceptions in
(at least) rc2 and the current snapshots.
A symptom of this bug is that "maven dist" will fail
to build a source distribution".

A proper solution would be to add a nested iteration over
all <resources>/<resouce> elements. We have choosen to
<j:if>def the block pasted above, which gives as a working
"maven dist" too.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Arnaud Heritier - 28/Apr/04 03:24 PM
Don't you think that your problem is the same as MPANT-12 ??
I corrected it Monday on CVS.

Matthias Kerkhoff - 28/Apr/04 04:17 PM
This is issue is related to MPANT-12.
Sadly MPANT-12 is alread closed, and I do
not have the rights to reopen it due to not
being fixed.
Adding a simple <j:if...> does not help to
fix MPANT-12 and MPANT-13. Please study the
maven-project-3.xsd schema. The current code
only catches the cases without a a unitTest-
resources element. If one is present, the bug
will still appear! My bug report was filed
against the code base from 27/04/2004. Didn't
I mention it?

Matthias Kerkhoff - 28/Apr/04 04:23 PM
Actually, I notice that my cited code was taken
from the 1.6 version. The supposed fix does however
not work - I spent more time with it today than I
actually wanted to.

However - an easy test for the fix is to setup a
project.xml that contains the block:

<unitTest>
<includes>
<include>**/*Test.java</include>
</includes>

<!-- unit test resources -->
<resources>
<resource>
<directory>${project_root_dir}</directory>
<targetPath>..</targetPath>
<includes>
<include>test/testdata/**</include>
</includes>
<excludes>
<exclude>test/testdata/placeholder.txt</exclude>
</excludes>
</resource>
</resources>
</unitTest>

which is just cut&paste from our project.xml. Project.xml's
like this will still fail. Just try it!

Please let me know if further information is needed.


Arnaud Heritier - 28/Apr/04 04:57 PM
Ok. Sorry Matthias I didn't saw the date. With your example I reproduce the problem. I'll see if I can resolve it.
Thks.

Arnaud Heritier - 28/Apr/04 05:21 PM
I commited a fix.
I tested it with your example and it's good.
Can you verify it ?
If it's good I'll close (definitively I hope) this issue.

Matthias Kerkhoff - 29/Apr/04 12:50 AM
Wow. Very fast. I'm impressed!
I've already tried the latest version and
it works for me.
There is - however - still one more issue
with the test resources. As it is not directly
related I'll create a new issue for it.