Package org.codehaus.plexus.archiver.war
Class WarArchiver
- java.lang.Object
-
- org.codehaus.plexus.archiver.AbstractArchiver
-
- org.codehaus.plexus.archiver.zip.AbstractZipArchiver
-
- org.codehaus.plexus.archiver.zip.ZipArchiver
-
- org.codehaus.plexus.archiver.jar.JarArchiver
-
- org.codehaus.plexus.archiver.war.WarArchiver
-
- All Implemented Interfaces:
Archiver
,FinalizerEnabled
@Named("war") public class WarArchiver extends JarArchiver
An extension of <jar> to create a WAR archive. Contains special treatment for files that should end up in theWEB-INF/lib
,WEB-INF/classes
orWEB-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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.codehaus.plexus.archiver.jar.JarArchiver
JarArchiver.FilesetManifestConfig
-
-
Field Summary
-
Fields inherited from class org.codehaus.plexus.archiver.zip.AbstractZipArchiver
addedDirs, addingNewFiles, archiveType, doubleFilePass, duplicate, entries, skipWriting, zipArchiveOutputStream
-
Fields inherited from interface org.codehaus.plexus.archiver.Archiver
DEFAULT_DIR_MODE, DEFAULT_FILE_MODE, DEFAULT_SYMLILNK_MODE, DUPLICATES_ADD, DUPLICATES_FAIL, DUPLICATES_PRESERVE, DUPLICATES_SKIP, DUPLICATES_VALID_BEHAVIORS
-
-
Constructor Summary
Constructors Constructor Description WarArchiver()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addClass(File fileName)
add a file under WEB-INF/lib/void
addClasses(File directoryName, String[] includes, String[] excludes)
add files under WEB-INF/classesvoid
addLib(File fileName)
add a file under WEB-INF/lib/void
addLibs(File directoryName, String[] includes, String[] excludes)
add files under WEB-INF/lib/void
addWebinf(File directoryName, String[] includes, String[] excludes)
files to add under WEB-INF;protected void
cleanUp()
Make sure we don't think we already have a web.xml next time this task gets executed.protected void
initZipOutputStream(ConcurrentJarCreator zOut)
override of parent; validates configuration before initializing the output stream.void
setExpectWebXml(boolean expectWebXml)
Indicates if the client is required to supply web.xmlvoid
setIgnoreWebxml(boolean excpectWebXml)
Deprecated.Use setExpectWebXml instead !void
setWebxml(File descr)
set the deployment descriptor to use (WEB-INF/web.xml); required unlessupdate=true
protected void
zipFile(ArchiveEntry entry, ConcurrentJarCreator zOut, String vPath)
Overridden from ZipArchiver class to deal with web.xml-
Methods inherited from class org.codehaus.plexus.archiver.jar.JarArchiver
addConfiguredIndexJars, addConfiguredManifest, createEmptyZip, createManifest, finalizeZipOutputStream, findJarName, hasVirtualFiles, reset, setFilesetmanifest, setIndex, setManifest, setManifestEncoding, setMinimalDefaultManifest, setZipEntryTime, writeIndexLikeList, zipFile
-
Methods inherited from class org.codehaus.plexus.archiver.zip.AbstractZipArchiver
addResources, close, execute, getArchiveType, getComment, getEncoding, isCompress, isFilesonly, isInUpdateMode, isRecompressAddedZips, isSupportingForced, normalizeLastModifiedTime, revert, setComment, setCompress, setEncoding, setFilesonly, setRecompressAddedZips, setUpdateMode, zipDir
-
Methods inherited from class org.codehaus.plexus.archiver.AbstractArchiver
addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchiveFinalizer, addDirectory, addDirectory, addDirectory, addDirectory, addFile, addFile, addFileSet, addResource, addResources, addSymlink, addSymlink, asArchiveEntry, asResourceCollection, checkForced, configureReproducible, configureReproducibleBuild, createArchive, getDefaultDirectoryMode, getDefaultFileMode, getDestFile, getDirectoryMode, getDuplicateBehavior, getFileMode, getFilenameComparator, getFiles, getIncludeEmptyDirs, getLastModifiedDate, getLastModifiedTime, getLogger, getOverrideDirectoryMode, getOverrideFileMode, getOverrideGid, getOverrideGroupName, getOverrideUid, getOverrideUserName, getRawDefaultFileMode, getResources, isForced, isIgnorePermissions, isUptodate, isUseJvmChmod, postCreateArchive, runArchiveFinalizers, setArchiveFinalizers, setDefaultDirectoryMode, setDefaultFileMode, setDestFile, setDirectoryMode, setDotFileDirectory, setDuplicateBehavior, setFileMode, setFilenameComparator, setForced, setIgnorePermissions, setIncludeEmptyDirs, setLastModifiedDate, setLastModifiedTime, setOverrideGid, setOverrideGroupName, setOverrideUid, setOverrideUserName, setUseJvmChmod, validate
-
-
-
-
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(File descr) throws ArchiverException
set the deployment descriptor to use (WEB-INF/web.xml); required unlessupdate=true
- Throws:
ArchiverException
-
addLib
public void addLib(File fileName) throws ArchiverException
add a file under WEB-INF/lib/- Throws:
ArchiverException
-
addLibs
public void addLibs(File directoryName, String[] includes, String[] excludes) throws ArchiverException
add files under WEB-INF/lib/- Throws:
ArchiverException
-
addClass
public void addClass(File fileName) throws ArchiverException
add a file under WEB-INF/lib/- Throws:
ArchiverException
-
addClasses
public void addClasses(File directoryName, String[] includes, String[] excludes) throws ArchiverException
add files under WEB-INF/classes- Throws:
ArchiverException
-
addWebinf
public void addWebinf(File directoryName, String[] includes, String[] excludes) throws ArchiverException
files to add under WEB-INF;- Throws:
ArchiverException
-
initZipOutputStream
protected void initZipOutputStream(ConcurrentJarCreator zOut) throws ArchiverException, IOException
override of parent; validates configuration before initializing the output stream.- Overrides:
initZipOutputStream
in classJarArchiver
- Parameters:
zOut
-- Throws:
ArchiverException
IOException
-
zipFile
protected void zipFile(ArchiveEntry entry, ConcurrentJarCreator zOut, String vPath) throws IOException, ArchiverException
Overridden from ZipArchiver class to deal with web.xml- Overrides:
zipFile
in classAbstractZipArchiver
- Parameters:
entry
- the file to add to the archivezOut
- the stream to write tovPath
- the name this entry shall have in the archive- Throws:
IOException
ArchiverException
-
cleanUp
protected void cleanUp() throws IOException
Make sure we don't think we already have a web.xml next time this task gets executed.- Overrides:
cleanUp
in classJarArchiver
- Throws:
IOException
- See Also:
AbstractZipArchiver.cleanUp()
-
-