Maven 1

maven test-plugin silently ignores test definitions in the POM when run under maven 1.1 beta 2

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1-beta-2
  • Fix Version/s: 1.1-beta-3
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

use the following unitTest definition in your POM:

<unitTest>
<includes>
<include>**/*Test.java</include>
</includes>
<includes>
<include>*/Test.java</include>
</includes>
<excludes>
<exclude>*/test/.java</exclude>
</excludes>
[...]
</unitTest>

When running under maven 1.0.2, all Test classes that start with Test or end with Test are executed.

When running under maven 1.1-beta2, only the classes starting with Test are executed. The second <includes> definition overrides the first. Under maven
1.0.2 the two definitions are added.

According to my understanding of the xsd, there should either be a maxOccurs to prevent this, an exception being thrown when encountering the second includes or the old maven 1.0.2 behaviour being restored.

This is a real world example. I ran into this when test driving the Jakarta Turbine 2.3.2 RC1 with maven 1.1

Activity

Hide
Brett Porter added a comment -

this should result in an exception on encountering the second includes element and the xsd should reflect this.

Show
Brett Porter added a comment - this should result in an exception on encountering the second includes element and the xsd should reflect this.
Hide
Lukas Theussl added a comment -

The pom:validate goal of pom-plugin-1.5 catches this.

Show
Lukas Theussl added a comment - The pom:validate goal of pom-plugin-1.5 catches this.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: