jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 1
  • MAVEN-1542

Merge build elements in extended POM

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor 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

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Brett Porter added a comment - 15/May/05 11:47 PM

based on http://marc.theaimsgroup.com/?l=turbine-maven-user&m=110423829501521&w=2
won't fix

Show
Brett Porter added a comment - 15/May/05 11:47 PM based on http://marc.theaimsgroup.com/?l=turbine-maven-user&m=110423829501521&w=2 won't fix
Hide
Permalink
Stefan Franke added a comment - 12/Jan/09 3:07 PM

Would be easy to fix, if you add an <id> to the resources.

This way you could

  • merge, if IDs are different
  • override, if IDs match
  • remove, if IDs match and rest of overriding element is empty
Show
Stefan Franke added a comment - 12/Jan/09 3:07 PM Would be easy to fix, if you add an <id> to the resources. This way you could
  • merge, if IDs are different
  • override, if IDs match
  • remove, if IDs match and rest of overriding element is empty

People

  • Assignee:
    Unassigned
    Reporter:
    Steven Caswell
Vote (0)
Watch (0)

Dates

  • Created:
    29/Dec/04 7:20 AM
    Updated:
    12/Jan/09 3:07 PM
    Resolved:
    15/May/05 11:47 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.