org.apache.maven.plugin.war
Class AbstractWarMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.apache.maven.plugin.war.AbstractWarMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
WarExplodedMojo, WarInPlaceMojo, WarManifestMojo, WarMojo

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


Field Summary
protected  org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
          To look up Archiver/UnArchiver implementations
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractWarMojo()
           
 
Method Summary
 void buildExplodedWebapp(java.io.File webappDirectory)
           
 void buildWebapp(org.apache.maven.project.MavenProject project, java.io.File webappDirectory)
          Builds the webapp for the specified project.
 void copyResources(java.io.File sourceDirectory, java.io.File webappDirectory)
          Copies webapp webResources from the specified directory.
 void copyResources(org.apache.maven.model.Resource resource, java.io.File webappDirectory, java.util.Properties filterProperties)
          Copies webapp webResources from the specified directory.
 java.io.File getClassesDirectory()
           
 java.io.File getContainerConfigXML()
           
protected  java.lang.String[] getDependentWarExcludes()
          Returns a string array of the excludes to be used when adding dependent wars as an overlay onto this war.
protected  java.lang.String[] getDependentWarIncludes()
          Returns a string array of the includes to be used when adding dependent wars as an overlay onto this war.
protected  java.lang.String[] getExcludes()
          Returns a string array of the excludes to be used when assembling/copying the war.
protected  java.lang.String[] getIncludes()
          Returns a string array of the includes to be used when assembling/copying the war.
 org.apache.maven.project.MavenProject getProject()
           
 java.io.File getWarSourceDirectory()
           
 java.io.File getWebappDirectory()
           
 java.io.File getWebXml()
           
 void setClassesDirectory(java.io.File classesDirectory)
           
 void setContainerConfigXML(java.io.File containerConfigXML)
           
 void setProject(org.apache.maven.project.MavenProject project)
           
 void setWarSourceDirectory(java.io.File warSourceDirectory)
           
 void setWebappDirectory(java.io.File webappDirectory)
           
 void setWebXml(java.io.File webXml)
           
 
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

archiverManager

protected org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager
To look up Archiver/UnArchiver implementations

Constructor Detail

AbstractWarMojo

public AbstractWarMojo()
Method Detail

getProject

public org.apache.maven.project.MavenProject getProject()

setProject

public void setProject(org.apache.maven.project.MavenProject project)

getClassesDirectory

public java.io.File getClassesDirectory()

setClassesDirectory

public void setClassesDirectory(java.io.File classesDirectory)

getWebappDirectory

public java.io.File getWebappDirectory()

setWebappDirectory

public void setWebappDirectory(java.io.File webappDirectory)

getWarSourceDirectory

public java.io.File getWarSourceDirectory()

setWarSourceDirectory

public void setWarSourceDirectory(java.io.File warSourceDirectory)

getWebXml

public java.io.File getWebXml()

setWebXml

public void setWebXml(java.io.File webXml)

getContainerConfigXML

public java.io.File getContainerConfigXML()

setContainerConfigXML

public void setContainerConfigXML(java.io.File containerConfigXML)

getExcludes

protected java.lang.String[] getExcludes()
Returns a string array of the excludes to be used when assembling/copying the war.

Returns:
an array of tokens to exclude

getIncludes

protected java.lang.String[] getIncludes()
Returns a string array of the includes to be used when assembling/copying the war.

Returns:
an array of tokens to include

getDependentWarExcludes

protected java.lang.String[] getDependentWarExcludes()
Returns a string array of the excludes to be used when adding dependent wars as an overlay onto this war.

Returns:
an array of tokens to exclude

getDependentWarIncludes

protected java.lang.String[] getDependentWarIncludes()
Returns a string array of the includes to be used when adding dependent wars as an overlay onto this war.

Returns:
an array of tokens to include

buildExplodedWebapp

public void buildExplodedWebapp(java.io.File webappDirectory)
                         throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException

copyResources

public void copyResources(org.apache.maven.model.Resource resource,
                          java.io.File webappDirectory,
                          java.util.Properties filterProperties)
                   throws java.io.IOException
Copies webapp webResources from the specified directory.

Note that the webXml parameter could be null and may specify a file which is not named web.xml. If the file exists, it will be copied to the META-INF directory and renamed accordingly.

Parameters:
resource - the resource to copy
webappDirectory - the target directory
filterProperties -
Throws:
java.io.IOException - if an error occured while copying webResources

copyResources

public void copyResources(java.io.File sourceDirectory,
                          java.io.File webappDirectory)
                   throws java.io.IOException
Copies webapp webResources from the specified directory.

Note that the webXml parameter could be null and may specify a file which is not named web.xml. If the file exists, it will be copied to the META-INF directory and renamed accordingly.

Parameters:
sourceDirectory - the source directory
webappDirectory - the target directory
Throws:
java.io.IOException - if an error occured while copying webResources

buildWebapp

public void buildWebapp(org.apache.maven.project.MavenProject project,
                        java.io.File webappDirectory)
                 throws org.apache.maven.plugin.MojoExecutionException,
                        java.io.IOException
Builds the webapp for the specified project.

Classes, libraries and tld files are copied to the webappDirectory during this phase.

Parameters:
project - the maven project
webappDirectory -
Throws:
java.io.IOException - if an error occured while building the webapp
org.apache.maven.plugin.MojoExecutionException


Copyright © 2002-2010 Apache Software Foundation. All Rights Reserved.