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:
ContextEnabled, Mojo
Direct Known Subclasses:
AopMojo, ESBMojo, HarMojo, ParMojo, SarMojo, SpringMojo

public abstract class AbstractPackagingMojo
extends AbstractMojo

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


Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractPackagingMojo()
           
 
Method Summary
 void buildExplodedPackaging()
          Build the package in an exploded format.
 void buildExplodedPackaging(Set excludes)
          Build the package in an exploded format.
protected  void buildSpecificPackaging(Set excludes)
          Perform any packaging specific to this type.
 void execute()
          Main execution for the goal.
 String getArchiveName()
           
abstract  String getArtifactType()
          Get the type of the artifact.
 File getClassesDirectory()
           
abstract  File getDeploymentDescriptor()
          Get the deployment descriptor file.
 File getDeploymentDescriptorDest()
           
 String getDeploymentDescriptorDestName()
           
 File getLibDirectory()
           
 File getOutputDirectory()
           
 File getPackagingDirectory()
           
 MavenProject getProject()
           
 boolean isExplodedOnly()
           
protected  void packageClasses()
          Routine that includes the specified artifact into the exploded packaging.
protected  void packageLib(Artifact artifact, String name)
          Routine that includes the specified artifact into the exploded packaging.
protected  void packageResources()
          Routine that packages resources not handled by default resource handling.
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
 

Constructor Detail

AbstractPackagingMojo

public AbstractPackagingMojo()
Method Detail

isExplodedOnly

public boolean isExplodedOnly()
Returns:
Whether only the exploded format should be created

getProject

public MavenProject getProject()
Returns:
the maven project

getPackagingDirectory

public File getPackagingDirectory()
Returns:
the packaging directory

getClassesDirectory

public File getClassesDirectory()
Returns:
the packaging directory

getLibDirectory

public File getLibDirectory()
Returns:
the lib directory

getDeploymentDescriptor

public abstract File getDeploymentDescriptor()
Get the deployment descriptor file. Subclasses may override this method to provide a different name for their type of archive packaging.

Returns:
deployment descriptor File

getArtifactType

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

Returns:
The type of the generated artifact

getOutputDirectory

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

buildExplodedPackaging

public void buildExplodedPackaging()
                            throws MojoExecutionException
Build the package in an exploded format.

Throws:
MojoExecutionException - if an error occurred
MojoFailureException - if an error occurred

buildExplodedPackaging

public void buildExplodedPackaging(Set excludes)
                            throws MojoExecutionException
Build the package in an exploded format.

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

buildSpecificPackaging

protected void buildSpecificPackaging(Set excludes)
                               throws MojoExecutionException
Perform any packaging specific to this type.

Parameters:
excludes - The exclude list.
Throws:
MojoExecutionException - For plugin failures.
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 MojoExecutionException
Generates the packaged archive.

Throws:
MojoExecutionException - if there is a problem

getDeploymentDescriptorDestName

public String getDeploymentDescriptorDestName()

getDeploymentDescriptorDest

public File getDeploymentDescriptorDest()

execute

public void execute()
             throws MojoExecutionException
Main execution for the goal.

Throws:
MojoExecutionException - if an error occurred while building the webapp

packageResources

protected void packageResources()
                         throws Exception
Routine that packages resources not handled by default resource handling.

Throws:
Exception

packageLib

protected void packageLib(Artifact artifact,
                          String name)
                   throws Exception
Routine that includes the specified artifact into the exploded packaging.

Parameters:
artifact -
name -
Throws:
Exception

packageClasses

protected void packageClasses()
                       throws Exception
Routine that includes the specified artifact into the exploded packaging.

Throws:
Exception


Copyright © 2006-2011 Codehaus. All Rights Reserved.