-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
7 additions
and
426 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,11 +30,8 @@ | |
import org.apache.maven.plugins.annotations.Mojo; | ||
import org.apache.maven.plugins.annotations.Parameter; | ||
import org.apache.maven.scm.manager.ScmManager; | ||
import org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository; | ||
import org.apache.maven.scm.provider.git.repository.GitScmProviderRepository; | ||
import org.apache.maven.scm.provider.hg.repository.HgScmProviderRepository; | ||
import org.apache.maven.scm.provider.perforce.repository.PerforceScmProviderRepository; | ||
import org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository; | ||
import org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository; | ||
import org.apache.maven.scm.repository.ScmRepository; | ||
import org.codehaus.plexus.i18n.I18N; | ||
|
@@ -260,30 +257,14 @@ protected void renderBody() { | |
private void renderOverviewSection(ScmRepository anonymousRepository, ScmRepository devRepository) { | ||
startSection(getI18nString("overview.title")); | ||
|
||
if (isScmSystem(anonymousRepository, "clearcase") || isScmSystem(devRepository, "clearcase")) { | ||
sink.paragraph(); | ||
linkPatternedText(getI18nString("clearcase.intro")); | ||
sink.paragraph_(); | ||
} else if (isScmSystem(anonymousRepository, "cvs") || isScmSystem(devRepository, "cvs")) { | ||
sink.paragraph(); | ||
linkPatternedText(getI18nString("cvs.intro")); | ||
sink.paragraph_(); | ||
} else if (isScmSystem(anonymousRepository, "git") || isScmSystem(devRepository, "git")) { | ||
if (isScmSystem(anonymousRepository, "git") || isScmSystem(devRepository, "git")) { | ||
sink.paragraph(); | ||
linkPatternedText(getI18nString("git.intro")); | ||
sink.paragraph_(); | ||
} else if (isScmSystem(anonymousRepository, "hg") || isScmSystem(devRepository, "hg")) { | ||
sink.paragraph(); | ||
linkPatternedText(getI18nString("hg.intro")); | ||
sink.paragraph_(); | ||
} else if (isScmSystem(anonymousRepository, "perforce") || isScmSystem(devRepository, "perforce")) { | ||
sink.paragraph(); | ||
linkPatternedText(getI18nString("perforce.intro")); | ||
sink.paragraph_(); | ||
} else if (isScmSystem(anonymousRepository, "starteam") || isScmSystem(devRepository, "starteam")) { | ||
sink.paragraph(); | ||
linkPatternedText(getI18nString("starteam.intro")); | ||
sink.paragraph_(); | ||
} else if (isScmSystem(anonymousRepository, "svn") || isScmSystem(devRepository, "svn")) { | ||
sink.paragraph(); | ||
linkPatternedText(getI18nString("svn.intro")); | ||
|
@@ -323,21 +304,13 @@ private void renderWebAccessSection(String scmUrl) { | |
* @param anonymousRepository the anonymous repository | ||
*/ | ||
private void renderAnonymousAccessSection(ScmRepository anonymousRepository) { | ||
if (isScmSystem(anonymousRepository, "clearcase") | ||
|| isScmSystem(anonymousRepository, "perforce") | ||
|| isScmSystem(anonymousRepository, "starteam") | ||
|| (anonymousConnection == null || anonymousConnection.isEmpty())) { | ||
if (anonymousConnection == null || anonymousConnection.isEmpty()) { | ||
return; | ||
} | ||
|
||
startSection(getI18nString("anonymousaccess.title")); | ||
|
||
if (anonymousRepository != null && isScmSystem(anonymousRepository, "cvs")) { | ||
CvsScmProviderRepository cvsRepo = | ||
(CvsScmProviderRepository) anonymousRepository.getProviderRepository(); | ||
|
||
anonymousAccessCVS(cvsRepo); | ||
} else if (anonymousRepository != null && isScmSystem(anonymousRepository, "git")) { | ||
if (anonymousRepository != null && isScmSystem(anonymousRepository, "git")) { | ||
GitScmProviderRepository gitRepo = | ||
(GitScmProviderRepository) anonymousRepository.getProviderRepository(); | ||
|
||
|
@@ -372,30 +345,14 @@ private void renderDeveloperAccessSection(ScmRepository devRepository) { | |
|
||
startSection(getI18nString("devaccess.title")); | ||
|
||
if (devRepository != null && isScmSystem(devRepository, "clearcase")) { | ||
developerAccessClearCase(); | ||
} else if (devRepository != null && isScmSystem(devRepository, "cvs")) { | ||
CvsScmProviderRepository cvsRepo = (CvsScmProviderRepository) devRepository.getProviderRepository(); | ||
|
||
developerAccessCVS(cvsRepo); | ||
} else if (devRepository != null && isScmSystem(devRepository, "git")) { | ||
if (devRepository != null && isScmSystem(devRepository, "git")) { | ||
GitScmProviderRepository gitRepo = (GitScmProviderRepository) devRepository.getProviderRepository(); | ||
|
||
developerAccessGit(gitRepo); | ||
} else if (devRepository != null && isScmSystem(devRepository, "hg")) { | ||
HgScmProviderRepository hgRepo = (HgScmProviderRepository) devRepository.getProviderRepository(); | ||
|
||
developerAccessMercurial(hgRepo); | ||
} else if (devRepository != null && isScmSystem(devRepository, "perforce")) { | ||
PerforceScmProviderRepository perforceRepo = | ||
(PerforceScmProviderRepository) devRepository.getProviderRepository(); | ||
|
||
developerAccessPerforce(perforceRepo); | ||
} else if (devRepository != null && isScmSystem(devRepository, "starteam")) { | ||
StarteamScmProviderRepository starteamRepo = | ||
(StarteamScmProviderRepository) devRepository.getProviderRepository(); | ||
|
||
developerAccessStarteam(starteamRepo); | ||
} else if (devRepository != null && isScmSystem(devRepository, "svn")) { | ||
SvnScmProviderRepository svnRepo = (SvnScmProviderRepository) devRepository.getProviderRepository(); | ||
|
||
|
@@ -423,8 +380,6 @@ private void renderAccessBehindFirewallSection(ScmRepository devRepository) { | |
paragraph(getI18nString("accessbehindfirewall.svn.intro")); | ||
|
||
verbatimText("$ svn checkout " + svnRepo.getUrl() + " " + checkoutDirectoryName); | ||
} else if (devRepository != null && isScmSystem(devRepository, "cvs")) { | ||
linkPatternedText(getI18nString("accessbehindfirewall.cvs.intro")); | ||
} else { | ||
paragraph(getI18nString("accessbehindfirewall.general.intro")); | ||
} | ||
|
@@ -453,46 +408,6 @@ private void renderAccessThroughProxySection(ScmRepository anonymousRepository, | |
} | ||
} | ||
|
||
// Clearcase | ||
|
||
/** | ||
* Create the documentation to provide an developer access with a <code>Clearcase</code> SCM. For example, | ||
* generate the following command line: | ||
* <p> | ||
* cleartool checkout module | ||
* </p> | ||
*/ | ||
private void developerAccessClearCase() { | ||
paragraph(getI18nString("devaccess.clearcase.intro")); | ||
|
||
verbatimText("$ cleartool checkout "); | ||
} | ||
|
||
// CVS | ||
|
||
// CHECKSTYLE_OFF: LineLength | ||
/** | ||
* 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:[email protected]:/home/cvspublic login | ||
* </p> | ||
* <p> | ||
* cvs -z3 -d :pserver:[email protected]:/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> | ||
*/ | ||
// CHECKSTYLE_ON: LineLength | ||
private void anonymousAccessCVS(CvsScmProviderRepository cvsRepo) { | ||
paragraph(getI18nString("anonymousaccess.cvs.intro")); | ||
|
||
verbatimText("$ cvs -d " + cvsRepo.getCvsRoot() + " login" + LS + "$ cvs -z3 -d " + cvsRepo.getCvsRoot() | ||
+ " co " + cvsRepo.getModule()); | ||
} | ||
|
||
// Git | ||
|
||
private void gitClone(String url) { | ||
|
@@ -543,32 +458,6 @@ private void anonymousAccessMercurial(HgScmProviderRepository hgRepo) { | |
verbatimText("$ hg clone " + hgRepo.getURI()); | ||
} | ||
|
||
// CHECKSTYLE_OFF: LineLength | ||
/** | ||
* Create the documentation to provide an developer access with a <code>CVS</code> SCM. For example, generate | ||
* the following command line: | ||
* <p> | ||
* cvs -d :pserver:[email protected]:/home/cvs login | ||
* </p> | ||
* <p> | ||
* cvs -z3 -d :ext:[email protected]:/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> | ||
*/ | ||
// CHECKSTYLE_ON: LineLength | ||
private void developerAccessCVS(CvsScmProviderRepository cvsRepo) { | ||
paragraph(getI18nString("devaccess.cvs.intro")); | ||
|
||
// Safety: remove the username if present | ||
String cvsRoot = StringUtils.replace(cvsRepo.getCvsRoot(), cvsRepo.getUser(), "username"); | ||
|
||
verbatimText( | ||
"$ cvs -d " + cvsRoot + " login" + LS + "$ cvs -z3 -d " + cvsRoot + " co " + cvsRepo.getModule()); | ||
} | ||
|
||
// Git | ||
|
||
/** | ||
|
@@ -607,81 +496,6 @@ private void developerAccessMercurial(HgScmProviderRepository hgRepo) { | |
verbatimText("$ hg clone " + hgRepo.getURI()); | ||
} | ||
|
||
// Perforce | ||
|
||
// CHECKSTYLE_OFF: LineLength | ||
/** | ||
* Create the documentation to provide an developer access with a <code>Perforce</code> SCM. For example, | ||
* generate the following command line: | ||
* <p> | ||
* p4 -H hostname -p port -u username -P password path | ||
* </p> | ||
* <p> | ||
* p4 -H hostname -p port -u username -P password path submit -c changement | ||
* </p> | ||
* | ||
* @param perforceRepo | ||
* @see <a | ||
* href="http://www.perforce.com/perforce/doc.051/manuals/cmdref/index.html">http://www.perforce.com/ | ||
* perforce | ||
* /doc.051/manuals/cmdref/index.html</> | ||
*/ | ||
// CHECKSTYLE_ON: LineLength | ||
private void developerAccessPerforce(PerforceScmProviderRepository perforceRepo) { | ||
paragraph(getI18nString("devaccess.perforce.intro")); | ||
|
||
StringBuilder command = new StringBuilder(); | ||
command.append("$ p4"); | ||
if (!StringUtils.isEmpty(perforceRepo.getHost())) { | ||
command.append(" -H ").append(perforceRepo.getHost()); | ||
} | ||
if (perforceRepo.getPort() > 0) { | ||
command.append(" -p ").append(perforceRepo.getPort()); | ||
} | ||
command.append(" -u username"); | ||
command.append(" -P password"); | ||
command.append(" "); | ||
command.append(perforceRepo.getPath()); | ||
command.append(LS); | ||
command.append("$ p4 submit -c \"A comment\""); | ||
|
||
verbatimText(command.toString()); | ||
} | ||
|
||
// Starteam | ||
|
||
/** | ||
* Create the documentation to provide an developer access with a <code>Starteam</code> SCM. For example, | ||
* generate the following command line: | ||
* <p> | ||
* stcmd co -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl -is | ||
* </p> | ||
* <p> | ||
* stcmd ci -x -nologo -stop -p myusername:mypassword@myhost:1234/projecturl -f NCI -is | ||
* </p> | ||
* | ||
* @param starteamRepo | ||
*/ | ||
private void developerAccessStarteam(StarteamScmProviderRepository starteamRepo) { | ||
paragraph(getI18nString("devaccess.starteam.intro")); | ||
|
||
StringBuilder command = new StringBuilder(); | ||
|
||
// Safety: remove the username/password if present | ||
String fullUrl = StringUtils.replace(starteamRepo.getFullUrl(), starteamRepo.getUser(), "username"); | ||
fullUrl = StringUtils.replace(fullUrl, starteamRepo.getPassword(), "password"); | ||
|
||
command.append("$ stcmd co -x -nologo -stop -p "); | ||
command.append(fullUrl); | ||
command.append(" -is"); | ||
command.append(LS); | ||
command.append("$ stcmd ci -x -nologo -stop -p "); | ||
command.append(fullUrl); | ||
command.append(" -f NCI -is"); | ||
|
||
verbatimText(command.toString()); | ||
} | ||
|
||
// Subversion | ||
|
||
/** | ||
|
Oops, something went wrong.