Interface WarPackagingContext
-
- All Known Implementing Classes:
AbstractWarMojo.DefaultWarPackagingContext
public interface WarPackagingContextThe packaging context.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddResource(java.lang.String resource)Add a live resource to the war.booleanarchiveClasses()Specify whether the classes resources should be archived in theWEB-INF/libof the generated web app.voiddeleteOutdatedResources()Delete outdated resources, ie resources that are found in the war but that were not added by the current packaging process, then are supposed to be content from a previous run.org.apache.maven.archiver.MavenArchiveConfigurationgetArchive()The maven archive configuration to use.org.codehaus.plexus.archiver.manager.ArchiverManagergetArchiverManager()Returns the archiver manager to use.org.apache.maven.artifact.handler.manager.ArtifactHandlerManagergetArtifactHandlerManager()Returns the artifact handler manager.java.io.FilegetClassesDirectory()Returns the directory holding generated classes.java.util.List<java.lang.String>getFilters()Returns the list of filter files to use.java.util.List<org.apache.maven.shared.filtering.FilterWrapper>getFilterWrappers()org.codehaus.plexus.archiver.jar.JarArchivergetJarArchiver()Returns the Jar archiver needed for archiving classes directory into jar file under WEB-INF/lib.org.apache.maven.plugin.logging.LoggetLog()Returns the logger to use to output logging event.org.apache.maven.shared.filtering.MavenFileFiltergetMavenFileFilter()Returns theMavenFileFilterinstance to use.java.lang.StringgetOutputFileNameMapping()Returns the output file name mapping to use, if any.java.lang.StringgetOutputTimestamp()Output timestamp for reproducible archive creation.java.io.FilegetOverlaysWorkDirectory()Returns the directory to unpack dependent WARs into if needed.java.util.List<java.lang.String>getOwnerIds()Returns the list of registered overlays for this session.java.util.List<java.lang.String>getPackagingExcludes()java.util.List<java.lang.String>getPackagingIncludes()org.apache.maven.project.MavenProjectgetProject()Returns the maven project.java.lang.StringgetPropertiesEncoding()Returns the encoding to use for resources that are properties files.java.lang.StringgetResourceEncoding()Returns the encoding to use for resources.org.apache.maven.execution.MavenSessiongetSession()Returns the Maven session.java.io.FilegetWebappDirectory()Returns the webapp directory.java.io.FilegetWebappSourceDirectory()Returns the main webapp source directory.java.lang.String[]getWebappSourceExcludes()Returns the webapp source excludes.java.lang.String[]getWebappSourceIncludes()Returns the webapp source includes.WebappStructuregetWebappStructure()Returns theWebappStructure.java.lang.BooleanisFailOnMissingWebXml()Returns the flag that switch on/off the missing web.xml validation.booleanisFilteringDeploymentDescriptors()booleanisNonFilteredExtension(java.lang.String fileName)Specify if the givenfileNamebelongs to the list of extensions that must not be filtered.booleanisWebappSourceIncludeEmptyDirectories()Returnstrueif empty directories should be includes, otherwisefalse
-
-
-
Method Detail
-
getProject
org.apache.maven.project.MavenProject getProject()
Returns the maven project.- Returns:
- the project
-
getWebappDirectory
java.io.File getWebappDirectory()
Returns the webapp directory. Packaging tasks should use this directory to generate the webapp.- Returns:
- the webapp directory
-
getWebappSourceDirectory
java.io.File getWebappSourceDirectory()
Returns the main webapp source directory.- Returns:
- the webapp source directory
-
getWebappSourceIncludes
java.lang.String[] getWebappSourceIncludes()
Returns the webapp source includes.- Returns:
- the webapp source includes
-
isWebappSourceIncludeEmptyDirectories
boolean isWebappSourceIncludeEmptyDirectories()
Returnstrueif empty directories should be includes, otherwisefalse- Returns:
trueif empty directories should be includes, otherwisefalse
-
getWebappSourceExcludes
java.lang.String[] getWebappSourceExcludes()
Returns the webapp source excludes.- Returns:
- the webapp source excludes
-
getClassesDirectory
java.io.File getClassesDirectory()
Returns the directory holding generated classes.- Returns:
- the classes directory
-
archiveClasses
boolean archiveClasses()
Specify whether the classes resources should be archived in theWEB-INF/libof the generated web app.- Returns:
- true if the classes should be archived, false otherwise
-
getLog
org.apache.maven.plugin.logging.Log getLog()
Returns the logger to use to output logging event.- Returns:
- the logger
-
getOverlaysWorkDirectory
java.io.File getOverlaysWorkDirectory()
Returns the directory to unpack dependent WARs into if needed.- Returns:
- the overlays work directory
-
getArchiverManager
org.codehaus.plexus.archiver.manager.ArchiverManager getArchiverManager()
Returns the archiver manager to use.- Returns:
- the archiver manager
-
getArchive
org.apache.maven.archiver.MavenArchiveConfiguration getArchive()
The maven archive configuration to use.- Returns:
- the maven archive configuration
-
getJarArchiver
org.codehaus.plexus.archiver.jar.JarArchiver getJarArchiver()
Returns the Jar archiver needed for archiving classes directory into jar file under WEB-INF/lib.- Returns:
- the jar archiver to user
-
getOutputFileNameMapping
java.lang.String getOutputFileNameMapping()
Returns the output file name mapping to use, if any. Returnsnullif no file name mapping is set.- Returns:
- the output file name mapping or
null
-
getFilters
java.util.List<java.lang.String> getFilters()
Returns the list of filter files to use.- Returns:
- a list of filter files
-
getWebappStructure
WebappStructure getWebappStructure()
Returns theWebappStructure.- Returns:
- the webapp structure
-
getOwnerIds
java.util.List<java.lang.String> getOwnerIds()
Returns the list of registered overlays for this session.- Returns:
- the list of registered overlays, including the current project
-
getMavenFileFilter
org.apache.maven.shared.filtering.MavenFileFilter getMavenFileFilter()
Returns theMavenFileFilterinstance to use.- Returns:
- the maven file filter to use
- Since:
- 2.1-alpha-2
-
getFilterWrappers
java.util.List<org.apache.maven.shared.filtering.FilterWrapper> getFilterWrappers()
- Returns:
ListofFilterWrapper- Since:
- 2.1-alpha-2
-
isNonFilteredExtension
boolean isNonFilteredExtension(java.lang.String fileName)
Specify if the givenfileNamebelongs to the list of extensions that must not be filtered.- Parameters:
fileName- the name of file- Returns:
trueif it should not be filtered,falseotherwise- Since:
- 2.1-alpha-2
-
isFilteringDeploymentDescriptors
boolean isFilteringDeploymentDescriptors()
- Returns:
- filtering deployment descriptor
-
getArtifactHandlerManager
org.apache.maven.artifact.handler.manager.ArtifactHandlerManager getArtifactHandlerManager()
Returns the artifact handler manager.- Returns:
- the artifact handler manager
-
getSession
org.apache.maven.execution.MavenSession getSession()
Returns the Maven session.- Returns:
- the Maven session
- Since:
- 2.2
-
getResourceEncoding
java.lang.String getResourceEncoding()
Returns the encoding to use for resources.- Returns:
- the resource encoding
- Since:
- 2.3
-
getPropertiesEncoding
java.lang.String getPropertiesEncoding()
Returns the encoding to use for resources that are properties files.- Returns:
- the encoding for properties files
- Since:
- 3.4.0
-
isFailOnMissingWebXml
java.lang.Boolean isFailOnMissingWebXml()
Returns the flag that switch on/off the missing web.xml validation.- Returns:
- failOnMissingWebXml
-
addResource
void addResource(java.lang.String resource)
Add a live resource to the war. Used to keep track of existing resources and all copied files. All others are outdated and will be removed. This prevent callingmvn cleanwhen resources are removed.- Parameters:
resource- the resource that is to me marked as not outdated- Since:
- 3.3.0
- See Also:
deleteOutdatedResources()
-
deleteOutdatedResources
void deleteOutdatedResources()
Delete outdated resources, ie resources that are found in the war but that were not added by the current packaging process, then are supposed to be content from a previous run. This prevent callingmvn cleanwhen resources are removed.- Since:
- 3.3.0
- See Also:
addResource(java.lang.String)
-
getOutputTimestamp
java.lang.String getOutputTimestamp()
Output timestamp for reproducible archive creation.- Returns:
- the output timestamp (may be null)
- Since:
- 3.3.0
-
getPackagingExcludes
java.util.List<java.lang.String> getPackagingExcludes()
- Returns:
- list of packaging excludes
- Since:
- 3.4.1
-
getPackagingIncludes
java.util.List<java.lang.String> getPackagingIncludes()
- Returns:
- list of packaging includes
- Since:
- 3.4.1
-
-