Author: bentmann
Date: Tue Jul  6 09:34:43 2010
New Revision: 960855

URL: http://svn.apache.org/viewvc?rev=960855&view=rev
Log:
[MNG-4718] [regression] Missing Class in 3.0-beta-1: 
org.apache.maven.project.artifact.AttachedArtifact

Added:
    
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java
      - copied, changed from r939632, 
maven/maven-2/branches/maven-2.2.x/maven-project/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java
Modified:
    
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java

Modified: 
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java
URL: 
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java?rev=960855&r1=960854&r2=960855&view=diff
==============================================================================
--- 
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java
 (original)
+++ 
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/DefaultMavenProjectHelper.java
 Tue Jul  6 09:34:43 2010
@@ -20,23 +20,18 @@ package org.apache.maven.project;
  */
 
 import java.io.File;
-import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.DefaultArtifact;
-import org.apache.maven.artifact.InvalidArtifactRTException;
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.model.Resource;
-import org.apache.maven.repository.legacy.metadata.ArtifactMetadata;
+import org.apache.maven.project.artifact.AttachedArtifact;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
+...@suppresswarnings( "deprecation" )
 @Component( role = MavenProjectHelper.class )
 public class DefaultMavenProjectHelper
     extends AbstractLogEnabled
@@ -131,141 +126,4 @@ public class DefaultMavenProjectHelper
         project.addTestResource( resource );
     }
 
-    private static class AttachedArtifact
-        extends DefaultArtifact
-    {
-
-        private final Artifact parent;
-
-        public AttachedArtifact( Artifact parent, String type, String 
classifier, ArtifactHandler artifactHandler )
-        {
-            super( parent.getGroupId(), parent.getArtifactId(), 
parent.getVersionRange(), parent.getScope(), type,
-                   classifier, artifactHandler, parent.isOptional() );
-
-            setDependencyTrail( Collections.singletonList( parent.getId() ) );
-
-            this.parent = parent;
-
-            if ( getId().equals( parent.getId() ) )
-            {
-                throw new InvalidArtifactRTException( parent.getGroupId(), 
parent.getArtifactId(), parent.getVersion(),
-                                                      parent.getType(),
-                                                      "An attached artifact 
must have a different ID than "
-                                                          + "its corresponding 
main artifact." );
-            }
-        }
-
-        public AttachedArtifact( Artifact parent, String type, ArtifactHandler 
artifactHandler )
-        {
-            this( parent, type, null, artifactHandler );
-        }
-
-        public void setArtifactId( String artifactId )
-        {
-            // ignore this. We should ALWAYS use the information from the 
parent artifact.
-        }
-
-        public List getAvailableVersions()
-        {
-            return parent.getAvailableVersions();
-        }
-
-        public void setAvailableVersions( List availableVersions )
-        {
-            // ignore this. We should ALWAYS use the information from the 
parent artifact.
-        }
-
-        public String getBaseVersion()
-        {
-            return parent.getBaseVersion();
-        }
-
-        public void setBaseVersion( String baseVersion )
-        {
-            // ignore this. We should ALWAYS use the information from the 
parent artifact.
-        }
-
-        public String getDownloadUrl()
-        {
-            return parent.getDownloadUrl();
-        }
-
-        public void setDownloadUrl( String downloadUrl )
-        {
-            // ignore this. We should ALWAYS use the information from the 
parent artifact.
-        }
-
-        public void setGroupId( String groupId )
-        {
-            // ignore this. We should ALWAYS use the information from the 
parent artifact.
-        }
-
-        public ArtifactRepository getRepository()
-        {
-            return parent.getRepository();
-        }
-
-        public void setRepository( ArtifactRepository repository )
-        {
-            // ignore this. We should ALWAYS use the information from the 
parent artifact.
-        }
-
-        public String getScope()
-        {
-            return parent.getScope();
-        }
-
-        public void setScope( String scope )
-        {
-            // ignore this. We should ALWAYS use the information from the 
parent artifact.
-        }
-
-        public String getVersion()
-        {
-            return parent.getVersion();
-        }
-
-        public void setVersion( String version )
-        {
-            // ignore this. We should ALWAYS use the information from the 
parent artifact.
-        }
-
-        public VersionRange getVersionRange()
-        {
-            return parent.getVersionRange();
-        }
-
-        public void setVersionRange( VersionRange range )
-        {
-            // ignore this. We should ALWAYS use the information from the 
parent artifact.
-        }
-
-        public boolean isRelease()
-        {
-            return parent.isRelease();
-        }
-
-        public void setRelease( boolean release )
-        {
-            // ignore this. We should ALWAYS use the information from the 
parent artifact.
-        }
-
-        public boolean isSnapshot()
-        {
-            return parent.isSnapshot();
-        }
-
-        public void addMetadata( ArtifactMetadata metadata )
-        {
-            // ignore. The parent artifact will handle metadata.
-            // we must fail silently here to avoid problems with the artifact 
transformers.
-        }
-
-        public Collection getMetadataList()
-        {
-            return Collections.EMPTY_LIST;
-        }
-
-    }
-
 }

Copied: 
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java
 (from r939632, 
maven/maven-2/branches/maven-2.2.x/maven-project/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java)
URL: 
http://svn.apache.org/viewvc/maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java?p2=maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java&p1=maven/maven-2/branches/maven-2.2.x/maven-project/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java&r1=939632&r2=960855&rev=960855&view=diff
==============================================================================
--- 
maven/maven-2/branches/maven-2.2.x/maven-project/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java
 (original)
+++ 
maven/maven-3/trunk/maven-core/src/main/java/org/apache/maven/project/artifact/AttachedArtifact.java
 Tue Jul  6 09:34:43 2010
@@ -31,6 +31,12 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
+/**
+ *<strong>Warning:</strong> This is an internal utility class that is only 
public for technical reasons, it is not part
+ * of the public API. In particular, this class can be changed or deleted 
without prior notice. Use
+ * {...@link org.apache.maven.project.MavenProjectHelper#attachArtifact} 
instead.
+ */
+...@deprecated
 public class AttachedArtifact
     extends DefaultArtifact
 {
@@ -38,17 +44,19 @@ public class AttachedArtifact
     private final Artifact parent;
 
     public AttachedArtifact( Artifact parent, String type, String classifier, 
ArtifactHandler artifactHandler )
-    {        
+    {
         super( parent.getGroupId(), parent.getArtifactId(), 
parent.getVersionRange(), parent.getScope(), type,
                classifier, artifactHandler, parent.isOptional() );
-        
+
         setDependencyTrail( Collections.singletonList( parent.getId() ) );
-        
+
         this.parent = parent;
-        
+
         if ( getId().equals( parent.getId() ) )
         {
-            throw new InvalidArtifactRTException( parent.getGroupId(), 
parent.getArtifactId(), parent.getVersion(), parent.getType(), "An attached 
artifact must have a different ID than its corresponding main artifact." );
+            throw new InvalidArtifactRTException( parent.getGroupId(), 
parent.getArtifactId(), parent.getVersion(),
+                                                  parent.getType(), "An 
attached artifact must have a different ID"
+                                                      + " than its 
corresponding main artifact." );
         }
     }
 
@@ -56,102 +64,112 @@ public class AttachedArtifact
     {
         this( parent, type, null, artifactHandler );
     }
-    
+
     public void setArtifactId( String artifactId )
     {
-        throw new UnsupportedOperationException( "Cannot change the artifactId 
for an attached artifact.  It is derived from the main artifact." );
+        throw new UnsupportedOperationException( "Cannot change the artifactId 
for an attached artifact."
+            + " It is derived from the main artifact." );
     }
 
     public List getAvailableVersions()
     {
         return parent.getAvailableVersions();
     }
-    
+
     public void setAvailableVersions( List availableVersions )
     {
-        throw new UnsupportedOperationException( "Cannot change the version 
information for an attached artifact. It is derived from the main artifact." );
+        throw new UnsupportedOperationException( "Cannot change the version 
information for an attached artifact."
+            + " It is derived from the main artifact." );
     }
 
     public String getBaseVersion()
     {
         return parent.getBaseVersion();
     }
-    
+
     public void setBaseVersion( String baseVersion )
     {
-        throw new UnsupportedOperationException( "Cannot change the version 
information for an attached artifact. It is derived from the main artifact." );
+        throw new UnsupportedOperationException( "Cannot change the version 
information for an attached artifact."
+            + " It is derived from the main artifact." );
     }
 
     public String getDownloadUrl()
     {
         return parent.getDownloadUrl();
     }
-    
+
     public void setDownloadUrl( String downloadUrl )
     {
-        throw new UnsupportedOperationException( "Cannot change the download 
information for an attached artifact. It is derived from the main artifact." );
+        throw new UnsupportedOperationException( "Cannot change the download 
information for an attached artifact."
+            + " It is derived from the main artifact." );
     }
 
     public void setGroupId( String groupId )
     {
-        throw new UnsupportedOperationException( "Cannot change the groupId on 
attached artifacts. It is derived from the main artifact." );
+        throw new UnsupportedOperationException( "Cannot change the groupId 
for an attached artifact."
+            + " It is derived from the main artifact." );
     }
 
     public ArtifactRepository getRepository()
     {
         return parent.getRepository();
     }
-    
+
     public void setRepository( ArtifactRepository repository )
     {
-        throw new UnsupportedOperationException( "Cannot change the repository 
information for an attached artifact. It is derived from the main artifact." );
+        throw new UnsupportedOperationException( "Cannot change the repository 
information for an attached artifact."
+            + " It is derived from the main artifact." );
     }
 
     public String getScope()
     {
         return parent.getScope();
     }
-    
+
     public void setScope( String scope )
     {
-        throw new UnsupportedOperationException( "Cannot change the scoping 
information for an attached artifact. It is derived from the main artifact." );
+        throw new UnsupportedOperationException( "Cannot change the scoping 
information for an attached artifact."
+            + " It is derived from the main artifact." );
     }
 
     public String getVersion()
     {
         return parent.getVersion();
     }
-    
+
     public void setVersion( String version )
     {
-        throw new UnsupportedOperationException( "Cannot change the version 
information for an attached artifact. It is derived from the main artifact." );
+        throw new UnsupportedOperationException( "Cannot change the version 
information for an attached artifact."
+            + " It is derived from the main artifact." );
     }
 
     public VersionRange getVersionRange()
     {
         return parent.getVersionRange();
     }
-    
+
     public void setVersionRange( VersionRange range )
     {
-        throw new UnsupportedOperationException( "Cannot change the version 
information for an attached artifact. It is derived from the main artifact." );
+        throw new UnsupportedOperationException( "Cannot change the version 
information for an attached artifact."
+            + " It is derived from the main artifact." );
     }
 
     public boolean isRelease()
     {
         return parent.isRelease();
     }
-    
+
     public void setRelease( boolean release )
     {
-        throw new UnsupportedOperationException( "Cannot change the version 
information for an attached artifact. It is derived from the main artifact." );
+        throw new UnsupportedOperationException( "Cannot change the version 
information for an attached artifact."
+            + " It is derived from the main artifact." );
     }
 
     public boolean isSnapshot()
     {
         return parent.isSnapshot();
     }
-    
+
     public void addMetadata( ArtifactMetadata metadata )
     {
         // ignore. The parent artifact will handle metadata.


Reply via email to