Index: src/test/java/org/apache/maven/plugin/deploy/stubs/DeployArtifactStub.java
===================================================================
--- src/test/java/org/apache/maven/plugin/deploy/stubs/DeployArtifactStub.java	(revision 565589)
+++ src/test/java/org/apache/maven/plugin/deploy/stubs/DeployArtifactStub.java	(working copy)
@@ -28,6 +28,7 @@
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.handler.DefaultArtifactHandler;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
+import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.plugin.testing.stubs.ArtifactStub;
 
 public class DeployArtifactStub
Index: src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java
===================================================================
--- src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java	(revision 565589)
+++ src/test/java/org/apache/maven/plugin/deploy/DeployMojoTest.java	(working copy)
@@ -25,15 +25,17 @@
 import java.util.List;
 import java.util.Properties;
 
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.repository.DefaultArtifactRepository;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
 import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.deploy.DeployMojo;
+import org.apache.maven.plugin.deploy.stubs.ArtifactDeployerStub;
 import org.apache.maven.plugin.deploy.stubs.ArtifactRepositoryStub;
 import org.apache.maven.plugin.deploy.stubs.AttachedArtifactStub;
 import org.apache.maven.plugin.deploy.stubs.DeployArtifactStub;
-import org.apache.maven.plugin.deploy.stubs.ArtifactDeployerStub;
 import org.apache.maven.plugin.testing.AbstractMojoTestCase;
 import org.apache.maven.plugin.testing.stubs.MavenProjectStub;
-import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.codehaus.plexus.util.FileUtils;
 
 /**
@@ -46,10 +48,14 @@
     
     private File localRepo;
     
+    private File alternateRepo;
+    
     private String LOCAL_REPO = getBasedir() + "/target/local-repo";
     
     private String REMOTE_REPO = getBasedir() + "/target/remote-repo";
     
+    private String ALTERNATE_REPO = getBasedir() + "/target/alternate-repo";
+    
     DeployArtifactStub artifact;
     
     MavenProjectStub project = new MavenProjectStub();
@@ -65,6 +71,9 @@
         
         localRepo = new File( LOCAL_REPO );
 
+        alternateRepo = new File (ALTERNATE_REPO );
+        
+        alternateRepo.mkdirs();
 
         if( localRepo.exists() )
         {
@@ -375,7 +384,114 @@
         assertEquals( 0, getSizeOfExpectedFiles( fileList, expectedFiles ) );               
     }
     
+    public void testDeployWithAttachedArtifactsWithArtifactSpecifiedRepository()
+    	throws Exception
+    {
+        File testPom = new File( getBasedir(),
+                "target/test-classes/unit/basic-deploy-with-attached-artifacts/" +
+                "plugin-config.xml" );
 
+		DeployMojo mojo = ( DeployMojo ) lookupMojo( "deploy", testPom );
+		
+		assertNotNull( mojo );
+		
+		artifact = ( DeployArtifactStub ) getVariableValueFromObject( mojo, "artifact" );
+		
+		File file = new File( getBasedir(),
+		             "target/test-classes/unit/basic-deploy-with-attached-artifacts/target/" +
+		             "deploy-test-file-1.0-SNAPSHOT.jar" );
+		
+		artifact.setFile( file );
+		
+		List attachedArtifacts = ( ArrayList ) getVariableValueFromObject( mojo, "attachedArtifacts" );
+		
+		assertEquals(1, attachedArtifacts.size());
+		Artifact attachedArtifactWithAlternateRepo = ( Artifact )attachedArtifacts.get(0);
+		
+		String alternateRepoPath = "file://" + ALTERNATE_REPO + "/basic-deploy-with-attached-artifacts-with-artifact-specified-repository";
+		ArtifactRepository alternateArtifactRepository = new DefaultArtifactRepository("alternate", alternateRepoPath, new DefaultRepositoryLayout() );
+		attachedArtifactWithAlternateRepo.setRepository(alternateArtifactRepository);
+		assertEquals(alternateArtifactRepository, attachedArtifactWithAlternateRepo.getRepository());
+		
+		ArtifactRepositoryStub repo = ( ArtifactRepositoryStub ) getVariableValueFromObject( mojo, "deploymentRepository" ); 
+		
+		repo.setAppendToUrl( "basic-deploy-with-attached-artifacts-with-artifact-specified-repository" );
+		
+		mojo.execute();
+		
+        String packaging = getVariableValueFromObject( mojo, "packaging" ).toString();
+
+        File deployedArtifact = new File( alternateRepo, "basic-deploy-with-attached-artifacts-with-artifact-specified-repository" + "/" +
+        		attachedArtifactWithAlternateRepo.getGroupId().replace( '.', '/' ) + "/" + 
+        		attachedArtifactWithAlternateRepo.getArtifactId() + "/" +
+        		attachedArtifactWithAlternateRepo.getVersion() + "/" + attachedArtifactWithAlternateRepo.getArtifactId() + "-" +
+        		attachedArtifactWithAlternateRepo.getVersion() + "." + packaging );
+        assertTrue( deployedArtifact.exists() );
+        
+        //check the artifacts in remote repository
+        List expectedFiles = new ArrayList();
+        List fileList = new ArrayList();
+        
+        expectedFiles.add( "org" );
+        expectedFiles.add( "apache" );
+        expectedFiles.add( "maven" );
+        expectedFiles.add( "test" );
+        expectedFiles.add( "maven-deploy-test" );
+        expectedFiles.add( "1.0-SNAPSHOT" );
+        expectedFiles.add( "maven-metadata.xml" );
+        expectedFiles.add( "maven-metadata.xml.md5" );
+        expectedFiles.add( "maven-metadata.xml.sha1" );
+        expectedFiles.add( "maven-deploy-test-1.0-SNAPSHOT.jar" );
+        expectedFiles.add( "maven-deploy-test-1.0-SNAPSHOT.jar.md5" );
+        expectedFiles.add( "maven-deploy-test-1.0-SNAPSHOT.jar.sha1" );
+        expectedFiles.add( "maven-deploy-test-1.0-SNAPSHOT.pom" );
+        expectedFiles.add( "maven-deploy-test-1.0-SNAPSHOT.pom.md5" );
+        expectedFiles.add( "maven-deploy-test-1.0-SNAPSHOT.pom.sha1" );
+        
+        remoteRepo = new File( remoteRepo, "basic-deploy-with-attached-artifacts-with-artifact-specified-repository" );
+        
+        File[] files = remoteRepo.listFiles();
+        
+        for( int i=0; i<files.length; i++ )
+        {
+            addFileToList( files[i], fileList );
+        }
+        
+        assertEquals( expectedFiles.size(), fileList.size() );
+
+        assertEquals( 0, getSizeOfExpectedFiles( fileList, expectedFiles ) );
+        
+        //check for artifacts in the alternate repository
+        expectedFiles.clear();
+        fileList.clear();
+        
+        expectedFiles.add( "1.0-SNAPSHOT" );
+        expectedFiles.add( "attached-artifact-test-0" );
+        expectedFiles.add( "attached-artifact-test-0-1.0-SNAPSHOT.jar" );
+        expectedFiles.add( "attached-artifact-test-0-1.0-SNAPSHOT.jar.md5" );
+        expectedFiles.add( "attached-artifact-test-0-1.0-SNAPSHOT.jar.sha1" ); 
+        expectedFiles.add( "maven-metadata.xml" );
+        expectedFiles.add( "maven-metadata.xml.md5" );
+        expectedFiles.add( "maven-metadata.xml.sha1" );
+        expectedFiles.add( "org" );
+        expectedFiles.add( "apache" );
+        expectedFiles.add( "maven" );
+        expectedFiles.add( "test" );
+        
+        alternateRepo = new File( alternateRepo, "basic-deploy-with-attached-artifacts-with-artifact-specified-repository");
+        
+        files = alternateRepo.listFiles();
+        
+        for( int i=0; i<files.length; i++ )
+        {
+            addFileToList( files[i], fileList );
+        }
+        
+        assertEquals( expectedFiles.size(), fileList.size() );
+        assertEquals( 0, getSizeOfExpectedFiles( fileList, expectedFiles ) );
+    }
+    
+
     public void testBasicDeployWithScpAsProtocol()
         throws Exception
     {
@@ -437,7 +553,6 @@
         
         FileUtils.deleteDirectory( sshFile );
     }
-
     
     private void addFileToList( File file, List fileList )
     {
Index: src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java
===================================================================
--- src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java	(revision 565589)
+++ src/main/java/org/apache/maven/plugin/deploy/DeployMojo.java	(working copy)
@@ -19,6 +19,7 @@
  * under the License.
  */
 
+import org.apache.maven.model.DistributionManagement;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
 import org.apache.maven.artifact.metadata.ArtifactMetadata;
@@ -163,8 +164,13 @@
             for ( Iterator i = attachedArtifacts.iterator(); i.hasNext(); )
             {
                 Artifact attached = ( Artifact ) i.next();
-
-                getDeployer().deploy( attached.getFile(), attached, repo, getLocalRepository() );
+                
+                ArtifactRepository repositoryForDeployment = attached.getRepository();
+                if (repositoryForDeployment == null) {
+                	repositoryForDeployment = repo;
+                }
+                
+                getDeployer().deploy( attached.getFile(), attached, repositoryForDeployment, getLocalRepository() );
             }
         }
         catch ( ArtifactDeploymentException e )
Index: pom.xml
===================================================================
--- pom.xml	(revision 565589)
+++ pom.xml	(working copy)
@@ -21,33 +21,33 @@
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-plugin-api</artifactId>
-      <version>2.0</version>
+      <version>2.0.8-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-core</artifactId>
-      <version>2.0</version>
+      <version>2.0.8-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
-      <version>2.0</version>
+      <version>2.0.8-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact-manager</artifactId>
-      <version>2.0</version>
+      <version>2.0.8-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-artifact</artifactId>
-      <version>2.0</version>
+      <version>2.0.8-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
       <artifactId>maven-plugin-testing-harness</artifactId>
       <scope>test</scope>
-      <version>1.0-beta-1</version>
+      <version>1.2-SNAPSHOT</version>
     </dependency>
   </dependencies>
 </project>
