Fix cvs connection string
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@370407 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0876d93a4a
commit
98c84de9a1
@ -118,6 +118,39 @@ public final class ScmUtil
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
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.
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
#set ($connscm = $scmUtil.getScmType($repository.connection))
|
||||
|
||||
#if ($connscm == 'cvs')
|
||||
#set ($conn = $scmUtil.getCvsRoot($repository.connection, ''))
|
||||
#set ($conn = $scmUtil.getCvsConnection($repository.connection, ''))
|
||||
#set ($module = $scmUtil.getCvsModule($repository.connection))
|
||||
|
||||
<section key="template.cvs_usage.section3.title"
|
||||
@ -71,7 +71,7 @@
|
||||
maven scm:checkout
|
||||
-Dmaven.scm.method=$connscm
|
||||
-Dmaven.scm.cvs.module=$module
|
||||
-Dmaven.scm.url=$repository.connection
|
||||
-Dmaven.scm.url=$conn
|
||||
-Dmaven.scm.checkout.dir=$module
|
||||
]]>
|
||||
</source>
|
||||
@ -103,7 +103,7 @@
|
||||
#set ($connscm = $scmUtil.getScmType($repository.developerConnection))
|
||||
|
||||
#if ($connscm == 'cvs')
|
||||
#set ($conn = $scmUtil.getCvsRoot($repository.developerConnection, 'username'))
|
||||
#set ($conn = $scmUtil.getCvsConnection($repository.developerConnection, 'username'))
|
||||
#set ($module = $scmUtil.getCvsModule($repository.developerConnection))
|
||||
#set ($server = $scmUtil.getCvsServer($repository.developerConnection))
|
||||
|
||||
@ -120,7 +120,7 @@
|
||||
maven scm:checkout
|
||||
-Dmaven.scm.method=$connscm
|
||||
-Dmaven.scm.cvs.module=$module
|
||||
-Dmaven.scm.url=$repository.developerConnection
|
||||
-Dmaven.scm.url=$conn
|
||||
-Dmaven.scm.checkout.dir=$module
|
||||
-Dmaven.scm.cvs.rsh=ssh
|
||||
]]>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user