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:
ContextEnabled, Mojo
Direct Known Subclasses:
WarExplodedMojo, WarInPlaceMojo, WarManifestMojo, WarMojo

public abstract class AbstractWarMojo
extends AbstractMojo

Contains common jobs for WAR mojos.

Version:
$Id: AbstractWarMojo.html 868453 2013-07-05 11:25:41Z olamy $

Field Summary
static String DEFAULT_FILE_NAME_MAPPING
           
static String DEFAULT_FILE_NAME_MAPPING_CLASSIFIER
           
protected  String escapeString
          Expression preceded with this String won't be interpolated.
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractWarMojo()
           
 
Method Summary
 void addOverlay(Overlay overlay)
           
 void buildExplodedWebapp(File webappDirectory)
           
 void buildWebapp(MavenProject project, File webappDirectory)
          Builds the webapp for the specified project with the new packaging task thingy

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

 MavenArchiveConfiguration getArchive()
           
 ArtifactFactory getArtifactFactory()
           
 File getCacheFile()
           
 File getClassesDirectory()
           
 File getContainerConfigXML()
           
 Overlay getCurrentProjectOverlay()
           
protected  String[] getDependentWarExcludes()
          Returns a string array of the excludes to be used when adding dependent WAR as an overlay onto this WAR.
protected  String[] getDependentWarIncludes()
          Returns a string array of the includes to be used when adding dependent WARs as an overlay onto this WAR.
protected  String[] getExcludes()
          Returns a string array of the excludes to be used when copying the content of the WAR source directory.
 List<String> getFilters()
           
protected  String[] getIncludes()
          Returns a string array of the includes to be used when assembling/copying the WAR.
 JarArchiver getJarArchiver()
           
 List<String> getNonFilteredFileExtensions()
           
 String getOutputFileNameMapping()
           
 List<Overlay> getOverlays()
           
 MavenProject getProject()
           
protected  MavenSession getSession()
           
 File getWarSourceDirectory()
           
 String getWarSourceExcludes()
           
 String getWarSourceIncludes()
           
 File getWebappDirectory()
           
 Resource[] getWebResources()
           
 File getWebXml()
           
 File getWorkDirectory()
           
 boolean isArchiveClasses()
           
protected  boolean isIncludeEmptyDirectories()
           
protected  boolean isRecompressZippedFiles()
           
 boolean isUseCache()
           
 void setArchiveClasses(boolean archiveClasses)
           
 void setArtifactFactory(ArtifactFactory artifactFactory)
           
 void setCacheFile(File cacheFile)
           
 void setClassesDirectory(File classesDirectory)
           
 void setContainerConfigXML(File containerConfigXML)
           
 void setFilters(List<String> filters)
           
 void setJarArchiver(JarArchiver jarArchiver)
           
 void setNonFilteredFileExtensions(List<String> nonFilteredFileExtensions)
           
 void setOutputFileNameMapping(String outputFileNameMapping)
           
 void setOverlays(List<Overlay> overlays)
           
 void setProject(MavenProject project)
           
 void setUseCache(boolean useCache)
           
 void setWarSourceDirectory(File warSourceDirectory)
           
 void setWarSourceExcludes(String warSourceExcludes)
           
 void setWarSourceIncludes(String warSourceIncludes)
           
 void setWebappDirectory(File webappDirectory)
           
 void setWebResources(Resource[] webResources)
           
 void setWebXml(File webXml)
           
 void setWorkDirectory(File workDirectory)
           
 
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

DEFAULT_FILE_NAME_MAPPING

public static final String DEFAULT_FILE_NAME_MAPPING
See Also:
Constant Field Values

DEFAULT_FILE_NAME_MAPPING_CLASSIFIER

public static final String DEFAULT_FILE_NAME_MAPPING_CLASSIFIER
See Also:
Constant Field Values

escapeString

@Parameter(property="maven.war.escapeString")
protected String escapeString
Expression preceded with this String won't be interpolated. \${foo} will be replaced with ${foo}.

Since:
2.1-beta-1
Constructor Detail

AbstractWarMojo

public AbstractWarMojo()
Method Detail

getCurrentProjectOverlay

public Overlay getCurrentProjectOverlay()

getExcludes

protected String[] getExcludes()
Returns a string array of the excludes to be used when copying the content of the WAR source directory.

Returns:
an array of tokens to exclude

getIncludes

protected 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 String[] getDependentWarExcludes()
Returns a string array of the excludes to be used when adding dependent WAR as an overlay onto this WAR.

Returns:
an array of tokens to exclude

getDependentWarIncludes

protected 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(File webappDirectory)
                         throws MojoExecutionException,
                                MojoFailureException
Throws:
MojoExecutionException
MojoFailureException

buildWebapp

public void buildWebapp(MavenProject project,
                        File webappDirectory)
                 throws MojoExecutionException,
                        MojoFailureException,
                        IOException
Builds the webapp for the specified project with the new packaging task thingy

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

Parameters:
project - the maven project
webappDirectory - the target directory
Throws:
MojoExecutionException - if an error occurred while packaging the webapp
MojoFailureException - if an unexpected error occurred while packaging the webapp
IOException - if an error occurred while copying the files

getProject

public MavenProject getProject()

setProject

public void setProject(MavenProject project)

getClassesDirectory

public File getClassesDirectory()

setClassesDirectory

public void setClassesDirectory(File classesDirectory)

getWebappDirectory

public File getWebappDirectory()

setWebappDirectory

public void setWebappDirectory(File webappDirectory)

getWarSourceDirectory

public File getWarSourceDirectory()

setWarSourceDirectory

public void setWarSourceDirectory(File warSourceDirectory)

getWebXml

public File getWebXml()

setWebXml

public void setWebXml(File webXml)

getContainerConfigXML

public File getContainerConfigXML()

setContainerConfigXML

public void setContainerConfigXML(File containerConfigXML)

getOutputFileNameMapping

public String getOutputFileNameMapping()

setOutputFileNameMapping

public void setOutputFileNameMapping(String outputFileNameMapping)

getOverlays

public List<Overlay> getOverlays()

setOverlays

public void setOverlays(List<Overlay> overlays)

addOverlay

public void addOverlay(Overlay overlay)

isArchiveClasses

public boolean isArchiveClasses()

setArchiveClasses

public void setArchiveClasses(boolean archiveClasses)

getJarArchiver

public JarArchiver getJarArchiver()

setJarArchiver

public void setJarArchiver(JarArchiver jarArchiver)

getWebResources

public Resource[] getWebResources()

setWebResources

public void setWebResources(Resource[] webResources)

getFilters

public List<String> getFilters()

setFilters

public void setFilters(List<String> filters)

getWorkDirectory

public File getWorkDirectory()

setWorkDirectory

public void setWorkDirectory(File workDirectory)

getCacheFile

public File getCacheFile()

setCacheFile

public void setCacheFile(File cacheFile)

getWarSourceIncludes

public String getWarSourceIncludes()

setWarSourceIncludes

public void setWarSourceIncludes(String warSourceIncludes)

getWarSourceExcludes

public String getWarSourceExcludes()

setWarSourceExcludes

public void setWarSourceExcludes(String warSourceExcludes)

isUseCache

public boolean isUseCache()

setUseCache

public void setUseCache(boolean useCache)

getArchive

public MavenArchiveConfiguration getArchive()

getNonFilteredFileExtensions

public List<String> getNonFilteredFileExtensions()

setNonFilteredFileExtensions

public void setNonFilteredFileExtensions(List<String> nonFilteredFileExtensions)

getArtifactFactory

public ArtifactFactory getArtifactFactory()

setArtifactFactory

public void setArtifactFactory(ArtifactFactory artifactFactory)

getSession

protected MavenSession getSession()

isRecompressZippedFiles

protected boolean isRecompressZippedFiles()

isIncludeEmptyDirectories

protected boolean isIncludeEmptyDirectories()


Copyright © 2002–2013 The Apache Software Foundation. All rights reserved.