Author: carlos
Date: Mon Feb 18 19:53:25 2008
New Revision: 628981

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

Modified:
    
maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java

Modified: 
maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
URL: 
http://svn.apache.org/viewvc/maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java?rev=628981&r1=628980&r2=628981&view=diff
==============================================================================
--- 
maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
 (original)
+++ 
maven/artifact/trunk/src/main/java/org/apache/maven/artifact/resolver/AbstractArtifactResolutionException.java
 Mon Feb 18 19:53:25 2008
@@ -45,6 +45,8 @@
 
     private String classifier;
 
+    private Artifact artifact; 
+
     private List remoteRepositories;
 
     private final String originalMessage;
@@ -62,16 +64,7 @@
                                                    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,
@@ -106,8 +99,7 @@
                                                    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,
@@ -117,6 +109,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