Class AbstractWarMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.apache.maven.plugins.war.AbstractWarMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
- Direct Known Subclasses:
WarExplodedMojo, WarInPlaceMojo, WarMojo
public abstract class AbstractWarMojo
extends org.apache.maven.plugin.AbstractMojo
Contains common jobs for WAR mojos.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringExpression preceded with this String won't be interpolated.protected BooleanWhether to fail the build if theweb.xmlfile is missing.protected StringTimestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXXor as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).protected StringThe character encoding to use when reading and writing filtered properties files.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractWarMojo(org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager, org.codehaus.plexus.archiver.manager.ArchiverManager archiverManager, org.apache.maven.shared.filtering.MavenFileFilter mavenFileFilter, org.apache.maven.shared.filtering.MavenResourcesFiltering mavenResourcesFiltering, org.apache.maven.execution.MavenSession session) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOverlay(Overlay overlay) voidbuildExplodedWebapp(File webapplicationDirectory) voidbuildWebapp(org.apache.maven.project.MavenProject mavenProject, File webapplicationDirectory) Builds the webapp for the specified project with the new packaging task thingy.org.apache.maven.archiver.MavenArchiveConfigurationorg.codehaus.plexus.archiver.manager.ArchiverManagerprotected String[]Returns a string array of the excludes to be used when adding dependent WAR as an overlay onto this WAR.protected String[]Returns a string array of the includes to be used when adding dependent WARs as an overlay onto this WAR.protected String[]Returns a string array of the excludes to be used when copying the content of the WAR source directory.protected String[]Returns a string array of the includes to be used when assembling/copying the WAR.org.codehaus.plexus.archiver.jar.JarArchiverString[]String[]org.apache.maven.project.MavenProjectprotected org.apache.maven.execution.MavenSessionorg.apache.maven.model.Resource[]booleanprotected booleanprotected booleanvoidsetClassesDirectory(File classesDirectory) voidsetContainerConfigXML(File containerConfigXML) voidsetOutputFileNameMapping(String outputFileNameMapping) voidsetOverlays(List<Overlay> overlays) voidsetPackagingExcludes(String packagingExcludes) voidsetPackagingIncludes(String packagingIncludes) voidsetProject(org.apache.maven.project.MavenProject project) voidsetWarSourceDirectory(File warSourceDirectory) voidsetWebappDirectory(File webappDirectory) voidsetWebResources(org.apache.maven.model.Resource[] webResources) voidMethods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContextMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.maven.plugin.Mojo
execute
-
Field Details
-
failOnMissingWebXml
Whether to fail the build if theweb.xmlfile is missing. Set tofalseif you want your WAR built without aweb.xmlfile. This may be useful if you are building an overlay that has no web.xml file.Starting with 3.1.0, this property defaults to
falseif the project depends on the Servlet 3.0 API or newer.- Since:
- 2.1-alpha-2
-
propertiesEncoding
The character encoding to use when reading and writing filtered properties files. If not specified, it will default to the value of the "resourceEncoding" parameter.- Since:
- 3.4.0
-
escapeString
Expression preceded with this String won't be interpolated.\${foo}will be replaced with${foo}.- Since:
- 2.1-beta-1
-
outputTimestamp
Timestamp for reproducible output archive entries, either formatted as ISO 8601yyyy-MM-dd'T'HH:mm:ssXXXor as an int representing seconds since the epoch (like SOURCE_DATE_EPOCH).- Since:
- 3.3.0
-
-
Constructor Details
-
Method Details
-
getArchiverManager
public org.codehaus.plexus.archiver.manager.ArchiverManager getArchiverManager() -
getCurrentProjectOverlay
- Returns:
- the current overlay
-
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
Returns a string array of the includes to be used when assembling/copying the WAR.- Returns:
- an array of tokens to include
-
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
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 webapplicationDirectory) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException - Parameters:
webapplicationDirectory- the web application directory- Throws:
org.apache.maven.plugin.MojoExecutionException- in case of failureorg.apache.maven.plugin.MojoFailureException- in case of failure
-
buildWebapp
public void buildWebapp(org.apache.maven.project.MavenProject mavenProject, File webapplicationDirectory) throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException, IOException Builds the webapp for the specified project with the new packaging task thingy. Classes, libraries and tld files are copied to thewebappDirectoryduring this phase.- Parameters:
mavenProject- the maven projectwebapplicationDirectory- the target directory- Throws:
IOException- if an error occurred while copying the filesorg.apache.maven.plugin.MojoExecutionException- if an error occurred while packaging the webapporg.apache.maven.plugin.MojoFailureException- if an unexpected error occurred while packaging the webapp
-
getProject
public org.apache.maven.project.MavenProject getProject()- Returns:
- the Maven Project
-
setProject
public void setProject(org.apache.maven.project.MavenProject project) - Parameters:
project- the project to be set
-
getClassesDirectory
- Returns:
- the classes directory
-
setClassesDirectory
- Parameters:
classesDirectory- the classes directory to be set
-
getWebappDirectory
- Returns:
webappDirectory
-
setWebappDirectory
- Parameters:
webappDirectory- the web application directory
-
getWarSourceDirectory
- Returns:
warSourceDirectory
-
setWarSourceDirectory
- Parameters:
warSourceDirectory-warSourceDirectory
-
getWebXml
- Returns:
- the
webXml
-
setWebXml
- Parameters:
webXml- thewebXml
-
getContainerConfigXML
- Returns:
containerConfigXML
-
setContainerConfigXML
- Parameters:
containerConfigXML-containerConfigXML
-
getOutputFileNameMapping
- Returns:
outputFileNameMapping
-
setOutputFileNameMapping
- Parameters:
outputFileNameMapping-outputFileNameMapping
-
getOverlays
-
setOverlays
-
addOverlay
- Parameters:
overlay- addoverlays
-
isArchiveClasses
public boolean isArchiveClasses()- Returns:
archiveClasses
-
getJarArchiver
public org.codehaus.plexus.archiver.jar.JarArchiver getJarArchiver()- Returns:
JarArchiver
-
getWebResources
public org.apache.maven.model.Resource[] getWebResources()- Returns:
webResources
-
setWebResources
public void setWebResources(org.apache.maven.model.Resource[] webResources) - Parameters:
webResources-webResources
-
getFilters
-
getWorkDirectory
- Returns:
workDirectory
-
getWarSourceIncludes
- Returns:
warSourceIncludes
-
getWarSourceExcludes
- Returns:
warSourceExcludes
-
getArchive
public org.apache.maven.archiver.MavenArchiveConfiguration getArchive()- Returns:
archive
-
getNonFilteredFileExtensions
-
getSession
protected org.apache.maven.execution.MavenSession getSession()- Returns:
session
-
isRecompressZippedFiles
protected boolean isRecompressZippedFiles()- Returns:
recompressZippedFiles
-
isIncludeEmptyDirectories
protected boolean isIncludeEmptyDirectories()- Returns:
includeEmptyDirectories
-
getPackagingExcludes
- Returns:
- the package excludes
-
setPackagingExcludes
- Parameters:
packagingExcludes-packagingExcludes
-
getPackagingIncludes
- Returns:
- the packaging includes
-
setPackagingIncludes
- Parameters:
packagingIncludes-packagingIncludes
-