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:
Benjamin Bentmann 2009-08-03 16:43:10 +00:00
parent f4fa9e3838
commit 8441ba3c76
2 changed files with 9 additions and 11 deletions

View File

@ -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
{

View File

@ -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 );