[MNG-5477] check warning issued when no version in reporting section

This commit is contained in:
Hervé Boutemy 2013-05-20 23:10:31 +02:00
parent 15a13529b3
commit ed1501ecb5
2 changed files with 68 additions and 0 deletions

View File

@ -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." );
}
}

View File

@ -0,0 +1,57 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project>
<modelVersion>4.0.0</modelVersion>
<artifactId>foo</artifactId>
<groupId>foo</groupId>
<version>99.44</version>
<packaging>bleh</packaging>
<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-from-pluginManagement-plugin</artifactId>
<version>1.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-from-plugins-plugin</artifactId>
<version>1.0</version>
</plugin>
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<artifactId>maven-noversion-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-from-plugins-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-from-pluginManagement-plugin</artifactId>
</plugin>
</plugins>
</reporting>
</project>