Package org.apache.maven.scm.plugin
Class AbstractScmMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- org.apache.maven.scm.plugin.AbstractScmMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
AddMojo,BranchMojo,ChangeLogMojo,CheckinMojo,CheckLocalModificationsMojo,CheckoutMojo,DiffMojo,EditMojo,ExportMojo,ListMojo,RemoveMojo,StatusMojo,TagMojo,UnEditMojo,UntagMojo,UpdateMojo,UpdateSubprojectsMojo,ValidateMojo
public abstract class AbstractScmMojo extends org.apache.maven.plugin.AbstractMojo
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.FilebasedirThe base directory.private java.lang.StringconnectionTypeThe type of connection to use (connection or developerConnection).private java.lang.StringconnectionUrlThe SCM connection URL.private java.lang.StringdeveloperConnectionUrlThe SCM connection URL for developers.private java.lang.StringexcludesComma separated list of excludes file pattern.private java.lang.StringincludesComma separated list of includes file pattern.private ScmManagermanagerprivate java.lang.StringpassphraseThe passphrase.private java.lang.StringpasswordThe user password.private java.lang.StringprivateKeyThe private key.private java.util.Map<java.lang.String,java.lang.String>providerImplementationsList of remapped provider implementations.private booleanpushChangesShould distributed changes be pushed to the central repository? For many distributed SCMs like Git, a change like a commit is only stored in your local copy of the repository.private java.lang.StringserverIdThe server id of the server which provides the credentials for the SCM in the settings.xml file.private org.apache.maven.settings.Settingssettingsprivate org.apache.maven.settings.crypto.SettingsDecryptersettingsDecrypterprivate java.util.PropertiessystemPropertiesList of System properties to set before executing the SCM command.private java.lang.StringtagBaseThe url of tags base directory (used by svn protocol).private java.lang.StringusernameThe user name.protected static java.lang.String[]VALID_VERSION_TYPESprotected static java.lang.StringVERSION_TYPE_BRANCHprotected static java.lang.StringVERSION_TYPE_REVISIONprotected static java.lang.StringVERSION_TYPE_TAGprivate java.io.FileworkingDirectoryThe working directory.private java.lang.StringworkItemDeprecated.
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractScmMojo(ScmManager manager, org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckResult(ScmResult result)private org.apache.maven.settings.Serverdecrypt(org.apache.maven.settings.Server server)voidexecute()java.io.FilegetBasedir()java.lang.StringgetConnectionUrl()java.lang.StringgetExcludes()ScmFileSetgetFileSet()java.lang.StringgetIncludes()ScmManagergetScmManager()ScmRepositorygetScmRepository()ScmVersiongetScmVersion(java.lang.String versionType, java.lang.String version)java.io.FilegetWorkingDirectory()protected voidhandleExcludesIncludesAfterCheckoutAndExport(java.io.File checkoutDirectory)private voidloadInfosFromSettings(ScmProviderRepositoryWithHost repo)Load username password from settings if user has not set them in JVM properties.protected voidsetConnectionType(java.lang.String connectionType)voidsetConnectionUrl(java.lang.String connectionUrl)voidsetExcludes(java.lang.String excludes)voidsetIncludes(java.lang.String includes)voidsetWorkingDirectory(java.io.File workingDirectory)
-
-
-
Field Detail
-
VERSION_TYPE_BRANCH
protected static final java.lang.String VERSION_TYPE_BRANCH
- See Also:
- Constant Field Values
-
VERSION_TYPE_REVISION
protected static final java.lang.String VERSION_TYPE_REVISION
- See Also:
- Constant Field Values
-
VERSION_TYPE_TAG
protected static final java.lang.String VERSION_TYPE_TAG
- See Also:
- Constant Field Values
-
VALID_VERSION_TYPES
protected static final java.lang.String[] VALID_VERSION_TYPES
-
connectionUrl
@Parameter(property="connectionUrl", defaultValue="${project.scm.connection}") private java.lang.String connectionUrlThe SCM connection URL.
-
developerConnectionUrl
@Parameter(property="developerConnectionUrl", defaultValue="${project.scm.developerConnection}") private java.lang.String developerConnectionUrlThe SCM connection URL for developers.
-
connectionType
@Parameter(property="connectionType", defaultValue="connection") private java.lang.String connectionTypeThe type of connection to use (connection or developerConnection).
-
workingDirectory
@Parameter(property="workingDirectory") private java.io.File workingDirectory
The working directory.
-
username
@Parameter(property="username") private java.lang.String username
The user name.- See Also:
- Authentication
-
password
@Parameter(property="password") private java.lang.String password
The user password.- See Also:
- Authentication
-
privateKey
@Parameter(property="privateKey") private java.lang.String privateKey
The private key.- See Also:
- Authentication
-
passphrase
@Parameter(property="passphrase") private java.lang.String passphrase
The passphrase.- See Also:
- Authentication
-
serverId
@Parameter(property="project.scm.id") private java.lang.String serverId
The server id of the server which provides the credentials for the SCM in the settings.xml file. If not set the default lookup uses the SCM URL to construct the server id like this:server-id=scm-host[":"scm-port].Currently the POM does not allow to specify a server id for the SCM section.
Explicit authentication information provided via
username,passwordorprivateKeywill take precedence.- Since:
- 2.2.0
- See Also:
- Authentication
-
tagBase
@Parameter(property="tagBase") private java.lang.String tagBase
The url of tags base directory (used by svn protocol). It is not necessary to set it if you use the standard svn layout (branches/tags/trunk).
-
includes
@Parameter(property="includes") private java.lang.String includes
Comma separated list of includes file pattern.
-
excludes
@Parameter(property="excludes") private java.lang.String excludes
Comma separated list of excludes file pattern.
-
basedir
@Parameter(property="basedir", required=true) private java.io.File basedirThe base directory.
-
settings
@Parameter(defaultValue="${settings}", readonly=true) private org.apache.maven.settings.Settings settings
-
systemProperties
@Parameter private java.util.Properties systemProperties
List of System properties to set before executing the SCM command.
-
providerImplementations
@Parameter private java.util.Map<java.lang.String,java.lang.String> providerImplementations
List of remapped provider implementations. Allows to bind a different implementation than the default one to a provider id. The key is the remapped provider id, the value is the default provider id the implementation is bound to.- See Also:
- Supported SCMs
-
pushChanges
@Parameter(property="pushChanges", defaultValue="true") private boolean pushChangesShould distributed changes be pushed to the central repository? For many distributed SCMs like Git, a change like a commit is only stored in your local copy of the repository. Pushing the change allows your to more easily share it with other users.- Since:
- 1.4
-
workItem
@Parameter(property="workItem") @Deprecated private java.lang.String workItem
Deprecated.A workItem for SCMs like RTC, TFS etc, that may require additional information to perform a pushChange operation.- Since:
- 1.9.5
-
manager
private final ScmManager manager
-
settingsDecrypter
private final org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter
-
-
Constructor Detail
-
AbstractScmMojo
protected AbstractScmMojo(ScmManager manager, org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter)
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
setConnectionType
protected void setConnectionType(java.lang.String connectionType)
-
getConnectionUrl
public java.lang.String getConnectionUrl()
-
setConnectionUrl
public void setConnectionUrl(java.lang.String connectionUrl)
-
getWorkingDirectory
public java.io.File getWorkingDirectory()
-
getBasedir
public java.io.File getBasedir()
-
setWorkingDirectory
public void setWorkingDirectory(java.io.File workingDirectory)
-
getScmManager
public ScmManager getScmManager()
-
getFileSet
public ScmFileSet getFileSet() throws java.io.IOException
- Throws:
java.io.IOException
-
getScmRepository
public ScmRepository getScmRepository() throws ScmException
- Throws:
ScmException
-
loadInfosFromSettings
private void loadInfosFromSettings(ScmProviderRepositoryWithHost repo)
Load username password from settings if user has not set them in JVM properties.- Parameters:
repo- not null
-
decrypt
private org.apache.maven.settings.Server decrypt(org.apache.maven.settings.Server server)
-
checkResult
public void checkResult(ScmResult result) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getIncludes
public java.lang.String getIncludes()
-
setIncludes
public void setIncludes(java.lang.String includes)
-
getExcludes
public java.lang.String getExcludes()
-
setExcludes
public void setExcludes(java.lang.String excludes)
-
getScmVersion
public ScmVersion getScmVersion(java.lang.String versionType, java.lang.String version) throws org.apache.maven.plugin.MojoExecutionException
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
handleExcludesIncludesAfterCheckoutAndExport
protected void handleExcludesIncludesAfterCheckoutAndExport(java.io.File checkoutDirectory) throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
-