continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r321486 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/scm/ continuum-model/src/main/mdo/ continuum-web/src/main/java/org/apache/maven/continuum/web/tool/ continuum-web/src/main/resources/forms/ continu...
Date Sat, 15 Oct 2005 20:44:45 GMT
Author: evenisse
Date: Sat Oct 15 13:44:42 2005
New Revision: 321486

URL: http://svn.apache.org/viewcvs?rev=321486&view=rev
Log:
[CONTINUUM-345] Ability to configure username/password external to scm url connection

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
    maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
    maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml
    maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java?rev=321486&r1=321485&r2=321486&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
Sat Oct 15 13:44:42 2005
@@ -27,6 +27,7 @@
 import org.apache.maven.scm.command.checkout.CheckOutScmResult;
 import org.apache.maven.scm.command.update.UpdateScmResult;
 import org.apache.maven.scm.manager.ScmManager;
+import org.apache.maven.scm.manager.NoSuchScmProviderException;
 import org.apache.maven.scm.repository.ScmRepository;
 import org.apache.maven.scm.repository.ScmRepositoryException;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
@@ -67,7 +68,7 @@
             getLogger().info( "Checking out project: '" + project.getName() + "', " + "id:
'" + project.getId() + "' " +
                 "to '" + workingDirectory + "'." );
 
-            ScmRepository repository = scmManager.makeScmRepository( project.getScmUrl()
);
+            ScmRepository repository = getScmRepositorty( project );
 
             ScmResult result;
 
@@ -164,7 +165,7 @@
                     workingDirectory.getAbsolutePath() + ")." );
             }
 
-            ScmRepository repository = scmManager.makeScmRepository( project.getScmUrl()
);
+            ScmRepository repository = getScmRepositorty( project );
 
             String tag = null;
 
@@ -208,6 +209,28 @@
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
+
+    private ScmRepository getScmRepositorty( Project project )
+        throws ScmRepositoryException, NoSuchScmProviderException
+    {
+        ScmRepository repository = scmManager.makeScmRepository( project.getScmUrl() );
+
+        if ( project.getScmUsername() != null )
+        {
+            repository.getProviderRepository().setUser( project.getScmUsername() );
+
+            if ( project.getScmPassword() != null )
+            {
+                repository.getProviderRepository().setPassword( project.getScmPassword()
);
+            }
+            else
+            {
+                repository.getProviderRepository().setPassword( "" );
+            }
+        }
+
+        return repository;
+    }
 
     private ScmResult convertScmResult( CheckOutScmResult scmResult )
     {

Modified: maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo?rev=321486&r1=321485&r2=321486&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo Sat Oct 15 13:44:42 2005
@@ -113,6 +113,16 @@
           <type>String</type>
         </field>
         <field>
+          <name>scmUsername</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+        <field>
+          <name>scmPassword</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+        </field>
+        <field>
           <name>version</name>
           <version>1.0.0+</version>
           <type>String</type>

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java?rev=321486&r1=321485&r2=321486&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/tool/FormicaTool.java
Sat Oct 15 13:44:42 2005
@@ -150,7 +150,10 @@
 
                 data = Ognl.getValue( element.getExpression(), item );
 
-                return data.toString();
+                if ( data != null )
+                {
+                    return data.toString();
+                }
             }
             catch ( OgnlException e )
             {

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml?rev=321486&r1=321485&r2=321486&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/continuumProject.xml Sat
Oct 15 13:44:42 2005
@@ -39,6 +39,20 @@
       <expression>scmUrl</expression>
     </element>
     <element>
+      <id>projectScmUsername</id>
+      <validators>
+      </validators>
+      <type>text</type>
+      <expression>scmUsername</expression>
+    </element>
+    <element>
+      <id>projectScmPassword</id>
+      <validators>
+      </validators>
+      <type>text</type>
+      <expression>scmPassword</expression>
+    </element>
+    <element>
       <id>project.type</id>
       <validators>
         <validator>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties?rev=321486&r1=321485&r2=321486&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/localization/Continuum.properties
Sat Oct 15 13:44:42 2005
@@ -42,6 +42,12 @@
 projectScmUrl.error = You must provide an scm url
 projectScmUrl.message = Enter the <a href="http://maven.apache.org/reference/plugins/scm/scmurl.html">Maven
SCM URL</a>
 
+projectScmUsername.label = Scm Username
+projectScmUsername.message = Enter the scm username
+
+projectScmPassword.label = Scm Password
+projectScmPassword.message = Enter the scm password
+
 project.version.label = Version
 project.version.error = You must provide a version
 project.version.message = Enter the version of the project



Mime
View raw message