[maven-scm] copy for tag maven-plugin-testing-tools-1.0-alpha-2

git-svn-id: https://svn.apache.org/repos/asf/maven/shared/tags/maven-plugin-testing-tools-1.0-alpha-2@554119 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index b38e05d..449f403 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,7 +25,7 @@
     <version>7</version>

   </parent>

   <artifactId>maven-plugin-testing-tools</artifactId>

-  <version>1.0-alpha-2-SNAPSHOT</version>

+  <version>1.0-alpha-2</version>

   <name>Maven Plugin Testing Tools</name>

   <url>http://maven.apache.org</url>

   <dependencies>

@@ -62,12 +62,12 @@
     <dependency>

       <groupId>org.apache.maven.shared</groupId>

       <artifactId>maven-invoker</artifactId>

-      <version>2.0.7-SNAPSHOT</version>

+      <version>2.0.6</version>

     </dependency>

     <dependency>

       <groupId>org.apache.maven.shared</groupId>

       <artifactId>maven-test-tools</artifactId>

-      <version>1.0-alpha-2-SNAPSHOT</version>

+      <version>1.0-alpha-1</version>

       <scope>test</scope>

     </dependency>

     <dependency>

@@ -95,8 +95,8 @@
     </plugins>

   </build>

   <scm>

-    <connection>scm:svn:http://svn.apache.org/repos/asf/maven/shared/trunk/maven-plugin-testing-tools</connection>

-    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/shared/trunk/maven-plugin-testing-tools</developerConnection>

-    <url>http://svn.apache.org/viewcvs.cgi/maven/shared/trunk/maven-plugin-testing-tools</url>

+    <connection>scm:svn:https://svn.apache.org/repos/asf/maven/shared/tags/maven-plugin-testing-tools-1.0-alpha-2</connection>

+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/shared/tags/maven-plugin-testing-tools-1.0-alpha-2</developerConnection>

+    <url>https://svn.apache.org/repos/asf/maven/shared/tags/maven-plugin-testing-tools-1.0-alpha-2</url>

   </scm>

 </project>

diff --git a/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java b/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
index 3512743..09fe8c7 100644
--- a/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
+++ b/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
@@ -178,8 +178,8 @@
 
         buildTool.executeMaven( pomInfo.getPomFile(), properties, goals, buildLog );
 
-        File artifactFile = new File( pomInfo.getPomFile().getParentFile(), pomInfo.getBuildOutputDirectory() + "/" + pomInfo.getFinalName() );
-
+        File artifactFile = new File( pomInfo.getPomFile().getParentFile(), pomInfo.getBuildDirectory() + "/" + pomInfo.getFinalName() );
+        System.out.println("Using IT Plugin Jar: "+artifactFile.getAbsolutePath());
         try
         {
             MavenProject project = projectBuilder.build( pomInfo.getPomFile(), repositoryTool
@@ -227,7 +227,7 @@
 
         Model model = null;
         String finalName = null;
-        String buildOutputDirectory = null;
+        String buildDirectory = null;
         
         try
         {
@@ -256,8 +256,19 @@
             if ( build == null )
             {
                 build = new Build();
-                model.setBuild( build );
             }
+            buildDirectory = build.getDirectory();
+
+            if ( buildDirectory == null )
+            {
+                buildDirectory = "target";
+            }
+            
+            buildDirectory = ( buildDirectory+File.separatorChar+"it-build-target" );
+            build.setDirectory( buildDirectory );
+            build.setOutputDirectory( buildDirectory+File.separatorChar+"classes" );
+            System.out.println("Using "+build.getDirectory()+" and "+build.getOutputDirectory()+" to build IT version of plugin");
+            model.setBuild( build );
 
             finalName = build.getFinalName();
 
@@ -304,13 +315,6 @@
             
             model.addProperty( INTEGRATION_TEST_DEPLOYMENT_REPO_URL, tmpUrl );
 
-            buildOutputDirectory = build.getOutputDirectory();
-
-            if ( buildOutputDirectory == null )
-            {
-                buildOutputDirectory = "target";
-            }
-
             if ( skipUnitTests )
             {
                 List plugins = build.getPlugins();
@@ -360,7 +364,7 @@
         }
 
         return new PomInfo( output, model.getGroupId(), model.getArtifactId(), model.getVersion(),
-                            buildOutputDirectory, finalName );
+                            model.getBuild().getDirectory(), model.getBuild().getOutputDirectory(), finalName );
     }
 
     static final class PomInfo
@@ -375,15 +379,18 @@
 
         private final String finalName;
 
+        private final String buildDirectory;
+        
         private final String buildOutputDirectory;
 
-        PomInfo( File pomFile, String groupId, String artifactId, String version, String buildOutputDirectory,
-                 String finalName )
+        PomInfo( File pomFile, String groupId, String artifactId, String version, String buildDirectory, 
+                 String buildOutputDirectory, String finalName )
         {
             this.pomFile = pomFile;
             this.groupId = groupId;
             this.artifactId = artifactId;
             this.version = version;
+            this.buildDirectory = buildDirectory;
             this.buildOutputDirectory = buildOutputDirectory;
             this.finalName = finalName;
         }
@@ -393,11 +400,16 @@
             return pomFile;
         }
 
+        String getBuildDirectory()
+        {
+            return buildDirectory;
+        }
+
         String getBuildOutputDirectory()
         {
             return buildOutputDirectory;
         }
-
+        
         String getFinalName()
         {
             return finalName;
@@ -405,7 +417,7 @@
 
         File getBuildLogFile()
         {
-            return new File( buildOutputDirectory + "/test-build-logs/" + groupId + "_" + artifactId + "_" + version
+            return new File( buildDirectory + "/test-build-logs/" + groupId + "_" + artifactId + "_" + version
                 + ".build.log" );
         }
 
diff --git a/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java b/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
index ace0393..3144f00b 100644
--- a/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
+++ b/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
@@ -43,8 +43,9 @@
 
         PomInfo info = tool.manglePomForTesting( pomFile, "test", true );
 
-        assertEquals( "target", info.getBuildOutputDirectory() );
+        assertEquals( "target"+File.separatorChar+"it-build-target", info.getBuildDirectory() );
         assertEquals( "maven-plugin-testing-tools-test.jar", info.getFinalName() );
+        assertEquals( "target"+File.separatorChar+"it-build-target"+File.separatorChar+"classes",info.getBuildOutputDirectory() );
     }
 
     public void testPackageProjectArtifact_ShouldPopulateArtifactFileWithJarLocation()
@@ -56,10 +57,11 @@
 
         MavenProject project = tool.packageProjectArtifact( pomFile, "test", true );
 
-        String expectedPath = "target/maven-plugin-testing-tools-test.jar";
+        String expectedPath = "target/it-build-target/maven-plugin-testing-tools-test.jar";
+        
         // be nice with windows
         String actualPath = StringUtils.replace( project.getArtifact().getFile().getPath(), "\\", "/" );
-
+        
         assertEquals( expectedPath, actualPath );
     }