Maven 1.x POM Plugin

Id in POM is deprecated.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.5
  • Fix Version/s: 1.5.1
  • Component/s: None
  • Labels:
    None
  • Number of attachments :
    0

Description

The pom:validate goal uses a schema which is false. The id element is deprecated and replaced by groupId/artifactId.

Issue Links

Activity

Hide
Lukas Theussl added a comment -

Sorry but I am quite annoyed by this. Trygve mentioned on the user list that the id element was deprecated some 3 years ago, that's 2 years before I joined the Maven team. I haven't been aware that it was deprecated until this recent thread on the user list. Apparently the docs patch by Dennis at MAVEN-1410 has never been applied. When I released the last version of the pom plugin, I spent quite some time getting the validation routines to work and I compiled a table of required elements [1]. That was about half a year ago, nobody complained since, nor during vote.

The main problem is that I'm not sure if some plugins don't still expect/use the id element, I'd have to check. Also, as pointed out at MAVEN-1410, we can't just change the POM-3 xsd, as it might break some existing builds. The consensus at MAVEN-1410 seems to have been to just document the deprecation, but not to change anything. The pom plugin only validates against a given xsd, so if an element is required by the xsd then it can hardly be considered a bug if the plugin complains.

My personal preference would be to keep the id element required by the xsd, but to document that it's actually not used anymore by the maven core (it might still be used by some plugins). WDYT?

[1] http://maven.apache.org/maven-1.x/plugins/pom/validation.html#Required_elements

Show
Lukas Theussl added a comment - Sorry but I am quite annoyed by this. Trygve mentioned on the user list that the id element was deprecated some 3 years ago, that's 2 years before I joined the Maven team. I haven't been aware that it was deprecated until this recent thread on the user list. Apparently the docs patch by Dennis at MAVEN-1410 has never been applied. When I released the last version of the pom plugin, I spent quite some time getting the validation routines to work and I compiled a table of required elements [1]. That was about half a year ago, nobody complained since, nor during vote. The main problem is that I'm not sure if some plugins don't still expect/use the id element, I'd have to check. Also, as pointed out at MAVEN-1410, we can't just change the POM-3 xsd, as it might break some existing builds. The consensus at MAVEN-1410 seems to have been to just document the deprecation, but not to change anything. The pom plugin only validates against a given xsd, so if an element is required by the xsd then it can hardly be considered a bug if the plugin complains. My personal preference would be to keep the id element required by the xsd, but to document that it's actually not used anymore by the maven core (it might still be used by some plugins). WDYT? [1] http://maven.apache.org/maven-1.x/plugins/pom/validation.html#Required_elements
Hide
Arnaud Heritier added a comment -

I'm sorry, but it was my fault. I didn't noticed this problem.
I don't know why MAVEN-1410 was closed without to fix the schema.
For me we must change the schema and maven-model to avoid errors from users.
But for me the choice is id or groupId+artifactId.
If need the model and the xsd can become a version 3.1 instead of a 3.0.2
WDYT ?

Show
Arnaud Heritier added a comment - I'm sorry, but it was my fault. I didn't noticed this problem. I don't know why MAVEN-1410 was closed without to fix the schema. For me we must change the schema and maven-model to avoid errors from users. But for me the choice is id or groupId+artifactId. If need the model and the xsd can become a version 3.1 instead of a 3.0.2 WDYT ?
Hide
Dennis Lundberg added a comment -

I was a bit surprised by this myself, as I had had seen MAVEN-1410 being closed. I thought that the xsd had been changed according to the previous comments in that issue. I didn't realize that the pom-plugin needed to be changed as well.

Anyway, how about releasing a new version of the pom-plugin that is Maven 1.1 only. This has been done with other plugins already. That new version would then use a new xsd, call it 3.0.1 or 3.1 or whatever, in which the id element is not required and artifactId/groupId is.

Show
Dennis Lundberg added a comment - I was a bit surprised by this myself, as I had had seen MAVEN-1410 being closed. I thought that the xsd had been changed according to the previous comments in that issue. I didn't realize that the pom-plugin needed to be changed as well. Anyway, how about releasing a new version of the pom-plugin that is Maven 1.1 only. This has been done with other plugins already. That new version would then use a new xsd, call it 3.0.1 or 3.1 or whatever, in which the id element is not required and artifactId/groupId is.
Hide
Arnaud Heritier added a comment -

I reopened MAVEN-1410

Show
Arnaud Heritier added a comment - I reopened MAVEN-1410
Hide
Lukas Theussl added a comment -

I only fixed pom-strict-3.xsd, the id element is already not required in child poms (http://maven.apache.org/xsd/maven-v3_0_0.xsd). Please review.

Show
Lukas Theussl added a comment - I only fixed pom-strict-3.xsd, the id element is already not required in child poms (http://maven.apache.org/xsd/maven-v3_0_0.xsd). Please review.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: