diff --git a/api/maven-api-model/src/main/mdo/maven.mdo b/api/maven-api-model/src/main/mdo/maven.mdo index 83dc5aff1daf..69431f1d92e5 100644 --- a/api/maven-api-model/src/main/mdo/maven.mdo +++ b/api/maven-api-model/src/main/mdo/maven.mdo @@ -119,7 +119,6 @@ groupId 3.0.0+ - true A universally unique identifier for a project. It is normal to use a fully-qualified package name to distinguish it from other @@ -140,7 +139,6 @@ version 4.0.0+ - true The current version of the artifact produced by this project. String @@ -167,7 +165,6 @@ name 3.0.0+ - true The full name of the project. String @@ -233,7 +230,6 @@ inceptionYear 3.0.0+ - true The year of the project's inception, specified with 4 digits. This value is used when generating copyright notices as well as being informational. String @@ -355,7 +351,6 @@ build 3.0.0+ - true Information required to build the project. Build @@ -887,7 +882,6 @@ sourceDirectory 3.0.0+ - true This element specifies a directory containing the source of the project. The generated build system will compile the sources from this directory when the project is @@ -904,7 +898,6 @@ scriptSourceDirectory 4.0.0+ - true This element specifies a directory containing the script sources of the project. This directory is meant to be different from the sourceDirectory, in that its @@ -922,7 +915,6 @@ testSourceDirectory 4.0.0+ - true This element specifies a directory containing the unit test source of the project. The generated build system will compile these directories when the project is @@ -2931,7 +2923,6 @@ id - true 4.0.0+ String default @@ -2951,7 +2942,6 @@ build 4.0.0+ - true Information required to build the project. BuildBase @@ -3290,7 +3280,6 @@ groupId 4.0.0+ String - true org.apache.maven.plugins The group ID of the reporting plugin in the repository. @@ -3384,7 +3373,6 @@ id String - true The unique id for this report set, to be used during POM inheritance and profile injection for merging of report sets. @@ -3393,7 +3381,6 @@ reports 4.0.0+ - true The list of reports from this plugin which should be generated from this set. String diff --git a/compat/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java b/compat/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java index 4d6c3faf1b73..cfa3b44a7044 100644 --- a/compat/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java +++ b/compat/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java @@ -958,4 +958,16 @@ void testConcurrentValidation() throws Exception { "Concurrent validation failed: " + failure.get().getMessage(), failure.get()); } } + + @Test + void testMinimalWithParent() throws Exception { + SimpleProblemCollector result = validateRaw("raw-model/minimal-with-parent.xml"); + assertViolations(result, 0, 0, 0); + } + + @Test + void testMinimalWithoutParent() throws Exception { + SimpleProblemCollector result = validateRaw("raw-model/minimal-without-parent.xml"); + assertViolations(result, 0, 0, 0); + } } diff --git a/compat/maven-model-builder/src/test/resources/poms/validation/raw-model/minimal-with-parent.xml b/compat/maven-model-builder/src/test/resources/poms/validation/raw-model/minimal-with-parent.xml new file mode 100644 index 000000000000..b373d50722d9 --- /dev/null +++ b/compat/maven-model-builder/src/test/resources/poms/validation/raw-model/minimal-with-parent.xml @@ -0,0 +1,33 @@ + + + + 4.0.0 + + + org.apache.maven.validation + parent + 1 + + + project + + diff --git a/compat/maven-model-builder/src/test/resources/poms/validation/raw-model/minimal-without-parent.xml b/compat/maven-model-builder/src/test/resources/poms/validation/raw-model/minimal-without-parent.xml new file mode 100644 index 000000000000..274a34d2a087 --- /dev/null +++ b/compat/maven-model-builder/src/test/resources/poms/validation/raw-model/minimal-without-parent.xml @@ -0,0 +1,29 @@ + + + + 4.0.0 + + groupId + project + project + + diff --git a/impl/maven-core/src/main/java/org/apache/maven/project/MavenProject.java b/impl/maven-core/src/main/java/org/apache/maven/project/MavenProject.java index e6c2c05acbf0..e0f7d1c6e65c 100644 --- a/impl/maven-core/src/main/java/org/apache/maven/project/MavenProject.java +++ b/impl/maven-core/src/main/java/org/apache/maven/project/MavenProject.java @@ -632,7 +632,6 @@ public void setName(String name) { } public String getName() { - // TODO this should not be allowed to be null. if (getModel().getName() != null) { return getModel().getName(); } else {