Class AbstractWarMojo.DefaultWarPackagingContext

    • Field Detail

      • artifactHandlerManager

        private final org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager
      • resourceEncoding

        private final java.lang.String resourceEncoding
      • propertiesEncoding

        private final java.lang.String propertiesEncoding
      • webappDirectory

        private final java.io.File webappDirectory
      • filterWrappers

        private final java.util.List<org.apache.maven.shared.filtering.FilterWrapper> filterWrappers
      • nonFilteredFileExtensions

        private java.util.List<java.lang.String> nonFilteredFileExtensions
      • filteringDeploymentDescriptors

        private boolean filteringDeploymentDescriptors
      • failOnMissingWebXml

        private final java.lang.Boolean failOnMissingWebXml
      • outdatedResources

        private final java.util.Collection<java.lang.String> outdatedResources
      • outputTimestamp

        private final java.lang.String outputTimestamp
    • Constructor Detail

      • DefaultWarPackagingContext

        DefaultWarPackagingContext​(java.io.File webappDirectory,
                                   WebappStructure webappStructure,
                                   OverlayManager overlayManager,
                                   java.util.List<org.apache.maven.shared.filtering.FilterWrapper> filterWrappers,
                                   java.util.List<java.lang.String> nonFilteredFileExtensions,
                                   boolean filteringDeploymentDescriptors,
                                   org.apache.maven.artifact.handler.manager.ArtifactHandlerManager artifactHandlerManager,
                                   java.lang.String resourceEncoding,
                                   java.lang.String propertiesEncoding,
                                   java.lang.Boolean failOnMissingWebXml,
                                   java.lang.String outputTimestamp)
        Parameters:
        webappDirectory - the web application directory
        webappStructure - the web app structure
        overlayManager - the overlay manager
        filterWrappers - the filter wrappers
        nonFilteredFileExtensions - the non filtered file extensions
        filteringDeploymentDescriptors - the filtering deployment descriptors
        artifactHandlerManager - the artifact handler manager
        resourceEncoding - the resource encoding
        propertiesEncoding - the encoding to use for properties files
        failOnMissingWebXml - flag to check whether we should ignore missing web.xml or not
        outputTimestamp - the output timestamp for reproducible archive creation
    • Method Detail

      • checkAllPathsForOutdated

        protected boolean checkAllPathsForOutdated()
      • getWebappDirectory

        public java.io.File getWebappDirectory()
        Description copied from interface: WarPackagingContext
        Returns the webapp directory. Packaging tasks should use this directory to generate the webapp.
        Specified by:
        getWebappDirectory in interface WarPackagingContext
        Returns:
        the webapp directory
      • getLog

        public org.apache.maven.plugin.logging.Log getLog()
        Description copied from interface: WarPackagingContext
        Returns the logger to use to output logging event.
        Specified by:
        getLog in interface WarPackagingContext
        Returns:
        the logger
      • getOutputFileNameMapping

        public java.lang.String getOutputFileNameMapping()
        Description copied from interface: WarPackagingContext
        Returns the output file name mapping to use, if any. Returns null if no file name mapping is set.
        Specified by:
        getOutputFileNameMapping in interface WarPackagingContext
        Returns:
        the output file name mapping or null
      • isWebappSourceIncludeEmptyDirectories

        public boolean isWebappSourceIncludeEmptyDirectories()
        Description copied from interface: WarPackagingContext
        Returns true if empty directories should be includes, otherwise false
        Specified by:
        isWebappSourceIncludeEmptyDirectories in interface WarPackagingContext
        Returns:
        true if empty directories should be includes, otherwise false
      • archiveClasses

        public boolean archiveClasses()
        Description copied from interface: WarPackagingContext
        Specify whether the classes resources should be archived in the WEB-INF/lib of the generated web app.
        Specified by:
        archiveClasses in interface WarPackagingContext
        Returns:
        true if the classes should be archived, false otherwise
      • getArchiverManager

        public org.codehaus.plexus.archiver.manager.ArchiverManager getArchiverManager()
        Description copied from interface: WarPackagingContext
        Returns the archiver manager to use.
        Specified by:
        getArchiverManager in interface WarPackagingContext
        Returns:
        the archiver manager
      • getArchive

        public org.apache.maven.archiver.MavenArchiveConfiguration getArchive()
        Description copied from interface: WarPackagingContext
        The maven archive configuration to use.
        Specified by:
        getArchive in interface WarPackagingContext
        Returns:
        the maven archive configuration
      • getJarArchiver

        public org.codehaus.plexus.archiver.jar.JarArchiver getJarArchiver()
        Description copied from interface: WarPackagingContext
        Returns the Jar archiver needed for archiving classes directory into jar file under WEB-INF/lib.
        Specified by:
        getJarArchiver in interface WarPackagingContext
        Returns:
        the jar archiver to user
      • getFilters

        public java.util.List<java.lang.String> getFilters()
        Description copied from interface: WarPackagingContext
        Returns the list of filter files to use.
        Specified by:
        getFilters in interface WarPackagingContext
        Returns:
        a list of filter files
      • getOwnerIds

        public java.util.List<java.lang.String> getOwnerIds()
        Description copied from interface: WarPackagingContext
        Returns the list of registered overlays for this session.
        Specified by:
        getOwnerIds in interface WarPackagingContext
        Returns:
        the list of registered overlays, including the current project
      • getMavenFileFilter

        public org.apache.maven.shared.filtering.MavenFileFilter getMavenFileFilter()
        Description copied from interface: WarPackagingContext
        Returns the MavenFileFilter instance to use.
        Specified by:
        getMavenFileFilter in interface WarPackagingContext
        Returns:
        the maven file filter to use
      • getFilterWrappers

        public java.util.List<org.apache.maven.shared.filtering.FilterWrapper> getFilterWrappers()
        Specified by:
        getFilterWrappers in interface WarPackagingContext
        Returns:
        List of FilterWrapper
      • isNonFilteredExtension

        public boolean isNonFilteredExtension​(java.lang.String fileName)
        Description copied from interface: WarPackagingContext
        Specify if the given fileName belongs to the list of extensions that must not be filtered.
        Specified by:
        isNonFilteredExtension in interface WarPackagingContext
        Parameters:
        fileName - the name of file
        Returns:
        true if it should not be filtered, false otherwise
      • getArtifactHandlerManager

        public org.apache.maven.artifact.handler.manager.ArtifactHandlerManager getArtifactHandlerManager()
        Description copied from interface: WarPackagingContext
        Returns the artifact handler manager.
        Specified by:
        getArtifactHandlerManager in interface WarPackagingContext
        Returns:
        the artifact handler manager
      • getSession

        public org.apache.maven.execution.MavenSession getSession()
        Description copied from interface: WarPackagingContext
        Returns the Maven session.
        Specified by:
        getSession in interface WarPackagingContext
        Returns:
        the Maven session
      • getPropertiesEncoding

        public java.lang.String getPropertiesEncoding()
        Description copied from interface: WarPackagingContext
        Returns the encoding to use for resources that are properties files.
        Specified by:
        getPropertiesEncoding in interface WarPackagingContext
        Returns:
        the encoding for properties files
      • isFailOnMissingWebXml

        public java.lang.Boolean isFailOnMissingWebXml()
        Description copied from interface: WarPackagingContext
        Returns the flag that switch on/off the missing web.xml validation.
        Specified by:
        isFailOnMissingWebXml in interface WarPackagingContext
        Returns:
        failOnMissingWebXml
      • addResource

        public void addResource​(java.lang.String resource)
        Description copied from interface: WarPackagingContext
        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 calling mvn clean when resources are removed.
        Specified by:
        addResource in interface WarPackagingContext
        Parameters:
        resource - the resource that is to me marked as not outdated
        See Also:
        WarPackagingContext.deleteOutdatedResources()
      • getOutputTimestamp

        public java.lang.String getOutputTimestamp()
        Description copied from interface: WarPackagingContext
        Output timestamp for reproducible archive creation.
        Specified by:
        getOutputTimestamp in interface WarPackagingContext
        Returns:
        the output timestamp (may be null)
      • getPackagingExcludes

        public java.util.List<java.lang.String> getPackagingExcludes()
        Specified by:
        getPackagingExcludes in interface WarPackagingContext
        Returns:
        list of packaging excludes
        Since:
        3.4.1
      • getPackagingIncludes

        public java.util.List<java.lang.String> getPackagingIncludes()
        Specified by:
        getPackagingIncludes in interface WarPackagingContext
        Returns:
        list of packaging includes
        Since:
        3.4.1