Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Won't Fix
-
Affects Version/s: 1.0.2
-
Fix Version/s: None
-
Component/s: inheritance
-
Labels:None
Description
Resources and unit test include/exclude patterns in the build element are not inherited, which presents issues for subprojects that need to add to the existing parent project. Please change maven to allow these elements to be merged rather than replaced.
For example, a parent project.xml might include the following:
<build>
<unitTest>
<resources>
<resource>
<directory>src/test/resources</directory>
<targetPath>resources</targetPath>
<includes>
<include>*/.*</include>
</includes>
</resource>
<resource>
<directory>${basedir}/../resources</directory>
<includes>
<include>log4j-sample.properties</include>
<include>beanRefFactory.xml</include>
<include>aspectwerkz.xml</include>
</includes>
</resource>
<resource>
<directory>${basedir}/../resources/context</directory>
<targetPath>context</targetPath>
<includes>
<include>*/.*</include>
</includes>
</resource>
</resources>
</unitTest>
</build>
A subproject's project.xml might need to add an additional resources:
<build>
<unitTest>
<resources>
<resource>
<directory>../interface/target/test-classes</directory>
<targetPath></targetPath>
<includes>
<include>*/.class</include>
</includes>
</resource>
</resources>
</unitTest>
</build>
1.0.2 replaces the parent project's unitTest resources with that defined in the subproject. This improvement requests that they be merged, so the equivalent would be as follows:
<build>
<unitTest>
<resources>
<!-- resources from parent project -->
<resource>
<directory>src/test/resources</directory>
<targetPath>resources</targetPath>
<includes>
<include>*/.*</include>
</includes>
</resource>
<resource>
<directory>${basedir}/../resources</directory>
<includes>
<include>log4j-sample.properties</include>
<include>beanRefFactory.xml</include>
<include>aspectwerkz.xml</include>
</includes>
</resource>
<resource>
<directory>${basedir}/../resources/context</directory>
<targetPath>context</targetPath>
<includes>
<include>*/.*</include>
</includes>
</resource>
<!-- resource from subproject -->
<resource>
<directory>../interface/target/test-classes</directory>
<targetPath></targetPath>
<includes>
<include>*/.class</include>
</includes>
</resource>
</resources>
</unitTest>
</build>
A bit of preliminary discussion from the user's mailing list:
http://marc.theaimsgroup.com/?l=turbine-maven-user&m=110423829501521&w=2
http://marc.theaimsgroup.com/?l=turbine-maven-dev&m=110428720508765&w=2
based on http://marc.theaimsgroup.com/?l=turbine-maven-user&m=110423829501521&w=2
won't fix