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:
ContextEnabled, Mojo
Direct Known Subclasses:
CleanMojo, DeployMojo, GenerateDeploymentPackageMojo

public abstract class AbstractDeployitMojo
extends AbstractMojo

Provides common code for deployit mojos

Author:
Benoit Moussaud

Field Summary
protected  String artifactId
           
protected  String[] commands
          Extra CLI commands.
static String DEFAULT_DEPLOYMENT
           
static String DEFAULT_ENVIRONMENT
           
protected  List<DeployableArtifactItem> deployableArtifacts
          Additional deployables artifacts
protected  List<ConfigurationItem> environment
          List of ConfigurationItem in the target environment.
protected  boolean generateManifestOnly
          Only the Manifest file will be generate.
protected  File jeeArtifact
          The main JEE artifact to deploy
protected  List<ConfigurationItem> mappings
          List of the Mapping
protected  List<ConfigurationItem> middlewareResources
          Additional resources such as Database, Apache plugin configuration, JMS Queues...
protected  File outputDirectory
           
protected  String packaging
           
protected  org.apache.maven.project.MavenProject project
          The maven project.
protected  boolean testmode
          Activate the test mode, the steps are not executed.
protected  String version
           
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractDeployitMojo()
           
 
Method Summary
protected  void deployit()
           
 String getArtifactId()
           
 String[] getCommands()
           
 List<ConfigurationItem> getEnvironment()
           
protected  com.xebia.ad.cli.Interpreter getInterpreter()
           
 File getJeeArtifact()
           
 List<ConfigurationItem> getMappings()
           
 List<ConfigurationItem> getMiddlewareResources()
           
 File getOutputDirectory()
           
 String getPackaging()
           
 int getPort()
           
 org.apache.maven.project.MavenProject getProject()
           
protected  DeployableArtifactItem getRealDeployableArtifact(Artifact artifact)
           
protected  DeployableArtifactItem getRealDeployableArtifact(DeployableArtifactItem item)
           
 String getScript()
           
 String getVersion()
           
protected  void interpret(List<String> cliCommands)
           
protected  void interpret(String line)
           
 boolean isTestmode()
           
 void setArtifactId(String artifactId)
           
 void setCommands(String[] commands)
           
 void setEnvironment(List<ConfigurationItem> environment)
           
 void setJeeArtifact(File jeeArtifact)
           
 void setMappings(List<ConfigurationItem> mappings)
           
 void setMiddlewareResources(List<ConfigurationItem> middlewareResources)
           
 void setOutputDirectory(File outputDirectory)
           
 void setPackaging(String packaging)
           
 void setPort(int port)
           
 void setProject(org.apache.maven.project.MavenProject project)
           
 void setTestmode(boolean testmode)
           
 void setVersion(String version)
           
protected  void startServer()
           
static void stopServer()
           
 
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.

Is defined by:
expression:
${project}
Is required.

outputDirectory

protected File outputDirectory
Is defined by:
default-value:
${project.build.directory}
Is readonly.
Is required.

artifactId

protected String artifactId
Is defined by:
default-value:
${project.artifactId}
Is readonly.
Is required.

version

protected String version
Is defined by:
default-value:
${project.version}
Is readonly.
Is required.

packaging

protected String packaging
Is defined by:
default-value:
${project.packaging}
Is readonly.
Is required.

testmode

protected boolean testmode
Activate the test mode, the steps are not executed.

Is defined by:
default-value:
false

jeeArtifact

protected File jeeArtifact
The main JEE artifact to deploy

Is defined by:
default-value:
${project.build.directory}/${project.build.finalName}.${project.packaging}
Is required.

commands

protected String[] commands
Extra CLI commands.

Is defined by:

middlewareResources

protected List<ConfigurationItem> middlewareResources
Additional resources such as Database, Apache plugin configuration, JMS Queues...

Is defined by:

mappings

protected List<ConfigurationItem> mappings
List of the Mapping

Is defined by:

environment

protected List<ConfigurationItem> environment
List of ConfigurationItem in the target environment.

Is defined by:

deployableArtifacts

protected List<DeployableArtifactItem> deployableArtifacts
Additional deployables artifacts

Is defined by:

generateManifestOnly

protected boolean generateManifestOnly
Only the Manifest file will be generate. Do not copy files when generating Deployment package

Is defined by:
default-value:
false

DEFAULT_ENVIRONMENT

public static final String DEFAULT_ENVIRONMENT
See Also:
Constant Field Values

DEFAULT_DEPLOYMENT

public static final String DEFAULT_DEPLOYMENT
See Also:
Constant Field Values
Constructor Detail

AbstractDeployitMojo

public AbstractDeployitMojo()
Method Detail

startServer

protected void startServer()

stopServer

public static void stopServer()

interpret

protected void interpret(String line)
                  throws MojoExecutionException
Throws:
MojoExecutionException

interpret

protected void interpret(List<String> cliCommands)
                  throws MojoExecutionException
Throws:
MojoExecutionException

getInterpreter

protected com.xebia.ad.cli.Interpreter getInterpreter()
                                               throws MojoExecutionException
Throws:
MojoExecutionException

deployit

protected void deployit()
                 throws MojoExecutionException
Throws:
MojoExecutionException

getProject

public org.apache.maven.project.MavenProject getProject()

setProject

public void setProject(org.apache.maven.project.MavenProject project)

getOutputDirectory

public File getOutputDirectory()

setOutputDirectory

public void setOutputDirectory(File outputDirectory)

getArtifactId

public String getArtifactId()

setArtifactId

public void setArtifactId(String artifactId)

getVersion

public String getVersion()

setVersion

public void setVersion(String version)

getPackaging

public String getPackaging()

setPackaging

public void setPackaging(String packaging)

isTestmode

public boolean isTestmode()

setTestmode

public void setTestmode(boolean testmode)

getJeeArtifact

public File getJeeArtifact()

setJeeArtifact

public void setJeeArtifact(File jeeArtifact)

getPort

public int getPort()

setPort

public void setPort(int port)

getCommands

public String[] getCommands()

setCommands

public void setCommands(String[] commands)

getMiddlewareResources

public List<ConfigurationItem> getMiddlewareResources()

setMiddlewareResources

public void setMiddlewareResources(List<ConfigurationItem> middlewareResources)

getMappings

public List<ConfigurationItem> getMappings()

setMappings

public void setMappings(List<ConfigurationItem> mappings)

getEnvironment

public List<ConfigurationItem> getEnvironment()

setEnvironment

public void setEnvironment(List<ConfigurationItem> environment)

getScript

public String getScript()

getRealDeployableArtifact

protected DeployableArtifactItem getRealDeployableArtifact(DeployableArtifactItem item)
                                                    throws MojoExecutionException
Throws:
MojoExecutionException

getRealDeployableArtifact

protected DeployableArtifactItem getRealDeployableArtifact(Artifact artifact)
                                                    throws MojoExecutionException
Throws:
MojoExecutionException


Copyright © 2010. All Rights Reserved.