Skip to content

Update Maven 3 xsd to reflect required elements#1564

Draft
slachiewicz wants to merge 3 commits into
masterfrom
regen-xsd
Draft

Update Maven 3 xsd to reflect required elements#1564
slachiewicz wants to merge 3 commits into
masterfrom
regen-xsd

Conversation

@slachiewicz
Copy link
Copy Markdown
Member

@slachiewicz slachiewicz commented Apr 18, 2026

Regenerated with Modello 2.7 that contains codehaus-plexus/modello#528 based on maven-3.10.x branch

@slachiewicz slachiewicz added the documentation Improvements or additions to documentation label Apr 18, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.xsd with Modello 2.7.0 (header + widespread formatting changes).
  • Updated a number of minOccurs declarations (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.

Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
</xs:annotation>
<xs:all>
<xs:element minOccurs="0" name="sourceDirectory" type="xs:string">
<xs:element name="sourceDirectory" type="xs:string">
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
<xs:element name="sourceDirectory" type="xs:string">
<xs:element minOccurs="0" name="sourceDirectory" type="xs:string">

Copilot uses AI. Check for mistakes.
Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="testSourceDirectory" type="xs:string">
<xs:element name="testSourceDirectory" type="xs:string">
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<xs:element name="testSourceDirectory" type="xs:string">
<xs:element minOccurs="0" name="testSourceDirectory" type="xs:string">

Copilot uses AI. Check for mistakes.
Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="scriptSourceDirectory" type="xs:string">
<xs:element name="scriptSourceDirectory" type="xs:string">
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<xs:element name="scriptSourceDirectory" type="xs:string">
<xs:element minOccurs="0" name="scriptSourceDirectory" type="xs:string">

Copilot uses AI. Check for mistakes.
Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
@slawekjaranowski slawekjaranowski requested a review from gnodet April 23, 2026 18:07
@slawekjaranowski
Copy link
Copy Markdown
Member

Looks like copilot comments are right ...

We should review maven.mdo again ...

@gnodet
Copy link
Copy Markdown
Contributor

gnodet commented Apr 23, 2026

Agreed, those changes look wrong. Are they caused by modello upgrade? Is that a regression or a "bug fix"?

@slawekjaranowski
Copy link
Copy Markdown
Member

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 ...

@slawekjaranowski
Copy link
Copy Markdown
Member

@slawekjaranowski slawekjaranowski marked this pull request as draft April 24, 2026 18:28
@slawekjaranowski
Copy link
Copy Markdown
Member

@slawekjaranowski
Copy link
Copy Markdown
Member

@Copilot check again

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
<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>
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a typo in the documentation text: "aretifactId" should be "artifactId" (and the sentence reads awkwardly without an article, e.g., "the artifactId").

Suggested change
<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>

Copilot uses AI. Check for mistakes.
Comment thread content/resources/xsd/maven-4.0.0.xsd Outdated
</xs:annotation>
<xs:all>
<xs:element minOccurs="0" name="id" type="xs:string" default="default">
<xs:element name="id" type="xs:string" default="default">
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<xs:element name="id" type="xs:string" default="default">
<xs:element name="id" type="xs:string">

Copilot uses AI. Check for mistakes.
@slawekjaranowski
Copy link
Copy Markdown
Member

@copilot close - resolve conversations which was fixed

@slachiewicz slachiewicz changed the title Update maven-4.0.0.xsd to reflect required elements. Update Maven 3 xsd to reflect required elements Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants