Author: carlos
Date: Mon Feb 18 20:03:38 2008
New Revision: 628983

URL: http://svn.apache.org/viewvc?rev=628983&view=rev
Log:
Store the artifact in the exception if available. Merge 628981 from trunk

Modified:
    
maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java

Modified: 
maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
URL: 
http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java?rev=628983&r1=628982&r2=628983&view=diff
==============================================================================
--- 
maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
 (original)
+++ 
maven/components/branches/maven-2.0.x/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
 Mon Feb 18 20:03:38 2008
@@ -45,6 +45,8 @@
 
     private String classifier;
 
+    private Artifact artifact; 
+
     private List remoteRepositories;
 
     private final String originalMessage;
@@ -56,16 +58,7 @@
     protected AbstractArtifactResolutionException( String message, String 
groupId, String artifactId, String version,
                                                    String type, String 
classifier, List remoteRepositories, List path )
     {
-        super( constructMessageBase( message, groupId, artifactId, version, 
type, remoteRepositories, path ) );
-
-        this.originalMessage = message;
-        this.groupId = groupId;
-        this.artifactId = artifactId;
-        this.type = type;
-        this.classifier = classifier;
-        this.version = version;
-        this.remoteRepositories = remoteRepositories;
-        this.path = constructArtifactPath( path, "" );
+        this( message, groupId, artifactId, version, type, classifier, 
remoteRepositories, path, null );
     }
 
     protected AbstractArtifactResolutionException( String message, String 
groupId, String artifactId, String version,
@@ -90,8 +83,7 @@
 
     protected AbstractArtifactResolutionException( String message, Artifact 
artifact, List remoteRepositories )
     {
-        this( message, artifact.getGroupId(), artifact.getArtifactId(), 
artifact.getVersion(), artifact.getType(),
-              artifact.getClassifier(),remoteRepositories, 
artifact.getDependencyTrail() );
+        this( message, artifact, remoteRepositories, null );
     }
 
     protected AbstractArtifactResolutionException( String message, Artifact 
artifact, List remoteRepositories,
@@ -99,6 +91,12 @@
     {
         this( message, artifact.getGroupId(), artifact.getArtifactId(), 
artifact.getVersion(), artifact.getType(),
               artifact.getClassifier(),remoteRepositories, 
artifact.getDependencyTrail(), t );
+        this.artifact = artifact;
+    }
+
+    public Artifact getArtifact()
+    {
+        return artifact;
     }
 
     public String getGroupId()


Reply via email to