org.alfresco.maven.plugin.amp.packaging
Class AmpProjectPackagingTask

java.lang.Object
  extended by org.alfresco.maven.plugin.amp.packaging.AbstractAmpPackagingTask
      extended by org.alfresco.maven.plugin.amp.packaging.AmpProjectPackagingTask
All Implemented Interfaces:
AmpPackagingTask

public class AmpProjectPackagingTask
extends AbstractAmpPackagingTask

Handles the project own resources, that is:

Author:
Stephane Nicoll

Field Summary
 
Fields inherited from class org.alfresco.maven.plugin.amp.packaging.AbstractAmpPackagingTask
DEFAULT_INCLUDES, META_INF_PATH
 
Constructor Summary
AmpProjectPackagingTask(org.apache.maven.model.Resource[] webResource, File moduleProperties)
           
 
Method Summary
 void copyResources(AmpPackagingContext context, org.apache.maven.model.Resource resource)
          Copies webapp webResources from the specified directory.
protected  void handeAmpConfigDirectory(AmpPackagingContext context)
          Handles the webapp sources.
protected  void handeWebAppSourceDirectory(AmpPackagingContext context)
          Handles the webapp sources.
protected  void handleArtifacts(AmpPackagingContext context)
          Handles the webapp artifacts.
protected  void handleClassesDirectory(AmpPackagingContext context)
          Handles the webapp classes.
protected  void handleDeploymentDescriptors(AmpPackagingContext context)
          Handles the deployment descriptors, if specified.
protected  void handleWebResources(AmpPackagingContext context)
          Handles the web resources.
 void performPackaging(AmpPackagingContext context)
          Performs the packaging for the specified task.
 
Methods inherited from class org.alfresco.maven.plugin.amp.packaging.AbstractAmpPackagingTask
copyFile, copyFile, copyFiles, copyFiles, copyFilteredFile, doUnpack, getArtifactFinalName, getFilesToIncludes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AmpProjectPackagingTask

public AmpProjectPackagingTask(org.apache.maven.model.Resource[] webResource,
                               File moduleProperties)
Method Detail

performPackaging

public void performPackaging(AmpPackagingContext context)
                      throws org.apache.maven.plugin.MojoExecutionException,
                             org.apache.maven.plugin.MojoFailureException
Description copied from interface: AmpPackagingTask
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:
org.apache.maven.plugin.MojoExecutionException - if an error occured
org.apache.maven.plugin.MojoFailureException - if the project configuration is invalid

handleWebResources

protected void handleWebResources(AmpPackagingContext context)
                           throws org.apache.maven.plugin.MojoExecutionException
Handles the web resources.

Parameters:
context - the packaging context
Throws:
org.apache.maven.plugin.MojoExecutionException - if a resource could not be copied

handeWebAppSourceDirectory

protected void handeWebAppSourceDirectory(AmpPackagingContext context)
                                   throws org.apache.maven.plugin.MojoExecutionException
Handles the webapp sources.

Parameters:
context - the packaging context
Throws:
org.apache.maven.plugin.MojoExecutionException - if the sources could not be copied

handeAmpConfigDirectory

protected void handeAmpConfigDirectory(AmpPackagingContext context)
                                throws org.apache.maven.plugin.MojoExecutionException
Handles the webapp sources.

Parameters:
context - the packaging context
Throws:
org.apache.maven.plugin.MojoExecutionException - if the sources could not be copied

handleArtifacts

protected void handleArtifacts(AmpPackagingContext context)
                        throws org.apache.maven.plugin.MojoExecutionException
Handles the webapp artifacts.

Parameters:
context - the packaging context
Throws:
org.apache.maven.plugin.MojoExecutionException - if the artifacts could not be packaged

handleClassesDirectory

protected void handleClassesDirectory(AmpPackagingContext context)
                               throws org.apache.maven.plugin.MojoExecutionException
Handles the webapp classes.

Parameters:
context - the packaging context
Throws:
org.apache.maven.plugin.MojoExecutionException - if the classes could not be packaged

handleDeploymentDescriptors

protected void handleDeploymentDescriptors(AmpPackagingContext context)
                                    throws org.apache.maven.plugin.MojoFailureException,
                                           org.apache.maven.plugin.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:
org.apache.maven.plugin.MojoFailureException - if the web.xml is specified but does not exist
org.apache.maven.plugin.MojoExecutionException - if an error occured while copying the descriptors

copyResources

public void copyResources(AmpPackagingContext context,
                          org.apache.maven.model.Resource resource)
                   throws IOException,
                          org.apache.maven.plugin.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 occured while copying the resources
org.apache.maven.plugin.MojoExecutionException - if an error occured while retrieving the filter properties


Copyright © 2009 Alfresco. All Rights Reserved.