public class WarArchiver extends JarArchiver
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.
JarArchiverJarArchiver.FilesetManifestConfig| Modifier and Type | Field and Description |
|---|---|
private java.io.File |
deploymentDescriptor
our web.xml deployment descriptor
|
private boolean |
descriptorAdded
flag set if the descriptor is added
|
private boolean |
expectWebXml
flag set if finding the webxml is to be expected.
|
addedDirs, addingNewFiles, archiveType, doubleFilePass, duplicate, entries, skipWriting, zipArchiveOutputStreamDEFAULT_DIR_MODE, DEFAULT_FILE_MODE, DEFAULT_SYMLILNK_MODE, DUPLICATES_ADD, DUPLICATES_FAIL, DUPLICATES_PRESERVE, DUPLICATES_SKIP, DUPLICATES_VALID_BEHAVIORS, ROLE| Constructor and Description |
|---|
WarArchiver() |
| Modifier and Type | Method and Description |
|---|---|
void |
addClass(java.io.File fileName)
add a file under WEB-INF/lib/
|
void |
addClasses(java.io.File directoryName,
java.lang.String[] includes,
java.lang.String[] excludes)
add files under WEB-INF/classes
|
void |
addLib(java.io.File fileName)
add a file under WEB-INF/lib/
|
void |
addLibs(java.io.File directoryName,
java.lang.String[] includes,
java.lang.String[] excludes)
add files under WEB-INF/lib/
|
void |
addWebinf(java.io.File directoryName,
java.lang.String[] includes,
java.lang.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.xml
|
void |
setIgnoreWebxml(boolean excpectWebXml)
Deprecated.
Use setExpectWebXml instead !
|
void |
setWebxml(java.io.File descr)
set the deployment descriptor to use (WEB-INF/web.xml);
required unless update=true
|
protected void |
zipFile(ArchiveEntry entry,
ConcurrentJarCreator zOut,
java.lang.String vPath)
Overridden from ZipArchiver class to deal with web.xml
|
addConfiguredIndexJars, addConfiguredManifest, createEmptyZip, finalizeZipOutputStream, findJarName, grabFilesAndDirs, hasVirtualFiles, reset, setFilesetmanifest, setIndex, setManifest, setManifestEncoding, writeIndexLikeList, zipFileaddResources, close, createInputStreamSupplier, execute, getArchiveType, getComment, getEncoding, isCompress, isFilesonly, isInUpdateMode, isRecompressAddedZips, isSupportingForced, revert, setComment, setCompress, setEncoding, setFilesonly, setRecompressAddedZips, setUpdateMode, zipDiraddArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchiveFinalizer, addDirectory, addDirectory, addDirectory, addDirectory, addFile, addFile, addFileSet, addResource, addResources, addSymlink, addSymlink, asArchiveEntry, asResourceCollection, checkForced, contextualize, createArchive, getDefaultDirectoryMode, getDefaultFileMode, getDestFile, getDirectoryMode, getDuplicateBehavior, getFileMode, getFiles, getIncludeEmptyDirs, getLogger, getOverrideDirectoryMode, getOverrideFileMode, getRawDefaultFileMode, getResources, isForced, isIgnorePermissions, isUptodate, isUseJvmChmod, runArchiveFinalizers, setArchiveFinalizers, setDefaultDirectoryMode, setDefaultFileMode, setDestFile, setDirectoryMode, setDotFileDirectory, setDuplicateBehavior, setFileMode, setForced, setIgnorePermissions, setIncludeEmptyDirs, setUseJvmChmod, validateprivate java.io.File deploymentDescriptor
private boolean expectWebXml
private boolean descriptorAdded
@Deprecated public void setIgnoreWebxml(boolean excpectWebXml)
excpectWebXml - true if web xml is *expected* from the clientpublic void setExpectWebXml(boolean expectWebXml)
excpectWebXml - true if web xml is *expected* from the clientpublic void setWebxml(java.io.File descr)
throws ArchiverException
ArchiverExceptionpublic void addLib(java.io.File fileName)
throws ArchiverException
ArchiverExceptionpublic void addLibs(java.io.File directoryName,
java.lang.String[] includes,
java.lang.String[] excludes)
throws ArchiverException
ArchiverExceptionpublic void addClass(java.io.File fileName)
throws ArchiverException
ArchiverExceptionpublic void addClasses(java.io.File directoryName,
java.lang.String[] includes,
java.lang.String[] excludes)
throws ArchiverException
ArchiverExceptionpublic void addWebinf(java.io.File directoryName,
java.lang.String[] includes,
java.lang.String[] excludes)
throws ArchiverException
ArchiverExceptionprotected void initZipOutputStream(ConcurrentJarCreator zOut) throws ArchiverException, java.io.IOException
initZipOutputStream in class JarArchiverzOut - ArchiverExceptionjava.io.IOExceptionprotected void zipFile(ArchiveEntry entry, ConcurrentJarCreator zOut, java.lang.String vPath) throws java.io.IOException, ArchiverException
zipFile in class AbstractZipArchiverentry - the file to add to the archivezOut - the stream to write tovPath - the name this entry shall have in the archivejava.io.IOExceptionArchiverExceptionprotected void cleanUp()
throws java.io.IOException
cleanUp in class JarArchiverjava.io.IOExceptionAbstractZipArchiver.cleanUp()