Maven 2 & 3

Support in multiproject environment modules with different named POMs

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0.9, 3.0-alpha-1
  • Component/s: POM
  • Labels:
    None
  • Complexity:
    Intermediate
  • Patch Submitted:
    Yes
  • Number of attachments :
    1

Description

Command line version of Maven 2 supports POMs with a different name using the -f option. Unfortunately such POMs cannot be used as modules, since the value of the module tag is defined as a directory to another pom.xml instead of a pathname to another POM. Only if the value is not already an existing file the value should be treated as directory with a present pom.xml file. Similar situation applies to the relativePath element of the parent tag.

This makes the generation of different artifacts from the same sources (with some modifications) much more easy. Currently you will have to put the POMs in separate directories and modify the sourec location into another module.

Issue Links

Activity

Hide
John Casey added a comment -

I thought this was already done, but we should verify. If not, it should be pretty easy to add it.

Show
John Casey added a comment - I thought this was already done, but we should verify. If not, it should be pretty easy to add it.
Hide
Brett Porter added a comment -

this will require a change to the POM (reusing the existing modules entry would be too confusing, IMO). Putting back to 2.1.

Show
Brett Porter added a comment - this will require a change to the POM (reusing the existing modules entry would be too confusing, IMO). Putting back to 2.1.
Hide
John Casey added a comment -

I was thinking I'd just allow a full specification of the relative pom-file path for modules, just like we allow the parent/relativePath to refer to a specific pom file location. It would actually improve the consistency of these path-based elements of the core POM (ie. not plugin configuration elements).

Show
John Casey added a comment - I was thinking I'd just allow a full specification of the relative pom-file path for modules, just like we allow the parent/relativePath to refer to a specific pom file location. It would actually improve the consistency of these path-based elements of the core POM (ie. not plugin configuration elements).
Hide
Brett Porter added a comment -

sure, but that means we need to support an entry as either a directory or a pom file - won't that be too inconsistent?

Show
Brett Porter added a comment - sure, but that means we need to support an entry as either a directory or a pom file - won't that be too inconsistent?
Hide
Joerg Schaible added a comment -

Why? If you specify a path only, "pom.xml" is simply the default. The relativePath element of the parent should behave in exactly the same way (docs seem to imply that you have to specify the pom.xml, the path alone will not do - despite the tag name).

Show
Joerg Schaible added a comment - Why? If you specify a path only, "pom.xml" is simply the default. The relativePath element of the parent should behave in exactly the same way (docs seem to imply that you have to specify the pom.xml, the path alone will not do - despite the tag name).
Hide
Brian Deacon added a comment -

Allows moduleFile to be treated as a file if it exists, rather than assuming pom.xml

Show
Brian Deacon added a comment - Allows moduleFile to be treated as a file if it exists, rather than assuming pom.xml
Hide
John Casey added a comment -

applied patch, added integration test to verify the fix.

Thanks.

Show
John Casey added a comment - applied patch, added integration test to verify the fix. Thanks.

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: