Maven 1.x Ant Plugin

unitTest resources copied to wrong location

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6, 1.7
  • Fix Version/s: 1.7
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

It is possible to specify a directory
into which maven copies the specified
test resources. According to the schema
and the current implementation, it is
absolutly legal to have constructs like
the following in the project.xml:

<!-- Unit test classes -->
<unitTest>
<includes>
<include>**/*Test.java</include>
</includes>

<!-- unit test resources -->
<resources>
<resource>
<directory>TESTDATA-1</directory>
<targetPath>DIRECTORY-1</targetPath>
<includes>
<include>**</include>
</includes>
</resource>

<resource>
<directory>TESTDATA-2</directory>
<targetPath>DIRECTORY-2</targetPath>
<includes>
<include>**</include>
</includes>
</resource>
</resources>
</unitTest>

Such a block will map TESTDATA-1/** to target/test-classes/DIRECTORY-1
and TESTDATA-2/** to target/test-classes/DIRECTORY-2.

The plugin does assume that all test resources should be copied to
target/test-classes (or whatever directory ${testclasses} points to).
Such an assumption is incorrect.

The problem applies to a number of generated ant targets, for
example to compile, to compile-tests, to internal-test...

Activity

Hide
Arnaud Heritier added a comment -

build template is modified to use the targetPath if defined.

Show
Arnaud Heritier added a comment - build template is modified to use the targetPath if defined.
Hide
Arnaud Heritier added a comment -

need to add a test case

Show
Arnaud Heritier added a comment - need to add a test case
Hide
Arnaud Heritier added a comment -

test case added

Show
Arnaud Heritier added a comment - test case added

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: