mirror of https://github.com/apache/maven.git
o Deprecated unused exception type
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@800460 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f4fa9e3838
commit
8441ba3c76
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue