Copilot commented on code in PR #1564:
URL: https://github.com/apache/maven-site/pull/1564#discussion_r3124350288
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -318,7 +318,7 @@
</xs:sequence>
</xs:complexType>
</xs:element>
- <xs:element minOccurs="0" name="build" type="Build">
+ <xs:element name="build" type="Build">
Review Comment:
`build` is now required under the root `Model` (`<xs:element name="build"
type="Build">`). In Maven POMs, `<build>` is optional; making it required will
fail validation for many projects. Consider restoring `minOccurs="0"` for this
element.
```suggestion
<xs:element minOccurs="0" name="build" type="Build">
```
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -1638,7 +1638,7 @@
profile.</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="0" name="build" type="BuildBase">
+ <xs:element name="build" type="BuildBase">
Review Comment:
`Profile/build` is now required (`<xs:element name="build"
type="BuildBase">`). Maven profiles can contain only
properties/repositories/etc. without a `<build>` section, so this requirement
will reject valid profiles. Consider restoring `minOccurs="0"` for `build`
(consistent with the repo’s 4.1.0 XSDs).
```suggestion
<xs:element minOccurs="0" name="build" type="BuildBase">
```
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -1466,19 +1466,19 @@
<xs:annotation>
<xs:documentation source="version">4.0.0+</xs:documentation>
<xs:documentation source="description">
-
+
The <code>&lt;plugin&gt;</code> element in
<code>&lt;reporting&gt;&lt;plugins&gt;</code>
contains informations required for a report plugin.
-
+
</xs:documentation>
</xs:annotation>
<xs:all>
- <xs:element minOccurs="0" name="groupId" type="xs:string"
default="org.apache.maven.plugins">
+ <xs:element name="groupId" type="xs:string"
default="org.apache.maven.plugins">
Review Comment:
`ReportPlugin/groupId` is now required even though it has a default
(`org.apache.maven.plugins`). With `minOccurs` omitted, instances must include
`<groupId>`, which defeats the purpose of the default and diverges from the
existing 4.1.0 XSDs in this repo. Consider restoring `minOccurs="0"` so
`<groupId>` can be omitted and still default correctly.
```suggestion
<xs:element minOccurs="0" name="groupId" type="xs:string"
default="org.apache.maven.plugins">
```
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -2386,14 +2386,14 @@
<xs:annotation>
<xs:documentation source="version">3.0.0+</xs:documentation>
<xs:documentation source="description">
-
+
The <code>&lt;build&gt;</code> element contains
informations required to build the project.
Default values are defined in Super POM.
-
+
</xs:documentation>
</xs:annotation>
<xs:all>
- <xs:element minOccurs="0" name="sourceDirectory" type="xs:string">
+ <xs:element name="sourceDirectory" type="xs:string">
Review 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).
```suggestion
<xs:element minOccurs="0" name="sourceDirectory" type="xs:string">
```
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -124,15 +124,15 @@
<xs:annotation>
<xs:documentation source="version">3.0.0+</xs:documentation>
<xs:documentation source="description">
-
+
The URL to the project's homepage.
<br><b>Default value is</b>: parent value [+
path adjustment] + (artifactId or project.directory property), or just parent
value if
project's
<code>child.project.url.inherit.append.path="false"</code>
-
+
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="0" name="inceptionYear" type="xs:string">
+ <xs:element name="inceptionYear" type="xs:string">
Review Comment:
`inceptionYear` is now required in the root `Model`, but `<inceptionYear>`
is optional in Maven POMs. Requiring it will invalidate existing POMs that omit
it. Consider restoring `minOccurs="0"` here.
```suggestion
<xs:element minOccurs="0" name="inceptionYear" type="xs:string">
```
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -61,19 +61,19 @@
is given as a group ID, artifact ID and version.</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="0" name="groupId" type="xs:string">
+ <xs:element name="groupId" type="xs:string">
Review Comment:
`groupId` is now required in the root `Model` (`<xs:element
name="groupId"...>`). In Maven POMs this can be inherited from `<parent>`, so
requiring it will reject valid POMs. Consider restoring `minOccurs="0"` here
(as done in the repo’s 4.1.0 XSDs) since XSD 1.0 can’t express the conditional
requirement (required only when no parent is present).
```suggestion
<xs:element minOccurs="0" name="groupId" type="xs:string">
```
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -1557,15 +1557,15 @@
<xs:documentation source="description">Represents a set of reports and
configuration to be used to generate them.</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">
<xs:annotation>
<xs:documentation source="version">0.0.0+</xs:documentation>
<xs:documentation source="description">The unique id for this report
set, to be used during POM inheritance and profile injection
for merging of report sets.
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="0" name="reports">
+ <xs:element name="reports">
<xs:annotation>
Review Comment:
`ReportSet/id` and `ReportSet/reports` are now required (`minOccurs`
removed), but `id` has a default and `reports` is often omitted (or empty) in
existing schemas (e.g., maven-4.1.0-*.xsd in this repo uses `minOccurs="0"` for
both). Requiring them will force extra boilerplate and may break validation of
existing POMs. Consider restoring `minOccurs="0"` for these elements.
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -92,19 +92,19 @@
<xs:annotation>
<xs:documentation source="version">4.0.0+</xs:documentation>
<xs:documentation source="description">
-
+
The type of artifact this project produces, for example
<code>jar</code>
<code>war</code>
<code>ear</code>
<code>pom</code>.
Plugins can create their own packaging, and
therefore their own packaging types,
so this list does not contain all possible types.
-
+
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="0" name="name" type="xs:string">
+ <xs:element name="name" type="xs:string">
Review Comment:
`name` is now required in the root `Model`, but `<name>` is optional in
Maven POMs. Requiring it will reject many valid POMs. Consider restoring
`minOccurs="0"` for this element.
```suggestion
<xs:element minOccurs="0" name="name" type="xs:string">
```
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -2416,7 +2416,7 @@
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="0" name="testSourceDirectory" type="xs:string">
+ <xs:element name="testSourceDirectory" type="xs:string">
Review 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.
```suggestion
<xs:element minOccurs="0" name="testSourceDirectory" type="xs:string">
```
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -82,7 +82,7 @@
distributions, and WARs.</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="0" name="version" type="xs:string">
+ <xs:element name="version" type="xs:string">
Review Comment:
`version` is now required in the root `Model`. Like `groupId`, it may be
omitted when inherited from `<parent>`, so making it required will invalidate
otherwise-correct POMs. Consider restoring `minOccurs="0"` for `version`
(consistent with the existing maven-4.1.0-*.xsd files in this repo).
```suggestion
<xs:element minOccurs="0" name="version" type="xs:string">
```
##########
content/resources/xsd/maven-4.0.0.xsd:
##########
@@ -2404,7 +2404,7 @@
</xs:documentation>
</xs:annotation>
</xs:element>
- <xs:element minOccurs="0" name="scriptSourceDirectory" type="xs:string">
+ <xs:element name="scriptSourceDirectory" type="xs:string">
Review 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.
```suggestion
<xs:element minOccurs="0" name="scriptSourceDirectory"
type="xs:string">
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]