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  java.io.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(java.util.Set excludes)
          Build the package in an exploded format.
protected  void buildSpecificPackaging(java.util.Set excludes)
          Perform any packaging specific to this type.
 java.lang.String[] getAlternateDeploymentDescriptorFilenames()
          If no deployment descriptor filesnames are found, check for the existence of alternates before failing.
 java.lang.String getArchiveName()
           
abstract  java.lang.String getArtifactType()
          Get the type of the artifact.
abstract  java.lang.String getDeploymentDescriptorFilename()
          Get the name of the deployment descriptor file.
 java.io.File getOutputDirectory()
           
 java.io.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 java.io.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 java.io.File getPackagingDirectory()
Returns:
the packaging directory

getDeploymentDescriptorFilename

public abstract java.lang.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 java.lang.String getArtifactType()
Get the type of the artifact.

Returns:
The type of the generated artifact.

getAlternateDeploymentDescriptorFilenames

public java.lang.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 java.io.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(java.util.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(java.util.Set excludes)
                               throws org.apache.maven.plugin.MojoExecutionException,
                                      org.apache.maven.plugin.MojoFailureException,
                                      java.io.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.
java.io.IOException - For exceptions during IO operations.

getArchiveName

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

performPackaging

protected void performPackaging()
                         throws java.io.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:
java.io.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-2009. All Rights Reserved.