From ed1501ecb5505895de0a62e39221d7175c003748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Mon, 20 May 2013 23:10:31 +0200 Subject: [PATCH] [MNG-5477] check warning issued when no version in reporting section --- .../validation/DefaultModelValidatorTest.java | 11 ++++ .../validation/missing-report-version-pom.xml | 57 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 maven-model-builder/src/test/resources/poms/validation/missing-report-version-pom.xml 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 + + + +