org.codehaus.mojo.jboss.packaging
Class AbstractPackagingMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.jboss.packaging.AbstractPackagingMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractESBMojo, AbstractSarPackagingMojo, AbstractSpringPackagingMojo

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

Abstract super class for all the packaging mojos. This class contains the logic for actually building the packaging types.


Field Summary
protected  File deploymentDescriptorFile
          The location of the jboss deployment descriptor file (e.g., jboss-service.xml, jboss-spring.xml, etc).
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractPackagingMojo()
           
 
Method Summary
 void buildExplodedPackaging()
           
 void buildExplodedPackaging(Set excludes)
          Build the package in an exploded format.
protected  void buildSpecificPackaging(Set excludes)
          Perform any packaging specific to this type.
 String[] getAlternateDeploymentDescriptorFilenames()
          If no deployment descriptor filesnames are found, check for the existence of alternates before failing.
 String getArchiveName()
           
abstract  String getArtifactType()
          Get the type of the artifact.
abstract  String getDeploymentDescriptorFilename()
          Get the name of the deployment descriptor file.
 File getOutputDirectory()
           
 File getPackagingDirectory()
           
 org.apache.maven.project.MavenProject getProject()
           
protected  void performPackaging()
          Generates the packaged archive.
 
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

deploymentDescriptorFile

protected File deploymentDescriptorFile
The location of the jboss deployment descriptor file (e.g., jboss-service.xml, jboss-spring.xml, etc). If it is present in the META-INF directory in src/main/resources with that name then it will automatically be included. Otherwise this parameter must be set.

Constructor Detail

AbstractPackagingMojo

public AbstractPackagingMojo()
Method Detail

getProject

public org.apache.maven.project.MavenProject getProject()
Returns:
the maven project

getPackagingDirectory

public File getPackagingDirectory()
Returns:
the packaging directory

getDeploymentDescriptorFilename

public abstract String getDeploymentDescriptorFilename()
Get the name of the deployment descriptor file. Sublcasses must override this method and provide the proper name for their type of archive packaging

Returns:
deployment descriptor file name, sans path

getArtifactType

public abstract String getArtifactType()
Get the type of the artifact.

Returns:
The type of the generated artifact.

getAlternateDeploymentDescriptorFilenames

public String[] getAlternateDeploymentDescriptorFilenames()
If no deployment descriptor filesnames are found, check for the existence of alternates before failing. Subclasses are not required to override this method.

Returns:
alternate deployment descriptor filenames

getOutputDirectory

public File getOutputDirectory()
Returns:
The directory to write the archive

buildExplodedPackaging

public void buildExplodedPackaging()
                            throws org.apache.maven.plugin.MojoExecutionException,
                                   org.apache.maven.plugin.MojoFailureException
Throws:
org.apache.maven.plugin.MojoExecutionException - if an error occurred
org.apache.maven.plugin.MojoFailureException - if an error occurred

buildExplodedPackaging

public void buildExplodedPackaging(Set excludes)
                            throws org.apache.maven.plugin.MojoExecutionException,
                                   org.apache.maven.plugin.MojoFailureException
Build the package in an exploded format.

Parameters:
excludes - File patterns to exclude from the packaging.
Throws:
org.apache.maven.plugin.MojoExecutionException - if an error occurred
org.apache.maven.plugin.MojoFailureException - if an error occurred

buildSpecificPackaging

protected void buildSpecificPackaging(Set excludes)
                               throws org.apache.maven.plugin.MojoExecutionException,
                                      org.apache.maven.plugin.MojoFailureException,
                                      IOException
Perform any packaging specific to this type.

Parameters:
excludes - The exclude list.
Throws:
org.apache.maven.plugin.MojoExecutionException - For plugin failures.
org.apache.maven.plugin.MojoFailureException - For unexpected plugin failures.
IOException - For exceptions during IO operations.

getArchiveName

public String getArchiveName()
Returns:
The name of the archive

performPackaging

protected void performPackaging()
                         throws IOException,
                                org.codehaus.plexus.archiver.ArchiverException,
                                org.codehaus.plexus.archiver.jar.ManifestException,
                                org.apache.maven.artifact.DependencyResolutionRequiredException,
                                org.apache.maven.plugin.MojoExecutionException,
                                org.apache.maven.plugin.MojoFailureException
Generates the packaged archive.

Throws:
IOException - if there is a problem
org.codehaus.plexus.archiver.ArchiverException - if there is a problem
org.codehaus.plexus.archiver.jar.ManifestException - if there is a problem
org.apache.maven.artifact.DependencyResolutionRequiredException - if there is a problem
org.apache.maven.plugin.MojoExecutionException - if there is a problem
org.apache.maven.plugin.MojoFailureException - if there is a problem


Copyright © 2006-2011 Codehaus. All Rights Reserved.