Use maven-scm-provider-cvs maven-scm-provider-svn in scm-usage page.
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@391782 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
1 parent
2ef13436c8
commit
d8285a9c53
5 files changed
+181
-196
No files matched your search
@@ -273,6 +273,16 @@
|
||||
<artifactId>maven-scm-api</artifactId>
|
||||
<version>1.0-beta-2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-provider-cvs</artifactId>
|
||||
<version>1.0-beta-2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-provider-svn</artifactId>
|
||||
<version>1.0-beta-2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.maven.scm</groupId>
|
||||
<artifactId>maven-scm-provider-perforce</artifactId>
|
||||
|
||||
@@ -21,6 +21,10 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.maven.scm.provider.cvslib.CvsScmProvider;
|
||||
import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository;
|
||||
import org.apache.maven.scm.provider.svn.SvnScmProvider;
|
||||
import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository;
|
||||
import org.apache.maven.scm.provider.clearcase.ClearCaseScmProvider;
|
||||
import org.apache.maven.scm.provider.clearcase.repository.ClearCaseScmProviderRepository;
|
||||
import org.apache.maven.scm.provider.perforce.PerforceScmProvider;
|
||||
@@ -136,6 +140,156 @@ public final class ScmUtil {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the documentation to provide an anonymous access with a <code>CVS</code> SCM.
|
||||
* For example, generate the following command line:
|
||||
* <p>cvs -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic login</p>
|
||||
* <p>cvs -z3 -d :pserver:anoncvs@cvs.apache.org:/home/cvspublic co maven-plugins/dist</p>
|
||||
*
|
||||
* @param cvsRepo
|
||||
* @see <a href="https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115">https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115</a>
|
||||
*/
|
||||
public String anonymousAccessCVS( String connection )
|
||||
{
|
||||
|
||||
char delim = getSCMConnectionSeparator(connection).charAt(0);
|
||||
|
||||
CvsScmProvider cvsProvider = new CvsScmProvider();
|
||||
CvsScmProviderRepository cvsRepo;
|
||||
|
||||
String scmSpecificUrl = connection.substring(8);
|
||||
|
||||
try {
|
||||
cvsRepo = (CvsScmProviderRepository) cvsProvider
|
||||
.makeProviderScmRepository(scmSpecificUrl, delim);
|
||||
} catch (ScmRepositoryException e) {
|
||||
System.err
|
||||
.println("Your developerConnection does not seem to be valid: "
|
||||
+ e.getMessage());
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuffer command = new StringBuffer();
|
||||
command.append( "cvs -d " ).append( cvsRepo.getCvsRoot() ).append( " login" );
|
||||
command.append( "\n" );
|
||||
command.append( "cvs -z3 -d " ).append( cvsRepo.getCvsRoot() );
|
||||
command.append( " co " ).append( cvsRepo.getModule() );
|
||||
|
||||
return command.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the documentation to provide an developer access with a <code>CVS</code> SCM.
|
||||
* For example, generate the following command line:
|
||||
* <p>export CVS_RSH=ssh</p>
|
||||
* <p>cvs -z3 -d :ext:username@cvs.apache.org:/home/cvs co maven-plugins/dist</p>
|
||||
*
|
||||
* @param cvsRepo
|
||||
* @see <a href="https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115">https://www.cvshome.org/docs/manual/cvs-1.12.12/cvs_16.html#SEC115</a>
|
||||
*/
|
||||
public String developerAccessCVS( String devConnection )
|
||||
{
|
||||
|
||||
char delim = getSCMConnectionSeparator(devConnection).charAt(0);
|
||||
|
||||
CvsScmProvider cvsProvider = new CvsScmProvider();
|
||||
CvsScmProviderRepository cvsRepo;
|
||||
|
||||
String scmSpecificUrl = devConnection.substring(8);
|
||||
|
||||
try {
|
||||
cvsRepo = (CvsScmProviderRepository) cvsProvider
|
||||
.makeProviderScmRepository(scmSpecificUrl, delim);
|
||||
} catch (ScmRepositoryException e) {
|
||||
System.err
|
||||
.println("Your developerConnection does not seem to be valid: "
|
||||
+ e.getMessage());
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
// Safety: remove the username if present
|
||||
String cvsRoot = StringUtils.replace( cvsRepo.getCvsRoot(), cvsRepo.getUser(), "username" );
|
||||
|
||||
StringBuffer command = new StringBuffer();
|
||||
command.append( "export CVS_RSH=ssh" );
|
||||
command.append( "\n" );
|
||||
command.append( "cvs -z3 -d " ).append( cvsRoot ).append( " co " ).append( cvsRepo.getModule() );
|
||||
|
||||
return command.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the documentation to provide an anonymous access with a <code>SVN</code> SCM.
|
||||
* For example, generate the following command line:
|
||||
* <p>svn checkout http://svn.apache.org/repos/asf/maven/components/trunk maven</p>
|
||||
*
|
||||
* @param svnRepo
|
||||
* @see <a href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a>
|
||||
*/
|
||||
public String anonymousAccessSVN( String connection, String checkoutDirectoryName )
|
||||
{
|
||||
|
||||
char delim = getSCMConnectionSeparator(connection).charAt(0);
|
||||
|
||||
SvnScmProvider svnProvider = new SvnScmProvider();
|
||||
SvnScmProviderRepository svnRepo;
|
||||
|
||||
String scmSpecificUrl = connection.substring(8);
|
||||
|
||||
try {
|
||||
svnRepo = (SvnScmProviderRepository) svnProvider
|
||||
.makeProviderScmRepository(scmSpecificUrl, delim);
|
||||
} catch (ScmRepositoryException e) {
|
||||
System.err
|
||||
.println("Your developerConnection does not seem to be valid: "
|
||||
+ e.getMessage());
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuffer command = new StringBuffer();
|
||||
command.append( "svn checkout " ).append( svnRepo.getUrl() ).append( " " ).append( checkoutDirectoryName );
|
||||
|
||||
return command.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the documentation to provide an developer access with a <code>SVN</code> SCM.
|
||||
* For example, generate the following command line:
|
||||
* <p>svn checkout https://svn.apache.org/repos/asf/maven/components/trunk maven</p>
|
||||
* <p>svn commit --username your-username -m "A message"</p>
|
||||
*
|
||||
* @param svnRepo
|
||||
* @see <a href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a>
|
||||
*/
|
||||
public String developerAccessSVN( String devConnection, String checkoutDirectoryName )
|
||||
{
|
||||
|
||||
char delim = getSCMConnectionSeparator(devConnection).charAt(0);
|
||||
|
||||
SvnScmProvider svnProvider = new SvnScmProvider();
|
||||
SvnScmProviderRepository svnRepo;
|
||||
|
||||
String scmSpecificUrl = devConnection.substring(8);
|
||||
|
||||
try {
|
||||
svnRepo = (SvnScmProviderRepository) svnProvider
|
||||
.makeProviderScmRepository(scmSpecificUrl, delim);
|
||||
} catch (ScmRepositoryException e) {
|
||||
System.err
|
||||
.println("Your developerConnection does not seem to be valid: "
|
||||
+ e.getMessage());
|
||||
return "";
|
||||
}
|
||||
|
||||
StringBuffer command = new StringBuffer();
|
||||
|
||||
command.append( "svn checkout " ).append( svnRepo.getUrl() ).append( " " ).append( checkoutDirectoryName );
|
||||
|
||||
return command.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create the documentation to provide an developer access with a
|
||||
* <code>Perforce</code> SCM. For example, generate the following command
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
<?xml version="1.0" encoding="$encoding" ?>
|
||||
<!--
|
||||
/*
|
||||
* Copyright 2001-2004 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.
|
||||
*/
|
||||
-->
|
||||
|
||||
|
||||
<document>
|
||||
<properties>
|
||||
<title key="template.cvs_usage.title"
|
||||
bundle="plugin-resources.templates.templates" >
|
||||
<message key="template.cvs_usage.title"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</title>
|
||||
</properties>
|
||||
|
||||
<body>
|
||||
#set ($repository = $project.repository)
|
||||
|
||||
#if (!$repository)
|
||||
<section key="template.cvs_usage.section1.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="Repository">
|
||||
<p>
|
||||
<message key="template.cvs_usage.section1.no_repository"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
</section>
|
||||
#else
|
||||
#if ($repository.url && $repository.url != '')
|
||||
#set ($url = $escape.getText($repository.url))
|
||||
<section key="template.cvs_usage.section2.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="Web Access">
|
||||
<p>
|
||||
<a href="$url">$url</a>
|
||||
</p>
|
||||
</section>
|
||||
#end
|
||||
|
||||
#if ($repository.connection && $repository.connection != '')
|
||||
#set ($connscm = $scmUtil.getScmType($repository.connection))
|
||||
|
||||
#if ($connscm == 'cvs')
|
||||
#set ($conn = $scmUtil.getCvsConnection($repository.connection, ''))
|
||||
#set ($module = $scmUtil.getCvsModule($repository.connection))
|
||||
|
||||
<section key="template.cvs_usage.section3.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="Anonymous Access with Maven">
|
||||
<p>
|
||||
<message key="template.cvs_usage.section3.description"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
|
||||
<source>
|
||||
<![CDATA[
|
||||
maven scm:checkout
|
||||
-Dmaven.scm.method=$connscm
|
||||
-Dmaven.scm.cvs.module=$module
|
||||
-Dmaven.scm.url=$conn
|
||||
-Dmaven.scm.checkout.dir=$module
|
||||
]]>
|
||||
</source>
|
||||
</section>
|
||||
|
||||
<section key="template.cvs_usage.section4.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="Anonymous CVS Access">
|
||||
<p>
|
||||
<message key="template.cvs_usage.section4.description"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
cvs -d $conn login
|
||||
<br />
|
||||
cvs -z3 -d $conn co $module
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<message key="template.cvs_usage.section4.updates"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
</section>
|
||||
#end
|
||||
#end
|
||||
|
||||
#if ($repository.developerConnection && $repository.developerConnection != '')
|
||||
#set ($connscm = $scmUtil.getScmType($repository.developerConnection))
|
||||
|
||||
#if ($connscm == 'cvs')
|
||||
#set ($conn = $scmUtil.getCvsConnection($repository.developerConnection, 'username'))
|
||||
#set ($module = $scmUtil.getCvsModule($repository.developerConnection))
|
||||
#set ($server = $scmUtil.getCvsServer($repository.developerConnection))
|
||||
|
||||
<section key="template.cvs_usage.section5.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="Developer Access with Maven">
|
||||
<p>
|
||||
<message key="template.cvs_usage.section5.description"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
|
||||
<source>
|
||||
<![CDATA[
|
||||
maven scm:checkout
|
||||
-Dmaven.scm.method=$connscm
|
||||
-Dmaven.scm.cvs.module=$module
|
||||
-Dmaven.scm.url=$conn
|
||||
-Dmaven.scm.checkout.dir=$module
|
||||
-Dmaven.scm.cvs.rsh=ssh
|
||||
]]>
|
||||
</source>
|
||||
|
||||
<p>
|
||||
<message key="template.cvs_usage.section5.remember"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
</section>
|
||||
|
||||
<section key="template.cvs_usage.section6.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="Developer CVS Access via SSH">
|
||||
|
||||
<p>
|
||||
<message key="template.cvs_usage.section6.description"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
|
||||
<p>
|
||||
export CVS_RSH=ssh
|
||||
<br />
|
||||
cvs -z3 -d $conn co $module
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<message key="template.cvs_usage.section6.remember"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
|
||||
</section>
|
||||
#end
|
||||
#end
|
||||
|
||||
#if ($repository.url && $repository.url != '' && $repository.connection && $repository.connection != '')
|
||||
#set ($connscm = $scmUtil.getScmType($repository.connection))
|
||||
|
||||
#if ($connscm == 'cvs')
|
||||
<section key="template.cvs_usage.section7.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="CVS Access behind a firewall">
|
||||
|
||||
<p>
|
||||
<message key="template.cvs_usage.section7.description1"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
<a href="http://cvsgrab.sourceforge.net/">CVSGrab</a>
|
||||
<message key="template.cvs_usage.section7.description2"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
|
||||
</section>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
</body>
|
||||
</document>
|
||||
@@ -11,7 +11,6 @@
|
||||
</p>
|
||||
|
||||
#if ($repository.connection && $repository.connection != '')
|
||||
#set ($connscm = $scmUtil.getScmType($repository.connection))
|
||||
|
||||
#set ($conn = $scmUtil.getCvsConnection($repository.connection, ''))
|
||||
#set ($module = $scmUtil.getCvsModule($repository.connection))
|
||||
@@ -27,12 +26,14 @@
|
||||
<source>
|
||||
<![CDATA[
|
||||
maven scm:checkout
|
||||
-Dmaven.scm.method=$connscm
|
||||
-Dmaven.scm.method=cvs
|
||||
-Dmaven.scm.url=$conn
|
||||
-Dmaven.scm.checkout.dir=$module
|
||||
]]></source>
|
||||
</subsection>
|
||||
|
||||
#set ($command = $scmUtil.anonymousAccessCVS($repository.connection))
|
||||
|
||||
<subsection key="template.cvs.section4.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="Anonymous CVS Access">
|
||||
@@ -41,8 +42,7 @@
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
|
||||
<source>cvs -d $conn login
|
||||
cvs -z3 -d $conn co $module</source>
|
||||
<source>$command</source>
|
||||
|
||||
<p>
|
||||
<message key="template.cvs.section4.updates"
|
||||
@@ -52,7 +52,6 @@ cvs -z3 -d $conn co $module</source>
|
||||
#end
|
||||
|
||||
#if ($repository.developerConnection && $repository.developerConnection != '')
|
||||
#set ($connscm = $scmUtil.getScmType($repository.developerConnection))
|
||||
|
||||
#set ($conn = $scmUtil.getCvsConnection($repository.developerConnection, 'username'))
|
||||
#set ($module = $scmUtil.getCvsModule($repository.developerConnection))
|
||||
@@ -68,7 +67,7 @@ cvs -z3 -d $conn co $module</source>
|
||||
<source>
|
||||
<![CDATA[
|
||||
maven scm:checkout
|
||||
-Dmaven.scm.method=$connscm
|
||||
-Dmaven.scm.method=cvs
|
||||
-Dmaven.scm.url=$conn
|
||||
-Dmaven.scm.checkout.dir=$module
|
||||
]]></source>
|
||||
@@ -79,6 +78,8 @@ cvs -z3 -d $conn co $module</source>
|
||||
</p>
|
||||
</subsection>
|
||||
|
||||
#set ($command = $scmUtil.developerAccessCVS($repository.developerConnection))
|
||||
|
||||
<subsection key="template.cvs.section6.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="Developer CVS Access via SSH">
|
||||
@@ -88,9 +89,7 @@ cvs -z3 -d $conn co $module</source>
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
|
||||
<source>export CVS_RSH=ssh
|
||||
cvs -z3 -d $conn co $module
|
||||
</source>
|
||||
<source>$command</source>
|
||||
|
||||
<p>
|
||||
<message key="template.cvs.section6.remember"
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
</p>
|
||||
|
||||
#if ($repository.connection && $repository.connection != '')
|
||||
#set ($connscm = $scmUtil.getScmType($repository.connection))
|
||||
#set ($svnconn = $scmUtil.getSvnConnection($repository.connection))
|
||||
|
||||
#set ($conn = $repository.connection)
|
||||
@@ -27,12 +26,14 @@
|
||||
<source>
|
||||
<![CDATA[
|
||||
maven scm:checkout
|
||||
-Dmaven.scm.method=$connscm
|
||||
-Dmaven.scm.method=svn
|
||||
-Dmaven.scm.url=$conn
|
||||
-Dmaven.scm.checkout.dir=$project.artifactId
|
||||
]]></source>
|
||||
</subsection>
|
||||
|
||||
#set ($command = $scmUtil.anonymousAccessSVN($repository.connection, $project.artifactId))
|
||||
|
||||
<subsection key="template.svn.section4.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="Anonymous Access">
|
||||
@@ -41,13 +42,12 @@
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
|
||||
<source>svn checkout $svnconn $project.artifactId</source>
|
||||
<source>$command</source>
|
||||
|
||||
</subsection>
|
||||
#end
|
||||
|
||||
#if ($repository.developerConnection && $repository.developerConnection != '')
|
||||
#set ($connscm = $scmUtil.getScmType($repository.developerConnection))
|
||||
#set ($svnconn = $scmUtil.getSvnConnection($repository.developerConnection))
|
||||
|
||||
#set ($conn = $repository.developerConnection)
|
||||
@@ -63,13 +63,15 @@
|
||||
<source>
|
||||
<![CDATA[
|
||||
maven scm:checkout
|
||||
-Dmaven.scm.method=$connscm
|
||||
-Dmaven.scm.method=svn
|
||||
-Dmaven.scm.url=$conn
|
||||
-Dmaven.scm.checkout.dir=$project.artifactId
|
||||
]]></source>
|
||||
|
||||
</subsection>
|
||||
|
||||
#set ($command = $scmUtil.developerAccessSVN($repository.developerConnection, $project.artifactId))
|
||||
|
||||
<subsection key="template.svn.section6.title"
|
||||
bundle="plugin-resources.templates.templates"
|
||||
name="Developer Access">
|
||||
@@ -79,7 +81,7 @@
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
|
||||
<source>svn checkout $svnconn $project.artifactId</source>
|
||||
<source>$command</source>
|
||||
|
||||
</subsection>
|
||||
|
||||
@@ -91,7 +93,7 @@
|
||||
<message key="template.svn.section7.description"
|
||||
bundle="plugin-resources.templates.templates" />
|
||||
</p>
|
||||
<source>svn checkout $conn $project.artifactId</source>
|
||||
<source>$command</source>
|
||||
|
||||
</subsection>
|
||||
|
||||
|
||||
Reference in new issue
Block a user