org.apache.maven.plugin.war.packaging
Class WarProjectPackagingTask

java.lang.Object
  extended by org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask
      extended by org.apache.maven.plugin.war.packaging.WarProjectPackagingTask
All Implemented Interfaces:
WarPackagingTask

public class WarProjectPackagingTask
extends AbstractWarPackagingTask

Handles the project own resources, that is:

Version:
$Id: WarProjectPackagingTask.java 1390132 2012-09-25 21:02:10Z dennisl $
Author:
Stephane Nicoll

Field Summary
 
Fields inherited from class org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask
CLASSES_PATH, DEFAULT_INCLUDES, LIB_PATH, META_INF_PATH, WEB_INF_PATH
 
Constructor Summary
WarProjectPackagingTask(Resource[] webResources, File webXml, File containerConfigXml, Overlay currentProjectOverlay)
           
 
Method Summary
 void copyResources(WarPackagingContext context, Resource resource)
          Copies webapp webResources from the specified directory.
protected  void handeWebAppSourceDirectory(WarPackagingContext context)
          Handles the webapp sources.
protected  void handleArtifacts(WarPackagingContext context)
          Handles the webapp artifacts.
protected  void handleClassesDirectory(WarPackagingContext context)
          Handles the webapp classes.
protected  void handleDeploymentDescriptors(WarPackagingContext context, File webinfDir, File metainfDir)
          Handles the deployment descriptors, if specified.
protected  void handleWebResources(WarPackagingContext context)
          Handles the web resources.
 void performPackaging(WarPackagingContext context)
          Performs the packaging for the specified task.
 
Methods inherited from class org.apache.maven.plugin.war.packaging.AbstractWarPackagingTask
copyFile, copyFile, copyFiles, copyFiles, copyFilteredFile, doUnpack, getArtifactFinalName, getEncoding, getFilesToIncludes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WarProjectPackagingTask

public WarProjectPackagingTask(Resource[] webResources,
                               File webXml,
                               File containerConfigXml,
                               Overlay currentProjectOverlay)
Method Detail

performPackaging

public void performPackaging(WarPackagingContext context)
                      throws MojoExecutionException,
                             MojoFailureException
Description copied from interface: WarPackagingTask
Performs the packaging for the specified task.

The task is responsible to update the packaging context, namely with the files that have been copied.

Parameters:
context - the packaging context
Throws:
MojoExecutionException - if an error occurred
MojoFailureException - if the project configuration is invalid

handleWebResources

protected void handleWebResources(WarPackagingContext context)
                           throws MojoExecutionException
Handles the web resources.

Parameters:
context - the packaging context
Throws:
MojoExecutionException - if a resource could not be copied

handeWebAppSourceDirectory

protected void handeWebAppSourceDirectory(WarPackagingContext context)
                                   throws MojoExecutionException
Handles the webapp sources.

Parameters:
context - the packaging context
Throws:
MojoExecutionException - if the sources could not be copied

handleArtifacts

protected void handleArtifacts(WarPackagingContext context)
                        throws MojoExecutionException
Handles the webapp artifacts.

Parameters:
context - the packaging context
Throws:
MojoExecutionException - if the artifacts could not be packaged

handleClassesDirectory

protected void handleClassesDirectory(WarPackagingContext context)
                               throws MojoExecutionException
Handles the webapp classes.

Parameters:
context - the packaging context
Throws:
MojoExecutionException - if the classes could not be packaged

handleDeploymentDescriptors

protected void handleDeploymentDescriptors(WarPackagingContext context,
                                           File webinfDir,
                                           File metainfDir)
                                    throws MojoFailureException,
                                           MojoExecutionException
Handles the deployment descriptors, if specified. Note that the behavior here is slightly different since the customized entry always win, even if an overlay has already packaged a web.xml previously.

Parameters:
context - the packaging context
webinfDir - the web-inf directory
metainfDir - the meta-inf directory
Throws:
MojoFailureException - if the web.xml is specified but does not exist
MojoExecutionException - if an error occurred while copying the descriptors

copyResources

public void copyResources(WarPackagingContext context,
                          Resource resource)
                   throws IOException,
                          MojoExecutionException
Copies webapp webResources from the specified directory.

Parameters:
context - the WAR packaging context to use
resource - the resource to copy
Throws:
IOException - if an error occurred while copying the resources
MojoExecutionException - if an error occurred while retrieving the filter properties


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.