Class WarArchiver

  • All Implemented Interfaces:
    Archiver, FinalizerEnabled, org.codehaus.plexus.logging.LogEnabled, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable

    public class WarArchiver
    extends JarArchiver
    An extension of <jar> to create a WAR archive. Contains special treatment for files that should end up in the WEB-INF/lib, WEB-INF/classes or WEB-INF directories of the Web Application Archive.

    (The War task is a shortcut for specifying the particular layout of a WAR file. The same thing can be accomplished by using the prefix and fullpath attributes of zipfilesets in a Zip or Jar task.)

    The extended zipfileset element from the zip task (with attributes prefix, fullpath, and src) is available in the War task.

    See Also:
    JarArchiver
    • Constructor Detail

      • WarArchiver

        public WarArchiver()
    • Method Detail

      • setIgnoreWebxml

        @Deprecated
        public void setIgnoreWebxml​(boolean excpectWebXml)
        Deprecated.
        Use setExpectWebXml instead !
        Parameters:
        excpectWebXml - true if web xml is *expected* from the client
      • setExpectWebXml

        public void setExpectWebXml​(boolean expectWebXml)
        Indicates if the client is required to supply web.xml
        Parameters:
        expectWebXml - true if web xml is *expected* from the client
      • setWebxml

        public void setWebxml​(java.io.File descr)
                       throws ArchiverException
        set the deployment descriptor to use (WEB-INF/web.xml); required unless update=true
        Throws:
        ArchiverException
      • addLibs

        public void addLibs​(java.io.File directoryName,
                            java.lang.String[] includes,
                            java.lang.String[] excludes)
                     throws ArchiverException
        add files under WEB-INF/lib/
        Throws:
        ArchiverException
      • addClasses

        public void addClasses​(java.io.File directoryName,
                               java.lang.String[] includes,
                               java.lang.String[] excludes)
                        throws ArchiverException
        add files under WEB-INF/classes
        Throws:
        ArchiverException
      • addWebinf

        public void addWebinf​(java.io.File directoryName,
                              java.lang.String[] includes,
                              java.lang.String[] excludes)
                       throws ArchiverException
        files to add under WEB-INF;
        Throws:
        ArchiverException
      • cleanUp

        protected void cleanUp()
                        throws java.io.IOException
        Make sure we don't think we already have a web.xml next time this task gets executed.
        Overrides:
        cleanUp in class JarArchiver
        Throws:
        java.io.IOException
        See Also:
        AbstractZipArchiver.cleanUp()