Class AbstractScmMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.codehaus.mojo.build.AbstractScmMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CreateMetadataMojo, CreateMojo
public abstract class AbstractScmMojo
extends org.apache.maven.plugin.AbstractMojo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanIgnore error when scm url from pom is empty and replace by scm:scmProviderscmProviderprotected StringThe password that is used when connecting to the SCM system.protected org.apache.maven.project.MavenProjectprotected StringSetting this value allows the build to continue even in the event of an SCM failure.protected Stringprotected Stringprotected FileIssue SCM actions at this local directoryprotected org.apache.maven.scm.manager.ScmManagerprivate StringWhen scm url is empty, scm provider is neededignoreEmptyScmUrlprotected Stringprivate org.sonatype.plexus.components.sec.dispatcher.SecDispatcherMaven Security Dispatcherprotected org.apache.maven.settings.SettingsMaven Settingsprotected intMax length of a revision id (GIT only)protected booleanWhether to skip this execution.private booleanwhether to retrieve the revision for the last commit, or the last revision of the repository.protected StringThe username that is used when connecting to the SCM system.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckResult(org.apache.maven.scm.ScmResult result) private Stringprotected org.apache.maven.scm.repository.ScmRepositoryprotected Stringprotected org.apache.maven.scm.command.info.InfoScmResultinfo(org.apache.maven.scm.repository.ScmRepository repository, org.apache.maven.scm.ScmFileSet fileSet) Get info from scm.private voidloadInfosFromSettings(org.apache.maven.scm.provider.ScmProviderRepositoryWithHost repo) Load username password from settings.private voidsetPasswordIfNotEmpty(org.apache.maven.scm.provider.ScmProviderRepository repository, String password) private voidsetUserIfNotEmpty(org.apache.maven.scm.provider.ScmProviderRepository repository, String user) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
scmConnectionUrl
@Parameter(defaultValue="${project.scm.connection}", alias="readUrlScm", readonly=true) protected String scmConnectionUrl- Since:
- 1.0-beta-5
-
scmDeveloperConnectionUrl
@Parameter(defaultValue="${project.scm.developerConnection}", alias="urlScm", readonly=true) protected String scmDeveloperConnectionUrl- Since:
- 1.0-beta-5
-
scmTag
- Since:
- 1.4
-
username
The username that is used when connecting to the SCM system.- Since:
- 1.0-beta-1
-
password
The password that is used when connecting to the SCM system.- Since:
- 1.0-beta-1
-
scmDirectory
@Parameter(property="maven.buildNumber.scmDirectory", defaultValue="${basedir}") protected File scmDirectoryIssue SCM actions at this local directory- Since:
- 1.0-beta-1
-
shortRevisionLength
@Parameter(property="maven.buildNumber.shortRevisionLength", defaultValue="0") protected int shortRevisionLengthMax length of a revision id (GIT only)- Since:
- 1.1
-
revisionOnScmFailure
Setting this value allows the build to continue even in the event of an SCM failure. The value set will be used as the revision string in the event of a failure to retrieve the revision it from the SCM.- Since:
- 1.0-beta-2
-
useLastCommittedRevision
@Parameter(property="maven.buildNumber.useLastCommittedRevision", defaultValue="false") private boolean useLastCommittedRevisionwhether to retrieve the revision for the last commit, or the last revision of the repository.- Since:
- 1.0-beta-2
-
skip
@Parameter(property="maven.buildNumber.skip", defaultValue="false") protected boolean skipWhether to skip this execution.- Since:
- 1.3
-
settings
@Parameter(defaultValue="${settings}", readonly=true) protected org.apache.maven.settings.Settings settingsMaven Settings- Since:
- 1.4
-
project
@Parameter(defaultValue="${project}", required=true, readonly=true) protected org.apache.maven.project.MavenProject project -
scmManager
@Component protected org.apache.maven.scm.manager.ScmManager scmManager -
ignoreEmptyScmUrl
@Parameter(property="maven.buildNumber.ignoreEmptyScmUrl", defaultValue="false") private boolean ignoreEmptyScmUrlIgnore error when scm url from pom is empty and replace by scm:scmProviderscmProvider- Since:
- 3.2.1
-
scmProvider
When scm url is empty, scm provider is neededignoreEmptyScmUrl- Since:
- 3.2.1
-
securityDispatcher
@Component(hint="mng-4384") private org.sonatype.plexus.components.sec.dispatcher.SecDispatcher securityDispatcherMaven Security Dispatcher- Since:
- 1.4
-
-
Constructor Details
-
AbstractScmMojo
public AbstractScmMojo()
-
-
Method Details
-
loadInfosFromSettings
private void loadInfosFromSettings(org.apache.maven.scm.provider.ScmProviderRepositoryWithHost repo) Load username password from settings. -
decrypt
-
getScmRepository
protected org.apache.maven.scm.repository.ScmRepository getScmRepository() throws org.apache.maven.scm.ScmException- Throws:
org.apache.maven.scm.ScmException
-
setPasswordIfNotEmpty
private void setPasswordIfNotEmpty(org.apache.maven.scm.provider.ScmProviderRepository repository, String password) -
setUserIfNotEmpty
private void setUserIfNotEmpty(org.apache.maven.scm.provider.ScmProviderRepository repository, String user) -
checkResult
protected void checkResult(org.apache.maven.scm.ScmResult result) throws org.apache.maven.scm.ScmException - Throws:
org.apache.maven.scm.ScmException
-
info
protected org.apache.maven.scm.command.info.InfoScmResult info(org.apache.maven.scm.repository.ScmRepository repository, org.apache.maven.scm.ScmFileSet fileSet) throws org.apache.maven.scm.ScmException Get info from scm.- Parameters:
repository-fileSet-- Returns:
- Throws:
org.apache.maven.scm.ScmException
-
getScmRevision
- Throws:
org.apache.maven.scm.ScmException
-