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
FieldsModifier and TypeFieldDescriptionprivate FileThe base directory.private StringThe type of connection to use (connection or developerConnection).private StringThe SCM connection URL.private StringThe SCM connection URL for developers.private StringComma separated list of excludes file pattern.private StringComma separated list of includes file pattern.private final ScmManagerprivate StringThe passphrase.private StringThe user password.private StringThe private key.List of remapped provider implementations.private booleanShould 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 StringThe server id of the server which provides the credentials for the SCM in the settings.xml file.private org.apache.maven.settings.Settingsprivate final org.apache.maven.settings.crypto.SettingsDecrypterprivate PropertiesList of System properties to set before executing the SCM command.private StringThe url of tags base directory (used by svn protocol).private StringThe user name.protected static final String[]protected static final Stringprotected static final Stringprotected static final Stringprivate FileThe working directory.private StringDeprecated.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractScmMojo(ScmManager manager, org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckResult(ScmResult result) private org.apache.maven.settings.Serverdecrypt(org.apache.maven.settings.Server server) voidexecute()getScmVersion(String versionType, String version) protected voidhandleExcludesIncludesAfterCheckoutAndExport(File checkoutDirectory) private voidLoad username password from settings if user has not set them in JVM properties.protected voidsetConnectionType(String connectionType) voidsetConnectionUrl(String connectionUrl) voidsetExcludes(String excludes) voidsetIncludes(String includes) voidsetWorkingDirectory(File workingDirectory) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
VERSION_TYPE_BRANCH
- See Also:
-
VERSION_TYPE_REVISION
- See Also:
-
VERSION_TYPE_TAG
- See Also:
-
VALID_VERSION_TYPES
-
connectionUrl
@Parameter(property="connectionUrl", defaultValue="${project.scm.connection}") private String connectionUrlThe SCM connection URL. -
developerConnectionUrl
@Parameter(property="developerConnectionUrl", defaultValue="${project.scm.developerConnection}") private String developerConnectionUrlThe SCM connection URL for developers. -
connectionType
The type of connection to use (connection or developerConnection). -
workingDirectory
The working directory. -
username
-
password
-
privateKey
-
passphrase
-
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:
-
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
Comma separated list of includes file pattern. -
excludes
Comma separated list of excludes file pattern. -
basedir
The base directory. -
settings
@Parameter(defaultValue="${settings}", readonly=true) private org.apache.maven.settings.Settings settings -
systemProperties
List of System properties to set before executing the SCM command. -
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:
-
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
Deprecated.A workItem for SCMs like RTC, TFS etc, that may require additional information to perform a pushChange operation.- Since:
- 1.9.5
-
manager
-
settingsDecrypter
private final org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter
-
-
Constructor Details
-
AbstractScmMojo
protected AbstractScmMojo(ScmManager manager, org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter)
-
-
Method Details
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException- Throws:
org.apache.maven.plugin.MojoExecutionException
-
setConnectionType
-
getConnectionUrl
-
setConnectionUrl
-
getWorkingDirectory
-
getBasedir
-
setWorkingDirectory
-
getScmManager
-
getFileSet
- Throws:
IOException
-
getScmRepository
- Throws:
ScmException
-
loadInfosFromSettings
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
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
getIncludes
-
setIncludes
-
getExcludes
-
setExcludes
-
getScmVersion
public ScmVersion getScmVersion(String versionType, String version) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-
handleExcludesIncludesAfterCheckoutAndExport
protected void handleExcludesIncludesAfterCheckoutAndExport(File checkoutDirectory) throws org.apache.maven.plugin.MojoExecutionException - Throws:
org.apache.maven.plugin.MojoExecutionException
-