maven-scm-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r374716 - in /maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn: ./ src/main/java/org/apache/maven/scm/provider/svn/command/ src/main/java/org/apache/maven/scm/provider/svn/util/ src/main/mdo/
Date Fri, 03 Feb 2006 18:01:09 GMT
Author: evenisse
Date: Fri Feb  3 10:01:01 2006
New Revision: 374716

URL: http://svn.apache.org/viewcvs?rev=374716&view=rev
Log:
[SCM-148] Allow to define --config-dir svn option

Added:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/SvnUtil.java
  (with props)
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/mdo/
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/mdo/svn-settings.mdo
Modified:
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml
    maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommandLineUtils.java

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml?rev=374716&r1=374715&r2=374716&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml (original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/pom.xml Fri Feb  3 10:01:01
2006
@@ -15,4 +15,26 @@
       <version>1.3</version>
     </dependency>
   </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.modello</groupId>
+        <artifactId>modello-maven-plugin</artifactId>
+        <version>1.0-alpha-6</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>java</goal>
+              <goal>xpp3-reader</goal>
+              <goal>xsd</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <version>1.0.0</version>
+          <model>src/main/mdo/svn-settings.mdo</model>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>

Modified: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommandLineUtils.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommandLineUtils.java?rev=374716&r1=374715&r2=374716&view=diff
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommandLineUtils.java
(original)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/command/SvnCommandLineUtils.java
Fri Feb  3 10:01:01 2006
@@ -18,6 +18,7 @@
 
 import org.apache.maven.scm.log.ScmLogger;
 import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
+import org.apache.maven.scm.provider.svn.util.SvnUtil;
 import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
@@ -49,6 +50,17 @@
         cl.setExecutable( "svn" );
 
         cl.setWorkingDirectory( workingDirectory.getAbsolutePath() );
+
+        if ( !StringUtils.isEmpty( System.getProperty( "maven.scm.svn.config_directory" )
) )
+        {
+            cl.createArgument().setValue( "--config-dir" );
+            cl.createArgument().setValue( System.getProperty( "maven.scm.svn.config_directory"
) );
+        }
+        else if ( !StringUtils.isEmpty( SvnUtil.getSettings().getConfigDirectory() ) )
+        {
+            cl.createArgument().setValue( "--config-dir" );
+            cl.createArgument().setValue( SvnUtil.getSettings().getConfigDirectory() );
+        }
 
         if ( !StringUtils.isEmpty( repository.getUser() ) )
         {

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/SvnUtil.java
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/SvnUtil.java?rev=374716&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/SvnUtil.java
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/SvnUtil.java
Fri Feb  3 10:01:01 2006
@@ -0,0 +1,66 @@
+package org.apache.maven.scm.provider.svn.util;
+
+/*
+ * Copyright 2001-2006 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.maven.scm.providers.svn.settings.Settings;
+import org.apache.maven.scm.providers.svn.settings.io.xpp3.SvnXpp3Reader;
+import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:evenisse@apache.org">Emmanuel Venisse</a>
+ * @version $Id$
+ */
+public class SvnUtil
+{
+    private SvnUtil()
+    {
+    }
+
+    public static Settings getSettings()
+    {
+        File scmUserDir = new File( System.getProperty( "user.dir" ), ".scm" );
+        File settingsFile = new File( scmUserDir, "svn-settings.xml" );
+
+        if ( settingsFile.exists() )
+        {
+            SvnXpp3Reader reader = new SvnXpp3Reader();
+            try
+            {
+                return reader.read( new FileReader( settingsFile ) );
+            }
+            catch ( FileNotFoundException e )
+            {
+            }
+            catch ( IOException e )
+            {
+            }
+            catch ( XmlPullParserException e )
+            {
+                String message = settingsFile.getAbsolutePath() + " isn't well formed. SKIPPED."
+ e.getMessage();
+
+                System.out.println( message );
+            }
+        }
+
+        return new Settings();
+    }
+}

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/SvnUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/java/org/apache/maven/scm/provider/svn/util/SvnUtil.java
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/mdo/svn-settings.mdo
URL: http://svn.apache.org/viewcvs/maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/mdo/svn-settings.mdo?rev=374716&view=auto
==============================================================================
--- maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/mdo/svn-settings.mdo
(added)
+++ maven/scm/trunk/maven-scm-providers/maven-scm-provider-svn/src/main/mdo/svn-settings.mdo
Fri Feb  3 10:01:01 2006
@@ -0,0 +1,28 @@
+<model>
+  <id>svn</id>
+  <name>Svn</name>
+  <description>SVN Provider Model.</description>
+  <defaults>
+    <default>
+      <key>package</key>
+      <value>org.apache.maven.scm.providers.svn.settings</value>
+    </default>
+  </defaults>
+
+  <classes>
+    <class rootElement="true" xml.tagName="svn-settings">
+      <name>Settings</name>
+      <version>1.0.0+</version>
+      <fields>
+        <field>
+          <name>configDirectory</name>
+          <version>1.0.0+</version>
+          <type>String</type>
+          <description><![CDATA[
+             Instructs Subversion to read configuration information from the specified directory
instead of the default location.
+          ]]></description>
+        </field>
+      </fields>
+    </class>
+  </classes>
+</model>



Mime
View raw message