You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2008/07/24 12:51:41 UTC
svn commit: r679351 -
/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java
Author: bentmann
Date: Thu Jul 24 03:51:40 2008
New Revision: 679351
URL: http://svn.apache.org/viewvc?rev=679351&view=rev
Log:
[MINVOKER-43] Sync repository identifier of custom IT repo with identifier of real local repository
Modified:
maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java
Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java?rev=679351&r1=679350&r2=679351&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java (original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java Thu Jul 24 03:51:40 2008
@@ -20,6 +20,7 @@
*/
import java.io.File;
+import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
@@ -121,7 +122,10 @@
}
/**
- * Creates the local repository for the integration tests.
+ * Creates the local repository for the integration tests. If the user specified a custom repository location, the
+ * custom repository will have the same identifier, layout and policies as the real local repository. That means
+ * apart from the location, the custom repository will be indistinguishable from the real repository such that its
+ * usage is transparent to the integration tests.
*
* @return The local repository for the integration tests, never <code>null</code>.
* @throws MojoExecutionException If the repository could not be created.
@@ -135,13 +139,14 @@
{
try
{
- if ( !localRepositoryPath.exists() )
+ if ( !localRepositoryPath.exists() && !localRepositoryPath.mkdirs() )
{
- localRepositoryPath.mkdirs();
+ throw new IOException( "Failed to create directory: " + localRepositoryPath );
}
testRepository =
- repositoryFactory.createArtifactRepository( "it-repo", localRepositoryPath.toURL().toString(),
+ repositoryFactory.createArtifactRepository( localRepository.getId(),
+ localRepositoryPath.toURL().toExternalForm(),
localRepository.getLayout(),
localRepository.getSnapshots(),
localRepository.getReleases() );