Package com.xebialabs.deployit.maven
Class AbstractDeployitMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
com.xebialabs.deployit.maven.AbstractDeployitMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
CleanMojo,DeployMojo,GenerateDeploymentPackageMojo,ImportDarMojo
public abstract class AbstractDeployitMojo
extends org.apache.maven.plugin.AbstractMojo
Provides common code for deployit mojos
- Author:
- Benoit Moussaud
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe name of the application for this DAR file, i.e. the value of theCI-Applicationattribute.protected booleanWhen a task falls in error, it is cancelled.protected com.xebialabs.deployit.booter.remote.DeployitCommunicatorprotected booleanDelete the previous deployed dar.protected List<MavenDeployable>List of the deployables, including artifacts or middleware resource specification (eg Datasource)protected List<MavenDeployed>List of the deployeds: extensions or complete if you use explicitDeployeds optionsprotected List<XmlFragment>List of package-level propertiesprotected List<MavenContainer>List of container in the target environment, if you want to create the environment through the Maven plugin.protected StringId of the environment used for the deployment.protected booleanWith explicitDeployeds true, the deployed are not generated but fully loaded from the plugin configuration.protected booleanIf a deployments leads no steps, fail the build.protected booleanFlag controlling whether, during the upgrade operation, the Deployed objects should generated (like an initial deployment) or reused.protected StringIf the project packaging isearorwar, sets theCI-Nameproperty for the EAR/WAR artifact in the DAR.protected StringSet the orchestrator used during the deployment.protected StringPackage version to be used instead of the automatically generated version.protected StringDeployit password.protected intDeployit Listen port.protected org.apache.maven.project.MavenProjectThe maven project.protected List<org.apache.maven.project.MavenProject>All maven projects in the reactor.protected booleanIf true the communication with the deployit server is secured (https).protected StringDeployit server addressprotected booleanActivate the skip mode: generate the plan, skip all the steps, validate the taskprotected intSocket timeout in milliseconds.protected booleanActivate the test mode, generate the plan, display all the steps, validate the taskprotected booleanUse this attribute to add a timestamp to the version of the deployit package.protected StringDeployit username.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidboot()Boots REST APIorg.apache.maven.wagon.authentication.AuthenticationInfoprotected DeploymentHelperprotected Stringorg.apache.maven.project.MavenProjectorg.apache.maven.settings.Settingsorg.apache.maven.settings.crypto.SettingsDecrypterprotected Stringprotected ServerVersionCompatibilityprotected booleanbooleanvoidsetDeletePreviouslyDeployedDar(boolean deletePreviouslyDeployedDar) voidsetDeploymentHelper(DeploymentHelper deploymentHelper) For testing purposesvoidsetEnvironment(List<MavenContainer> environment) voidsetEnvironmentId(String environmentId) voidsetExplicitDeployeds(boolean explicitDeployeds) voidsetGenerateDeployedOnUpgrade(boolean generateDeployedOnUpgrade) voidsetMainArtifactName(String mainArtifactName) voidsetPackageVersion(String packageVersion) voidsetPort(int port) voidsetProject(org.apache.maven.project.MavenProject project) voidsetSettings(org.apache.maven.settings.Settings settings) voidsetSettingsDecrypter(org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter) voidsetTestMode(boolean testMode) voidsetTimestampedVersion(boolean timestampedVersion) voidsetVersionChecker(ServerVersionCompatibility versionChecker) protected voidshutdown()Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
project
protected org.apache.maven.project.MavenProject projectThe maven project. -
reactorProjects
All maven projects in the reactor. -
applicationName
The name of the application for this DAR file, i.e. the value of theCI-Applicationattribute.- Since:
- 3.9.0
-
mainArtifactName
If the project packaging isearorwar, sets theCI-Nameproperty for the EAR/WAR artifact in the DAR. -
skipMode
protected boolean skipModeActivate the skip mode: generate the plan, skip all the steps, validate the task -
orchestrator
Set the orchestrator used during the deployment.- Since:
- 3.7.0
-
testMode
protected boolean testModeActivate the test mode, generate the plan, display all the steps, validate the task -
failIfNoStepsAreGenerated
protected boolean failIfNoStepsAreGeneratedIf a deployments leads no steps, fail the build. -
serverAddress
Deployit server address -
port
protected int portDeployit Listen port. The default value of -1 will automatically use 4516 for HTTP and 4517 for HTTPS connections. -
username
Deployit username. See FAQ for more details -
password
Deployit password. See FAQ for more details -
secured
protected boolean securedIf true the communication with the deployit server is secured (https). -
environmentId
Id of the environment used for the deployment. -
deploymentPackageProperties
List of package-level properties -
deployeds
List of the deployeds: extensions or complete if you use explicitDeployeds options -
explicitDeployeds
protected boolean explicitDeployedsWith explicitDeployeds true, the deployed are not generated but fully loaded from the plugin configuration. -
deployables
List of the deployables, including artifacts or middleware resource specification (eg Datasource) -
environment
List of container in the target environment, if you want to create the environment through the Maven plugin. -
timestampedVersion
protected boolean timestampedVersionUse this attribute to add a timestamp to the version of the deployit package. by default,the SNAPSHOT versions are automatically timestamped. This flag is useful only if you want to timestamp non SNAPSHOT version. -
packageVersion
Package version to be used instead of the automatically generated version. -
deletePreviouslyDeployedDar
protected boolean deletePreviouslyDeployedDarDelete the previous deployed dar. Useful if you work with the SNAPSHOT versions you don't want to keep in your repository. -
generateDeployedOnUpgrade
protected boolean generateDeployedOnUpgradeFlag controlling whether, during the upgrade operation, the Deployed objects should generated (like an initial deployment) or reused. For security reasons, the default value is false but should be set to true to apply the modifications (new Ear, removed links) even during upgrade.- Since:
- 3.6.2
-
cancelTaskOnError
protected boolean cancelTaskOnErrorWhen a task falls in error, it is cancelled. Sometime it could be interesting to debug it using the UI or the CLI. When this flag is set to false, the task will be left as is.- Since:
- 3.6.2
-
communicator
protected com.xebialabs.deployit.booter.remote.DeployitCommunicator communicator -
socketTimeout
protected int socketTimeoutSocket timeout in milliseconds. Used when connection is made to XL Deploy server. The default value is 10 seconds.- Since:
- 4.5.2
-
-
Constructor Details
-
AbstractDeployitMojo
public AbstractDeployitMojo()
-
-
Method Details
-
getUsername
-
getPassword
-
boot
protected void boot()Boots REST API -
shutdown
protected void shutdown() -
setProject
public void setProject(org.apache.maven.project.MavenProject project) -
getProject
public org.apache.maven.project.MavenProject getProject() -
setEnvironmentId
-
setEnvironment
-
setMainArtifactName
-
setDeletePreviouslyDeployedDar
public void setDeletePreviouslyDeployedDar(boolean deletePreviouslyDeployedDar) -
setExplicitDeployeds
public void setExplicitDeployeds(boolean explicitDeployeds) -
setPort
public void setPort(int port) -
setDeploymentHelper
For testing purposes- Parameters:
deploymentHelper- deployment helper injection for testing
-
getDeploymentHelper
-
getAuthenticationInfo
-
setVersionChecker
-
getVersionChecker
-
setTestMode
public void setTestMode(boolean testMode) -
hasDeployeds
protected boolean hasDeployeds() -
setGenerateDeployedOnUpgrade
public void setGenerateDeployedOnUpgrade(boolean generateDeployedOnUpgrade) -
getDeployables
-
getDeploymentPackageProperties
-
getPackageVersion
-
setPackageVersion
-
isTimestampedVersion
public boolean isTimestampedVersion() -
setTimestampedVersion
public void setTimestampedVersion(boolean timestampedVersion) -
getSettings
public org.apache.maven.settings.Settings getSettings() -
setSettings
public void setSettings(org.apache.maven.settings.Settings settings) -
getSettingsDecrypter
public org.apache.maven.settings.crypto.SettingsDecrypter getSettingsDecrypter() -
setSettingsDecrypter
public void setSettingsDecrypter(org.apache.maven.settings.crypto.SettingsDecrypter settingsDecrypter)
-