diff --git a/maven-core/src/main/java/org/apache/maven/project/InvalidProjectModelException.java b/maven-core/src/main/java/org/apache/maven/project/InvalidProjectModelException.java index 3c3c2be12f..da7d622712 100644 --- a/maven-core/src/main/java/org/apache/maven/project/InvalidProjectModelException.java +++ b/maven-core/src/main/java/org/apache/maven/project/InvalidProjectModelException.java @@ -22,9 +22,10 @@ package org.apache.maven.project; import java.io.File; import org.apache.maven.artifact.InvalidRepositoryException; -import org.apache.maven.model.validation.ModelValidationResult; +import org.apache.maven.project.validation.ModelValidationResult; import org.codehaus.plexus.util.xml.pull.XmlPullParserException; +@Deprecated public class InvalidProjectModelException extends ProjectBuildingException { 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 ebf08b2e67..b64d587488 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 @@ -25,7 +25,8 @@ import java.util.Arrays; import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.DefaultArtifactRepository; import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout; -import org.apache.maven.model.validation.ModelValidationResult; +import org.apache.maven.model.building.ModelBuildingException; +import org.apache.maven.model.building.ModelProblem; import org.apache.maven.repository.RepositorySystem; import org.codehaus.plexus.PlexusTestCase; @@ -135,17 +136,13 @@ public abstract class AbstractMavenProjectTestCase } catch ( Exception e ) { - if ( e instanceof InvalidProjectModelException ) + Throwable cause = e.getCause(); + if ( cause instanceof ModelBuildingException ) { - ModelValidationResult validationResult = ( (InvalidProjectModelException) e ).getValidationResult(); - String message = "In: " + pom + "(" + ( (ProjectBuildingException) e ).getProjectId() + ")\n\n"; - for ( String error : validationResult.getErrors() ) + String message = "In: " + pom + "\n\n"; + for ( ModelProblem problem : ( (ModelBuildingException) cause ).getProblems() ) { - message += " [ERROR] " + error + "\n"; - } - for ( String warning : validationResult.getWarnings() ) - { - message += " [WARNING] " + warning + "\n"; + message += problem + "\n"; } System.out.println( message ); fail( message );