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 2009/11/16 17:21:48 UTC
svn commit: r880828 -
/maven/plugin-testing/branches/plugin-testing-mvn-3.x/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/RepositoryTool.java
Author: bentmann
Date: Mon Nov 16 16:21:48 2009
New Revision: 880828
URL: http://svn.apache.org/viewvc?rev=880828&view=rev
Log:
o Fixed discovery of local repo
Modified:
maven/plugin-testing/branches/plugin-testing-mvn-3.x/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/RepositoryTool.java
Modified: maven/plugin-testing/branches/plugin-testing-mvn-3.x/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/RepositoryTool.java
URL: http://svn.apache.org/viewvc/maven/plugin-testing/branches/plugin-testing-mvn-3.x/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/RepositoryTool.java?rev=880828&r1=880827&r2=880828&view=diff
==============================================================================
--- maven/plugin-testing/branches/plugin-testing-mvn-3.x/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/RepositoryTool.java (original)
+++ maven/plugin-testing/branches/plugin-testing-mvn-3.x/maven-plugin-testing-tools/src/main/java/org/apache/maven/shared/test/plugin/RepositoryTool.java Mon Nov 16 16:21:48 2009
@@ -47,6 +47,7 @@
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
import org.codehaus.plexus.util.IOUtil;
import org.codehaus.plexus.util.ReaderFactory;
+import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
/**
@@ -102,10 +103,19 @@
public File findLocalRepositoryDirectory()
throws TestToolsException
{
+ String localRepo = System.getProperty( "maven.local.repo" );
+ if ( StringUtils.isNotEmpty( localRepo ) )
+ {
+ return new File( localRepo );
+ }
+
Settings settings;
try
{
- settings = settingsBuilder.buildSettings( new DefaultMavenExecutionRequest() );
+ DefaultMavenExecutionRequest request = new DefaultMavenExecutionRequest();
+ request.setUserSettingsFile( new File( System.getProperty( "user.home" ), ".m2/settings.xml" ) );
+ request.setGlobalSettingsFile( new File( System.getProperty( "maven.home" ), "conf/settings.xml" ) );
+ settings = settingsBuilder.buildSettings( request );
}
catch ( IOException e )
{