com.xebialabs.deployit.maven
Class AbstractDeployitMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by 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
protected  String applicationName
          The name of the application for this DAR file, i.e.
protected  boolean cancelTaskOnError
          When a task falls in error, it is cancelled.
protected  com.xebialabs.deployit.booter.remote.DeployitCommunicator communicator
           
protected  boolean deletePreviouslyDeployedDar
          Delete the previous deployed dar.
protected  List<MavenDeployable> deployables
          List of the deployables, including artifacts or middleware resource specification (eg Datasource)
protected  List<MavenDeployed> deployeds
          List of the deployeds: extensions or complete if you use explicitDeployeds options
protected  List<XmlFragment> deploymentPackageProperties
          List of package-level properties
protected  List<MavenContainer> environment
          List of container in the target environment, if you want to create the environment through the Maven plugin.
protected  String environmentId
          Id of the environment used for the deployment.
protected  boolean explicitDeployeds
          With explicitDeployeds true, the deployed are not generated but fully loaded from the plugin configuration.
protected  boolean failIfNoStepsAreGenerated
          If a deployments leads no steps, fail the build.
protected  boolean generateDeployedOnUpgrade
          Flag controlling whether, during the upgrade operation, the Deployed objects should generated (like an initial deployment) or reused.
protected  String mainArtifactName
          If the project packaging is ear or war, sets the CI-Name property for the EAR/WAR artifact in the DAR.
protected  String orchestrator
          Set the orchestrator used during the deployment.
protected  String password
          Deployit password.
protected  int port
          Deployit Listen port.
protected  org.apache.maven.project.MavenProject project
          The maven project.
protected  boolean secured
          If true the communication with the deployit server is secured (https).
protected  String serverAddress
          Deployit server address
protected  boolean skipMode
          Activate the skip mode: generate the plan, skip all the steps, validate the task
protected  boolean testMode
          Activate the test mode, generate the plan, display all the steps, validate the task
protected  boolean timestampedVersion
          Use this attribute to add a timestamp to the version of the deployit package.
protected  String username
          Deployit username.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractDeployitMojo()
           
 
Method Summary
protected  void boot()
          Boots REST API
 List<MavenDeployable> getDeployables()
           
protected  DeploymentHelper getDeploymentHelper()
           
 List<XmlFragment> getDeploymentPackageProperties()
           
protected  String getPassword()
           
 org.apache.maven.project.MavenProject getProject()
           
protected  String getUsername()
           
protected  boolean hasDeployeds()
           
 void setDeletePreviouslyDeployedDar(boolean deletePreviouslyDeployedDar)
           
 void setDeploymentHelper(DeploymentHelper deploymentHelper)
          For testing purposes
 void setEnvironment(List<MavenContainer> environment)
           
 void setEnvironmentId(String environmentId)
           
 void setExplicitDeployeds(boolean explicitDeployeds)
           
 void setGenerateDeployedOnUpgrade(boolean generateDeployedOnUpgrade)
           
 void setMainArtifactName(String mainArtifactName)
           
 void setPort(int port)
           
 void setProject(org.apache.maven.project.MavenProject project)
           
 void setTestMode(boolean testMode)
           
protected  void shutdown()
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Field Detail

project

protected org.apache.maven.project.MavenProject project
The maven project.


applicationName

protected String applicationName
The name of the application for this DAR file, i.e. the value of the CI-Application attribute.

Since:
3.9.0

mainArtifactName

protected String mainArtifactName
If the project packaging is ear or war, sets the CI-Name property for the EAR/WAR artifact in the DAR.


skipMode

protected boolean skipMode
Activate the skip mode: generate the plan, skip all the steps, validate the task


orchestrator

protected String orchestrator
Set the orchestrator used during the deployment.

Since:
3.7.0

testMode

protected boolean testMode
Activate the test mode, generate the plan, display all the steps, validate the task


failIfNoStepsAreGenerated

protected boolean failIfNoStepsAreGenerated
If a deployments leads no steps, fail the build.


serverAddress

protected String serverAddress
Deployit server address


port

protected int port
Deployit Listen port. The default value of -1 will automatically use 4516 for HTTP and 4517 for HTTPS connections.


username

protected String username
Deployit username. See FAQ for more details


password

protected String password
Deployit password. See FAQ for more details


secured

protected boolean secured
If true the communication with the deployit server is secured (https).


environmentId

protected String environmentId
Id of the environment used for the deployment.


deploymentPackageProperties

protected List<XmlFragment> deploymentPackageProperties
List of package-level properties


deployeds

protected List<MavenDeployed> deployeds
List of the deployeds: extensions or complete if you use explicitDeployeds options


explicitDeployeds

protected boolean explicitDeployeds
With explicitDeployeds true, the deployed are not generated but fully loaded from the plugin configuration.


deployables

protected List<MavenDeployable> deployables
List of the deployables, including artifacts or middleware resource specification (eg Datasource)


environment

protected List<MavenContainer> environment
List of container in the target environment, if you want to create the environment through the Maven plugin.


timestampedVersion

protected boolean timestampedVersion
Use 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.


deletePreviouslyDeployedDar

protected boolean deletePreviouslyDeployedDar
Delete the previous deployed dar. Useful if you work with the SNAPSHOT versions you don't want to keep in your repository.


generateDeployedOnUpgrade

protected boolean generateDeployedOnUpgrade
Flag 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 cancelTaskOnError
When 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
Constructor Detail

AbstractDeployitMojo

public AbstractDeployitMojo()
Method Detail

getUsername

protected String getUsername()

getPassword

protected String 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

public void setEnvironmentId(String environmentId)

setEnvironment

public void setEnvironment(List<MavenContainer> environment)

setMainArtifactName

public void setMainArtifactName(String mainArtifactName)

setDeletePreviouslyDeployedDar

public void setDeletePreviouslyDeployedDar(boolean deletePreviouslyDeployedDar)

setExplicitDeployeds

public void setExplicitDeployeds(boolean explicitDeployeds)

setPort

public void setPort(int port)

setDeploymentHelper

public void setDeploymentHelper(DeploymentHelper deploymentHelper)
For testing purposes

Parameters:
deploymentHelper - deployment helper injection for testing

getDeploymentHelper

protected DeploymentHelper getDeploymentHelper()

setTestMode

public void setTestMode(boolean testMode)

hasDeployeds

protected boolean hasDeployeds()

setGenerateDeployedOnUpgrade

public void setGenerateDeployedOnUpgrade(boolean generateDeployedOnUpgrade)

getDeployables

public List<MavenDeployable> getDeployables()

getDeploymentPackageProperties

public List<XmlFragment> getDeploymentPackageProperties()


Copyright © 2014. All rights reserved.