[MNG-6075] Increase the model validation level to the next minor level version.
diff --git a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
index 7db65d8..68f0219 100644
--- a/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
+++ b/maven-core/src/test/java/org/apache/maven/project/AbstractMavenProjectTestCase.java
@@ -28,6 +28,7 @@
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
import org.apache.maven.model.building.ModelBuildingException;
+import org.apache.maven.model.building.ModelBuildingRequest;
import org.apache.maven.model.building.ModelProblem;
import org.apache.maven.repository.RepositorySystem;
import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
@@ -196,6 +197,7 @@
{
ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest();
configuration.setLocalRepository( getLocalRepository() );
+ configuration.setValidationLevel( ModelBuildingRequest.VALIDATION_LEVEL_MINIMAL );
initRepoSession( configuration );
return configuration;
}
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 dde532d..3f44634 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
@@ -440,12 +440,12 @@
{
SimpleProblemCollector result = validateRaw( "duplicate-plugin.xml" );
- assertViolations( result, 0, 0, 4 );
+ assertViolations( result, 0, 4, 0 );
- assertTrue( result.getWarnings().get( 0 ).contains( "duplicate declaration of plugin test:duplicate" ) );
- assertTrue( result.getWarnings().get( 1 ).contains( "duplicate declaration of plugin test:managed-duplicate" ) );
- assertTrue( result.getWarnings().get( 2 ).contains( "duplicate declaration of plugin profile:duplicate" ) );
- assertTrue( result.getWarnings().get( 3 ).contains( "duplicate declaration of plugin profile:managed-duplicate" ) );
+ assertTrue( result.getErrors().get( 0 ).contains( "duplicate declaration of plugin test:duplicate" ) );
+ assertTrue( result.getErrors().get( 1 ).contains( "duplicate declaration of plugin test:managed-duplicate" ) );
+ assertTrue( result.getErrors().get( 2 ).contains( "duplicate declaration of plugin profile:duplicate" ) );
+ assertTrue( result.getErrors().get( 3 ).contains( "duplicate declaration of plugin profile:managed-duplicate" ) );
}
public void testDuplicatePluginExecution()
@@ -466,12 +466,12 @@
{
SimpleProblemCollector result = validate( "reserved-repository-id.xml" );
- assertViolations( result, 0, 0, 4 );
+ assertViolations( result, 0, 4, 0 );
- assertContains( result.getWarnings().get( 0 ), "'repositories.repository.id'" + " must not be 'local'" );
- assertContains( result.getWarnings().get( 1 ), "'pluginRepositories.pluginRepository.id' must not be 'local'" );
- assertContains( result.getWarnings().get( 2 ), "'distributionManagement.repository.id' must not be 'local'" );
- assertContains( result.getWarnings().get( 3 ),
+ assertContains( result.getErrors().get( 0 ), "'repositories.repository.id'" + " must not be 'local'" );
+ assertContains( result.getErrors().get( 1 ), "'pluginRepositories.pluginRepository.id' must not be 'local'" );
+ assertContains( result.getErrors().get( 2 ), "'distributionManagement.repository.id' must not be 'local'" );
+ assertContains( result.getErrors().get( 3 ),
"'distributionManagement.snapshotRepository.id' must not be 'local'" );
}
@@ -520,9 +520,9 @@
{
SimpleProblemCollector result = validate( "bad-version.xml" );
- assertViolations( result, 0, 0, 1 );
+ assertViolations( result, 0, 1, 0 );
- assertContains( result.getWarnings().get( 0 ), "'version' must not contain any of these characters" );
+ assertContains( result.getErrors().get( 0 ), "'version' must not contain any of these characters" );
}
public void testBadSnapshotVersion()
@@ -530,9 +530,9 @@
{
SimpleProblemCollector result = validate( "bad-snapshot-version.xml" );
- assertViolations( result, 0, 0, 1 );
+ assertViolations( result, 0, 1, 0 );
- assertContains( result.getWarnings().get( 0 ), "'version' uses an unsupported snapshot version format" );
+ assertContains( result.getErrors().get( 0 ), "'version' uses an unsupported snapshot version format" );
}
public void testBadRepositoryId()
@@ -540,15 +540,15 @@
{
SimpleProblemCollector result = validate( "bad-repository-id.xml" );
- assertViolations( result, 0, 0, 4 );
+ assertViolations( result, 0, 4, 0 );
- assertContains( result.getWarnings().get( 0 ),
+ assertContains( result.getErrors().get( 0 ),
"'repositories.repository.id' must not contain any of these characters" );
- assertContains( result.getWarnings().get( 1 ),
+ assertContains( result.getErrors().get( 1 ),
"'pluginRepositories.pluginRepository.id' must not contain any of these characters" );
- assertContains( result.getWarnings().get( 2 ),
+ assertContains( result.getErrors().get( 2 ),
"'distributionManagement.repository.id' must not contain any of these characters" );
- assertContains( result.getWarnings().get( 3 ),
+ assertContains( result.getErrors().get( 3 ),
"'distributionManagement.snapshotRepository.id' must not contain any of these characters" );
}