Class AbstractWarMojo.DefaultWarPackagingContext

    • Field Detail

      • artifactFactory

        private final org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
      • 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
      • useJvmChmod

        private boolean useJvmChmod
      • 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.factory.ArtifactFactory artifactFactory,
                                   java.lang.String resourceEncoding,
                                   java.lang.String propertiesEncoding,
                                   boolean useJvmChmod,
                                   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.
        artifactFactory - The artifact factory.
        resourceEncoding - The resource encoding.
        propertiesEncoding - The encoding to use for properties files.
        useJvmChmod - use Jvm chmod or not.
        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
      • getArtifactFactory

        public org.apache.maven.artifact.factory.ArtifactFactory getArtifactFactory()
        Specified by:
        getArtifactFactory in interface WarPackagingContext
        Returns:
        ArtifactFactory
      • 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
      • isUseJvmChmod

        public boolean isUseJvmChmod()
        Specified by:
        isUseJvmChmod in interface WarPackagingContext
        Returns:
        to use jvmChmod rather than forking chmod cli
      • 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)