diff --git a/maven-project/src/main/java/org/apache/maven/project/DuplicateProjectException.java b/maven-project/src/main/java/org/apache/maven/project/DuplicateProjectException.java index 06da819852..501992ff52 100644 --- a/maven-project/src/main/java/org/apache/maven/project/DuplicateProjectException.java +++ b/maven-project/src/main/java/org/apache/maven/project/DuplicateProjectException.java @@ -36,6 +36,25 @@ public class DuplicateProjectException private final File conflictingProjectFile; + /** + * @deprecated use {@link #DuplicateProjectException(String, File, File, String)} + */ + public DuplicateProjectException( String message ) + { + this( null, null, null, message ); + } + + /** + * @deprecated use {@link #DuplicateProjectException(String, File, File, String)} + */ + public DuplicateProjectException( String message, Exception e ) + { + super( message, e ); + this.projectId = null; + this.existingProjectFile = null; + this.conflictingProjectFile = null; + } + public DuplicateProjectException( String projectId, File existingProjectFile, File conflictingProjectFile, diff --git a/maven-project/src/main/java/org/apache/maven/project/InvalidProjectModelException.java b/maven-project/src/main/java/org/apache/maven/project/InvalidProjectModelException.java index ddb14d3124..3826e4ee24 100644 --- a/maven-project/src/main/java/org/apache/maven/project/InvalidProjectModelException.java +++ b/maven-project/src/main/java/org/apache/maven/project/InvalidProjectModelException.java @@ -19,55 +19,117 @@ package org.apache.maven.project; * under the License. */ -import org.apache.maven.artifact.InvalidRepositoryException; -import org.apache.maven.project.interpolation.ModelInterpolationException; +import java.io.File; +import java.net.URI; + import org.apache.maven.project.validation.ModelValidationResult; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; public class InvalidProjectModelException extends ProjectBuildingException { private ModelValidationResult validationResult; + /** + * + * @param projectId + * @param message + * @param pomFile pom file + * @param cause + */ public InvalidProjectModelException( String projectId, - String pomLocation, String message, - ModelInterpolationException cause ) + File pomFile, + Throwable cause ) + { + super( projectId, message, pomFile, cause ); + } + + /** + * + * @param projectId + * @param message + * @param pomLocation pom location + * @param cause + */ + public InvalidProjectModelException( String projectId, + String message, + URI pomLocation, + Throwable cause ) { super( projectId, message, pomLocation, cause ); } + /** + * + * @param projectId + * @param message + * @param pomLocation pom location + */ + public InvalidProjectModelException( String projectId, + String message, + URI pomLocation ) + { + super( projectId, message, pomLocation ); + } + + /** + * @deprecated use {@link #InvalidProjectModelException(String, String, File, Throwable)} + * @param projectId + * @param pomLocation absolute path of the pom file + * @param message + * @param cause + */ public InvalidProjectModelException( String projectId, String pomLocation, String message, - InvalidRepositoryException cause ) + Throwable cause ) { - super( projectId, message, pomLocation, cause ); + super( projectId, message, new File( pomLocation ), cause ); } + /** + * @deprecated use {@link #InvalidProjectModelException(String, String, File, ModelValidationResult)} + * @param projectId + * @param pomLocation absolute path of the pom file + * @param message + * @param validationResult + */ public InvalidProjectModelException( String projectId, String pomLocation, String message, ModelValidationResult validationResult ) { - super( projectId, message, pomLocation ); + this( projectId, message, new File( pomLocation ), validationResult ); + } + + public InvalidProjectModelException( String projectId, + String message, + File pomFile, + ModelValidationResult validationResult ) + { + super( projectId, message, pomFile ); this.validationResult = validationResult; } public InvalidProjectModelException( String projectId, - String pomLocation, - String message ) + String message, + File pomLocation ) { super( projectId, message, pomLocation ); } + /** + * @deprecated use {@link #InvalidProjectModelException(String, String, File)} + * @param projectId + * @param pomLocation absolute path of the pom file + * @param message + */ public InvalidProjectModelException( String projectId, String pomLocation, - String message, - XmlPullParserException cause ) + String message ) { - super( projectId, message, pomLocation, cause ); + super( projectId, message, new File( pomLocation ) ); } public final ModelValidationResult getValidationResult()