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

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    Ignore error when scm url from pom is empty and replace by scm:scmProvider scmProvider
    protected String
    The password that is used when connecting to the SCM system.
    protected org.apache.maven.project.MavenProject
     
    protected String
    Setting this value allows the build to continue even in the event of an SCM failure.
    protected String
     
    protected String
     
    protected File
    Issue SCM actions at this local directory
    protected org.apache.maven.scm.manager.ScmManager
     
    private String
    When scm url is empty, scm provider is needed ignoreEmptyScmUrl
    protected String
     
    private org.sonatype.plexus.components.sec.dispatcher.SecDispatcher
    Maven Security Dispatcher
    protected org.apache.maven.settings.Settings
    Maven Settings
    protected int
    Max length of a revision id (GIT only)
    protected boolean
    Whether to skip this execution.
    private boolean
    whether to retrieve the revision for the last commit, or the last revision of the repository.
    protected String
    The username that is used when connecting to the SCM system.

    Fields inherited from interface org.apache.maven.plugin.Mojo

    ROLE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    checkResult(org.apache.maven.scm.ScmResult result)
     
    private String
    decrypt(String str, String server)
     
    protected org.apache.maven.scm.repository.ScmRepository
     
    protected String
     
    protected org.apache.maven.scm.command.info.InfoScmResult
    info(org.apache.maven.scm.repository.ScmRepository repository, org.apache.maven.scm.ScmFileSet fileSet)
    Get info from scm.
    private void
    loadInfosFromSettings(org.apache.maven.scm.provider.ScmProviderRepositoryWithHost repo)
    Load username password from settings.
    private void
    setPasswordIfNotEmpty(org.apache.maven.scm.provider.ScmProviderRepository repository, String password)
     
    private void
    setUserIfNotEmpty(org.apache.maven.scm.provider.ScmProviderRepository repository, String user)
     

    Methods inherited from class org.apache.maven.plugin.AbstractMojo

    getLog, getPluginContext, setLog, setPluginContext

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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

      @Parameter(defaultValue="${project.scm.tag}", readonly=true) protected String scmTag
      Since:
      1.4
    • username

      @Parameter(property="username") protected String username
      The username that is used when connecting to the SCM system.
      Since:
      1.0-beta-1
    • password

      @Parameter(property="password") protected String 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 scmDirectory
      Issue SCM actions at this local directory
      Since:
      1.0-beta-1
    • shortRevisionLength

      @Parameter(property="maven.buildNumber.shortRevisionLength", defaultValue="0") protected int shortRevisionLength
      Max length of a revision id (GIT only)
      Since:
      1.1
    • revisionOnScmFailure

      @Parameter(property="maven.buildNumber.revisionOnScmFailure") protected String 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 useLastCommittedRevision
      whether 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 skip
      Whether to skip this execution.
      Since:
      1.3
    • settings

      @Parameter(defaultValue="${settings}", readonly=true) protected org.apache.maven.settings.Settings settings
      Maven 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 ignoreEmptyScmUrl
      Ignore error when scm url from pom is empty and replace by scm:scmProvider scmProvider
      Since:
      3.2.1
    • scmProvider

      @Parameter(property="maven.buildNumber.scmProvider", defaultValue="git") private String scmProvider
      When scm url is empty, scm provider is needed ignoreEmptyScmUrl
      Since:
      3.2.1
    • securityDispatcher

      @Component(hint="mng-4384") private org.sonatype.plexus.components.sec.dispatcher.SecDispatcher securityDispatcher
      Maven 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

      private String decrypt(String str, String server)
    • 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

      protected String getScmRevision() throws org.apache.maven.scm.ScmException
      Throws:
      org.apache.maven.scm.ScmException