diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java index dceae518e7..6fb5de70f4 100644 --- a/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java +++ b/maven-model-builder/src/test/java/org/apache/maven/model/validation/DefaultModelValidatorTest.java @@ -613,4 +613,15 @@ public class DefaultModelValidatorTest + "should not point at files within the project directory" ); } + public void testMissingReportPluginVersion() + throws Exception + { + SimpleProblemCollector result = validate( "missing-report-version-pom.xml" ); + + assertViolations( result, 0, 0, 3 ); + + assertContains( result.getWarnings().get( 0 ), "'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-noversion-plugin is missing." ); + assertContains( result.getWarnings().get( 1 ), "'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-from-plugins-plugin is missing." ); + assertContains( result.getWarnings().get( 2 ), "'reporting.plugins.plugin.version' for org.apache.maven.plugins:maven-from-pluginManagement-plugin is missing." ); + } } diff --git a/maven-model-builder/src/test/resources/poms/validation/missing-report-version-pom.xml b/maven-model-builder/src/test/resources/poms/validation/missing-report-version-pom.xml new file mode 100644 index 0000000000..46a560f6bc --- /dev/null +++ b/maven-model-builder/src/test/resources/poms/validation/missing-report-version-pom.xml @@ -0,0 +1,57 @@ + + + + 4.0.0 + foo + foo + 99.44 + bleh + + + + + + maven-from-pluginManagement-plugin + 1.0 + + + + + + maven-from-plugins-plugin + 1.0 + + + + + + + + maven-noversion-plugin + + + maven-from-plugins-plugin + + + maven-from-pluginManagement-plugin + + + +