MNG-5734: Fail, rather than just warning, on empty '<module>' entries.

An incorrect non-blank module is currently treated as an error. Behave
the same way for a blank module, rather than simply warning about
the mistake.

Signed-off-by: Jason van Zyl <jason@tesla.io>
This commit is contained in:
Joseph Walton 2015-02-21 17:33:01 +11:00 committed by Jason van Zyl
parent fdcd34dd37
commit b8dcb08731
2 changed files with 3 additions and 3 deletions

View File

@ -312,7 +312,7 @@ public class DefaultModelValidator
String module = m.getModules().get( i );
if ( StringUtils.isBlank( module ) )
{
addViolation( problems, Severity.WARNING, Version.BASE, "modules.module[" + i + "]", null,
addViolation( problems, Severity.ERROR, Version.BASE, "modules.module[" + i + "]", null,
"has been specified without a path to the project directory.",
m.getLocation( "modules" ) );
}

View File

@ -430,9 +430,9 @@ public class DefaultModelValidatorTest
{
SimpleProblemCollector result = validate( "empty-module.xml" );
assertViolations( result, 0, 0, 1 );
assertViolations( result, 0, 1, 0 );
assertTrue( result.getWarnings().get( 0 ).contains( "'modules.module[0]' has been specified without a path" ) );
assertTrue( result.getErrors().get( 0 ).contains( "'modules.module[0]' has been specified without a path" ) );
}
public void testDuplicatePlugin()