continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r209648 - in /maven/continuum/trunk/continuum-core/src/main: java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java resources/META-INF/plexus/components.xml
Date Thu, 07 Jul 2005 21:14:59 GMT
Author: trygvis
Date: Thu Jul  7 14:14:57 2005
New Revision: 209648

URL: http://svn.apache.org/viewcvs?rev=209648&view=rev
Log:
o Making it possible to configure what local repository the internal Maven 2
  components will use to read parent and dependency POMs from. Still fall backs
  to ${plexus.home} if it's not set and/or there was a error building the
  settings.

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
    maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?rev=209648&r1=209647&r2=209648&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
Thu Jul  7 14:14:57 2005
@@ -17,6 +17,7 @@
  */
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -35,9 +36,12 @@
 import org.apache.maven.model.Scm;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.settings.MavenSettingsBuilder;
+import org.apache.maven.settings.Settings;
 
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
@@ -58,6 +62,9 @@
     /** @plexus.requirement */
     private ArtifactRepositoryLayout repositoryLayout;
 
+    /** @plexus.requirement */
+    private MavenSettingsBuilder mavenSettingsBuilder;
+
     /** @plexus.configuration */
     private String localRepository;
 
@@ -83,6 +90,8 @@
         if ( StringUtils.isEmpty( continuumProject.getCommandLineArguments() ) )
         {
             continuumProject.setCommandLineArguments( "-N -B" );
+
+//            continuumProject.setCommandLineArguments( "-N -B -Djline.terminal=jline.UnsupportedTerminal"
);
         }
 
         if ( StringUtils.isEmpty( continuumProject.getGoals() ) )
@@ -238,7 +247,7 @@
                 throw new MavenBuilderHelperException( "Missing type from notifier." );
             }
 
-            notifier.setType( projectNotifier.getType() );            
+            notifier.setType( projectNotifier.getType() );
 
             notifier.setConfiguration( projectNotifier.getConfiguration() );
 
@@ -259,6 +268,23 @@
 
     private ArtifactRepository getRepository()
     {
+        String localRepository = this.localRepository;
+
+        try
+        {
+            Settings settings = mavenSettingsBuilder.buildSettings();
+
+            localRepository = settings.getLocalRepository();
+        }
+        catch ( IOException e )
+        {
+            getLogger().warn( "Error while building Maven settings.", e );
+        }
+        catch ( XmlPullParserException e )
+        {
+            getLogger().warn( "Error while building Maven settings.", e );
+        }
+
         Repository repository = new Repository();
 
         return artifactRepositoryFactory.createArtifactRepository( "local",

Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=209648&r1=209647&r2=209648&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
Thu Jul  7 14:14:57 2005
@@ -215,6 +215,9 @@
           <role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>
           <role-hint>default</role-hint>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.settings.MavenSettingsBuilder</role>
+        </requirement>
       </requirements>
       <configuration>
         <local-repository>${plexus.home}/local-repository</local-repository>



Mime
View raw message