You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by br...@apache.org on 2007/07/07 05:03:58 UTC
svn commit: r554117 - in /maven/shared/trunk/maven-plugin-testing-tools:
pom.xml src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
Author: brianf
Date: Fri Jul 6 20:03:57 2007
New Revision: 554117
URL: http://svn.apache.org/viewvc?view=rev&rev=554117
Log:
MNG-3095 - stopped IT build from corrupting real build artifacts
Modified:
maven/shared/trunk/maven-plugin-testing-tools/pom.xml
maven/shared/trunk/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
maven/shared/trunk/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
Modified: maven/shared/trunk/maven-plugin-testing-tools/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-plugin-testing-tools/pom.xml?view=diff&rev=554117&r1=554116&r2=554117
==============================================================================
--- maven/shared/trunk/maven-plugin-testing-tools/pom.xml (original)
+++ maven/shared/trunk/maven-plugin-testing-tools/pom.xml Fri Jul 6 20:03:57 2007
@@ -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>
Modified: maven/shared/trunk/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java?view=diff&rev=554117&r1=554116&r2=554117
==============================================================================
--- maven/shared/trunk/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java (original)
+++ maven/shared/trunk/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/ProjectTool.java Fri Jul 6 20:03:57 2007
@@ -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" );
}
Modified: maven/shared/trunk/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java?view=diff&rev=554117&r1=554116&r2=554117
==============================================================================
--- maven/shared/trunk/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java (original)
+++ maven/shared/trunk/maven-plugin-testing-tools/src/test/java/org/apache/maven/shared/test/plugin/ProjectToolTest.java Fri Jul 6 20:03:57 2007
@@ -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 );
}