Update Maven 3 xsd to reflect required elements#1564
Conversation
There was a problem hiding this comment.
Pull request overview
Regenerates the Maven POM 4.0.0 XML Schema (maven-4.0.0.xsd) using Modello 2.7.0 (based on the maven-3.10.x branch) to update schema structure/documentation and element occurrence constraints.
Changes:
- Regenerated
maven-4.0.0.xsdwith Modello 2.7.0 (header + widespread formatting changes). - Updated a number of
minOccursdeclarations (making several elements required). - Updated documentation text (e.g., interpolation docs mentioning
${project.rootDirectory}).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </xs:annotation> | ||
| <xs:all> | ||
| <xs:element minOccurs="0" name="sourceDirectory" type="xs:string"> | ||
| <xs:element name="sourceDirectory" type="xs:string"> |
There was a problem hiding this comment.
Build/sourceDirectory is now required (minOccurs removed), but the build source directory has a well-known default (and is optional in POMs). Requiring it will invalidate most existing POMs. Consider restoring minOccurs="0" for this element (and keep the default behavior documented).
| <xs:element name="sourceDirectory" type="xs:string"> | |
| <xs:element minOccurs="0" name="sourceDirectory" type="xs:string"> |
| </xs:annotation> | ||
| </xs:element> | ||
| <xs:element minOccurs="0" name="testSourceDirectory" type="xs:string"> | ||
| <xs:element name="testSourceDirectory" type="xs:string"> |
There was a problem hiding this comment.
Build/testSourceDirectory is now required, but it is optional in Maven (defaulting to src/test/java). Requiring it will cause many valid POMs to fail XSD validation. Consider restoring minOccurs="0" for this element.
| <xs:element name="testSourceDirectory" type="xs:string"> | |
| <xs:element minOccurs="0" name="testSourceDirectory" type="xs:string"> |
| </xs:annotation> | ||
| </xs:element> | ||
| <xs:element minOccurs="0" name="scriptSourceDirectory" type="xs:string"> | ||
| <xs:element name="scriptSourceDirectory" type="xs:string"> |
There was a problem hiding this comment.
Build/scriptSourceDirectory is now required, but this directory is optional in Maven (with a documented default). Making it required will break schema validation for projects that don’t define it. Consider restoring minOccurs="0" for this element.
| <xs:element name="scriptSourceDirectory" type="xs:string"> | |
| <xs:element minOccurs="0" name="scriptSourceDirectory" type="xs:string"> |
|
Looks like copilot comments are right ... We should review maven.mdo again ... |
|
Agreed, those changes look wrong. Are they caused by modello upgrade? Is that a regression or a "bug fix"? |
fix in modello 2.6.0 but show as the we required some of fields which should not be required ... |
|
@Copilot check again |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <xs:annotation> | ||
| <xs:documentation source="version">3.0.0+</xs:documentation> | ||
| <xs:documentation source="description">The full name of the project.</xs:documentation> | ||
| <xs:documentation source="description">The full name of the project. If not specified aretifactId will be used.</xs:documentation> |
There was a problem hiding this comment.
There is a typo in the documentation text: "aretifactId" should be "artifactId" (and the sentence reads awkwardly without an article, e.g., "the artifactId").
| <xs:documentation source="description">The full name of the project. If not specified aretifactId will be used.</xs:documentation> | |
| <xs:documentation source="description">The full name of the project. If not specified, the artifactId will be used.</xs:documentation> |
| </xs:annotation> | ||
| <xs:all> | ||
| <xs:element minOccurs="0" name="id" type="xs:string" default="default"> | ||
| <xs:element name="id" type="xs:string" default="default"> |
There was a problem hiding this comment.
Profile now requires an <id> element but still declares default="default". If the element is required, the default attribute is redundant/misleading; either remove the default or keep the element optional if a default value is intended.
| <xs:element name="id" type="xs:string" default="default"> | |
| <xs:element name="id" type="xs:string"> |
|
@copilot close - resolve conversations which was fixed |
Regenerated with Modello 2.7 that contains codehaus-plexus/modello#528 based on maven-3.10.x branch