Class WarArchiveMerger
- java.lang.Object
-
- org.codehaus.cargo.module.webapp.merge.WarArchiveMerger
-
- All Implemented Interfaces:
MergeProcessor
public class WarArchiveMerger extends Object implements MergeProcessor
Class for merging two War Archives into each other.
-
-
Constructor Summary
Constructors Constructor Description WarArchiveMerger()
Constructor Class for merging War archives together.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMergeItem(Object mergeItem)
Add an item to be merged.void
addMergeProcessor(String path, MergeProcessor merger)
Add a merging processor that merges specified items witin the war files.WebXmlMerger
getWebXmlMerger()
Get the class used for web xml merging.Object
performMerge()
Perform the merge.void
performMerge(File targetFile)
Perform the archive merge, using the specified file as the output destination.void
setMergeJarFiles(boolean doMergeJarFiles)
Control whether the merge should include JAR files.
-
-
-
Method Detail
-
addMergeProcessor
public void addMergeProcessor(String path, MergeProcessor merger)
Add a merging processor that merges specified items witin the war files.- Parameters:
path
- in the path to merge tomerger
- in the merger
-
addMergeItem
public void addMergeItem(Object mergeItem) throws MergeException
Add an item to be merged.- Specified by:
addMergeItem
in interfaceMergeProcessor
- Parameters:
mergeItem
- in the item to merge.- Throws:
MergeException
- on exceptions
-
performMerge
public Object performMerge()
Perform the merge.- Specified by:
performMerge
in interfaceMergeProcessor
- Returns:
- the merged artifact
-
performMerge
public void performMerge(File targetFile) throws IOException, org.jdom2.JDOMException
Perform the archive merge, using the specified file as the output destination.- Parameters:
targetFile
- The target file to output to.- Throws:
org.jdom2.JDOMException
- If a JDOM exception occursIOException
- If an IO exception occurs
-
setMergeJarFiles
public void setMergeJarFiles(boolean doMergeJarFiles)
Control whether the merge should include JAR files.- Parameters:
doMergeJarFiles
- true if we do (default)
-
getWebXmlMerger
public WebXmlMerger getWebXmlMerger()
Get the class used for web xml merging.- Returns:
- the Web XML Merger
-
-