Maven 1

artifactId is used as groupId when the latest is not defined

Details

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

Description

artifactId is used as groupId when the latest is not defined (using extends at least), both in 1.0.2 and 1.1b2, which I believe it's a problem, maven should complain.
Which is really a problem is that if pom a extends pom b, and no groupId is defined in any of both, in 1.0.2 the artifactId of a is chosen as groupId, while in 1.1 artifactId of b is the chosen one.

Issue Links

Activity

Hide
Arnaud Heritier added a comment -

To be check

Show
Arnaud Heritier added a comment - To be check
Hide
Lukas Theussl added a comment -

Checked and verified. I don't think the first point should be fixed (for backwards compat), but we could give a warning message. For the second observation, I'd like to know what is the expected/defined behavior?

Show
Lukas Theussl added a comment - Checked and verified. I don't think the first point should be fixed (for backwards compat), but we could give a warning message. For the second observation, I'd like to know what is the expected/defined behavior?
Hide
Arnaud Heritier added a comment -

If groupId isn't defined, groupId=artifactId thus the behaviour described seems normal. The parent and the child projects will have a different groupId.
The solution could be to force users to define groupId/artifactId if id isn't defined. Otherwise we fail the build. Will it broke so many projects ? I don't think.

Show
Arnaud Heritier added a comment - If groupId isn't defined, groupId=artifactId thus the behaviour described seems normal. The parent and the child projects will have a different groupId. The solution could be to force users to define groupId/artifactId if id isn't defined. Otherwise we fail the build. Will it broke so many projects ? I don't think.
Hide
Lukas Theussl added a comment -

This is not what's happening in 11rc1: both parent and child projects have the same groupId (the parent's) if no groupId is defined in either of them. They were different in m1.0, so it's a problem. See attached test project.

Show
Lukas Theussl added a comment - This is not what's happening in 11rc1: both parent and child projects have the same groupId (the parent's) if no groupId is defined in either of them. They were different in m1.0, so it's a problem. See attached test project.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: