use of org.apache.maven.scm.ScmTagParameters in project maven-scm by apache.
the class AbstractTagCommand method executeCommand.
/**
* {@inheritDoc}
*/
public ScmResult executeCommand(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
String tagName = parameters.getString(CommandParameter.TAG_NAME);
ScmTagParameters scmTagParameters = parameters.getScmTagParameters(CommandParameter.SCM_TAG_PARAMETERS);
String message = parameters.getString(CommandParameter.MESSAGE, null);
if (message != null) {
// if message was passed by CommandParameter.MESSAGE then use it.
scmTagParameters.setMessage(message);
}
if (scmTagParameters.getMessage() == null) {
// if message hasn't been passed nor by ScmTagParameters nor by CommandParameter.MESSAGE then use default.
scmTagParameters.setMessage("[maven-scm] copy for tag " + tagName);
}
return executeTagCommand(repository, fileSet, tagName, scmTagParameters);
}
use of org.apache.maven.scm.ScmTagParameters in project maven-scm by apache.
the class AbstractScmProvider method tag.
/**
* {@inheritDoc}
*/
public TagScmResult tag(ScmRepository repository, ScmFileSet fileSet, String tagName, String message) throws ScmException {
login(repository, fileSet);
CommandParameters parameters = new CommandParameters();
parameters.setString(CommandParameter.TAG_NAME, tagName);
if (StringUtils.isNotEmpty(message)) {
parameters.setString(CommandParameter.MESSAGE, message);
}
ScmTagParameters scmTagParameters = new ScmTagParameters(message);
parameters.setScmTagParameters(CommandParameter.SCM_TAG_PARAMETERS, scmTagParameters);
return tag(repository.getProviderRepository(), fileSet, parameters);
}
use of org.apache.maven.scm.ScmTagParameters in project maven-scm by apache.
the class TfsTagCommandTest method testCommandline.
public void testCommandline() throws Exception {
TfsScmProviderRepository repo = getScmProviderRepository();
ScmTagParameters param = new ScmTagParameters("Message of many words");
Commandline cmd = new TfsTagCommand().createCommand(repo, getScmFileSet(), "tag", param).getCommandline();
String expected = "tf label -login:user,password tag " + repo.getServerPath() + " -recursive -child:replace -comment:\"Message of many words\"";
assertCommandLine(expected, getWorkingDirectory(), cmd);
}
use of org.apache.maven.scm.ScmTagParameters in project maven-scm by apache.
the class SvnExeTagCommandTckTest method testTagRemoteTagHttps.
public void testTagRemoteTagHttps() throws Exception {
File messageFile = File.createTempFile("maven-scm", "commit");
messageFile.deleteOnExit();
ScmTagParameters scmTagParameters = new ScmTagParameters();
scmTagParameters.setRemoteTagging(true);
testCommandLine("scm:svn:https://foo.com/svn/trunk", "svntag", messageFile, "user", "svn --username user --no-auth-cache --non-interactive copy --file " + messageFile.getAbsolutePath() + " --parents https://foo.com/svn/trunk https://foo.com/svn/tags/svntag", scmTagParameters);
}
use of org.apache.maven.scm.ScmTagParameters in project maven-scm by apache.
the class SvnExeTagCommandTckTest method testTagRemoteTagHttpsWithRevision.
public void testTagRemoteTagHttpsWithRevision() throws Exception {
File messageFile = File.createTempFile("maven-scm", "commit");
messageFile.deleteOnExit();
ScmTagParameters scmTagParameters = new ScmTagParameters();
scmTagParameters.setRemoteTagging(true);
scmTagParameters.setScmRevision("12");
testCommandLine("scm:svn:https://foo.com/svn/trunk", "svntag", messageFile, "user", "svn --username user --no-auth-cache --non-interactive copy --file " + messageFile.getAbsolutePath() + " --parents --revision 12 https://foo.com/svn/trunk https://foo.com/svn/tags/svntag", scmTagParameters);
}
Aggregations