Lukas

You should use the same separator in the new scm url as was used in the original. The separator can be either ":" or "|". See below:

--
Dennis Lundberg

[EMAIL PROTECTED] wrote:
Author: ltheussl
Date: Wed Jan 18 23:40:58 2006
New Revision: 370407

URL: http://svn.apache.org/viewcvs?rev=370407&view=rev
Log:
Fix cvs connection string

Modified:
    
maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java
    
maven/maven-1/plugins/trunk/xdoc/src/plugin-resources/templates/cvs-usage.xml

Modified: 
maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java
URL: 
http://svn.apache.org/viewcvs/maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java?rev=370407&r1=370406&r2=370407&view=diff
==============================================================================
--- 
maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java
 (original)
+++ 
maven/maven-1/plugins/trunk/xdoc/src/main/org/apache/maven/xdoc/util/ScmUtil.java
 Wed Jan 18 23:40:58 2006
@@ -119,6 +119,39 @@
     }
/**
+     * Get cvs connection string. Used in 
xdocs/src/plugin-resources/templates/cvs-usage.xml.
+     * If username == "", assumes anonymous (pserver) connection. In this case,
+     * inserts a ':' between the username and '@' to indicate
+     * that there is a password and that it is empty.
+     * If username != "" it replaces username in conn.
+ * + * @param conn six token connection string
+     * @param username username override if non-empty.
+     * @return CVS root.
+     */
+    public String getCvsConnection(String conn, String username)
+    {
+        String[] tokens = splitSCMConnection(conn);
+
+        if (!tokens[1].equals("cvs"))
+        {
+            return "";
+        }
+
+        if (tokens[3].indexOf('@') >= 0)
+        {
+            if (username.length() == 0)
+            {
+                username = tokens[3].substring(0, tokens[3].indexOf('@')) + 
":";
+            }
+            tokens[3] = username + "@" + 
tokens[3].substring(tokens[3].indexOf('@') + 1);
+        }

+        // The length of conn has already been checked in the call to
+        // splitSCMConnection(conn) above, so it's OK to just extract
+        // the char.
+        String separator = "" + conn.charAt(3);
+ String result = tokens[0] + separator + tokens[1] + separator + tokens[2] + separator + tokens[3] + separator + tokens[4] + separator + tokens[5];

+        String result = tokens[0] + ":" + tokens[1] + ":" + tokens[2] + ":" + 
tokens[3]
+            + ":" + tokens[4] + ":" + tokens[5];
+        return result;
+    }
+
+    /**
      * Get cvs module. Used in
      * xdocs/src/plugin-resources/templates/cvs-usage.xml.
*

<snip>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to