org.codehaus.mojo.jboss
Class AbstractJBossServerMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.jboss.AbstractJBossServerMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ConfigureJBossMojo, HardDeployMojo, HardUnDeployMojo, StartMojo, StopMojo

public abstract class AbstractJBossServerMojo
extends org.apache.maven.plugin.AbstractMojo

This class provides the general functionality for interacting with a local JBoss server.


Field Summary
protected  File jbossHome
          The location of JBoss Home.
protected  String serverName
          The name of the configuration profile to use when starting the server.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractJBossServerMojo()
           
 
Method Summary
protected  void checkConfig()
          Check that JBOSS_HOME is correctly configured.
 String getPassword()
          Get the password configured in Maven settings.xml
 String getUsername()
          Get the username configured in the Maven settings.xml
protected  void launch(String commandName, String options)
          Call the JBoss startup or shutdown script.
protected  void launchUnixScript(File commandFile, String options)
          Launch a Unix shell script
protected  void launchWindowsBatch(File commandFile, String options)
          Launch a batch file in Windows
 
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

jbossHome

protected File jbossHome
The location of JBoss Home. This is a required configuration parameter (unless JBOSS_HOME is set).

Is defined by:
expression:
${env.JBOSS_HOME}
Is required.

serverName

protected String serverName
The name of the configuration profile to use when starting the server. This might be something like "all", "default", or "minimal".

Is defined by:
expression:
${jboss.serverName}
default-value:
default
Constructor Detail

AbstractJBossServerMojo

public AbstractJBossServerMojo()
Method Detail

checkConfig

protected void checkConfig()
                    throws org.apache.maven.plugin.MojoExecutionException
Check that JBOSS_HOME is correctly configured.

Throws:
org.apache.maven.plugin.MojoExecutionException

launch

protected void launch(String commandName,
                      String options)
               throws org.apache.maven.plugin.MojoExecutionException
Call the JBoss startup or shutdown script.

Parameters:
commandName - - The name of the command to run
options - - Space separated command line parameters
Throws:
org.apache.maven.plugin.MojoExecutionException

launchWindowsBatch

protected void launchWindowsBatch(File commandFile,
                                  String options)
                           throws IOException
Launch a batch file in Windows

Parameters:
commandFile -
options - - Space separated command line parameters
Throws:
IOException

launchUnixScript

protected void launchUnixScript(File commandFile,
                                String options)
                         throws IOException
Launch a Unix shell script

Parameters:
commandFile -
options - - Space separated command line parameters
Throws:
IOException

getUsername

public String getUsername()
                   throws org.apache.maven.plugin.MojoExecutionException
Get the username configured in the Maven settings.xml

Returns:
username
Throws:
org.apache.maven.plugin.MojoExecutionException - if the server is not configured in settings.xml

getPassword

public String getPassword()
                   throws org.apache.maven.plugin.MojoExecutionException
Get the password configured in Maven settings.xml

Returns:
The password from settings.xml
Throws:
org.apache.maven.plugin.MojoExecutionException - if the server is not configured in settings.xml


Copyright © 2005-2012 Codehaus. All Rights Reserved.