mirror of https://github.com/apache/maven.git
PR: MNG-764
Submitted by: Edwin Punzalan validation error if aggregator containing modules is not of the right packaging git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@330003 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
76a0f452c2
commit
87dc3a9e16
|
@ -55,6 +55,12 @@ public class DefaultModelValidator
|
|||
|
||||
validateStringNotEmpty( "packaging", result, model.getPackaging() );
|
||||
|
||||
if ( !model.getModules().isEmpty() && !"pom".equals( model.getPackaging() ) )
|
||||
{
|
||||
result.addMessage( "Packaging '" + model.getPackaging() + "' is invalid. Aggregator projects " +
|
||||
"require 'pom' as packaging." );
|
||||
}
|
||||
|
||||
validateStringNotEmpty( "version", result, model.getVersion() );
|
||||
|
||||
for ( Iterator it = model.getDependencies().iterator(); it.hasNext(); )
|
||||
|
|
|
@ -97,6 +97,16 @@ public class DefaultModelValidatorTest
|
|||
assertEquals( "'version' is missing.", result.getMessage( 0 ) );
|
||||
}
|
||||
|
||||
public void testInvalidAggregatorPackaging()
|
||||
throws Exception
|
||||
{
|
||||
ModelValidationResult result = validate( "invalid-aggregator-packaging-pom.xml" );
|
||||
|
||||
assertEquals( 1, result.getMessageCount() );
|
||||
|
||||
assertTrue( result.getMessage( 0 ).indexOf( "Aggregator projects require 'pom' as packaging." ) > -1 );
|
||||
}
|
||||
|
||||
public void testMissingDependencyArtifactId()
|
||||
throws Exception
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue