public class WarHacker extends Object
Constructor and Description |
---|
WarHacker(Path warFile)
Creates a WAR Hacker with a base JIRA WAR file.
|
Modifier and Type | Method and Description |
---|---|
void |
addOperation(WarOperation operation) |
void |
addUpgradeTask(Class<? extends UpgradeTask> upgradeTaskClass)
Adds an upgrade task to the WAR and configures it with the next build number.
|
void |
excludeLibs(String... fileNames)
Exclude JAR files from WEB-INF/lib in the target WAR by name.
|
void |
incrementBuildNumber()
Registers a change to increment JIRA's build number by one.
|
void |
incrementVersionString()
Registers a change to increment JIRA's version by one.
|
void |
overrideBuildNumber(java.util.function.Function<String,String> buildNumberTransform)
Registers a change to modify the build number of JIRA.
|
void |
overrideVersion(java.util.function.Function<String,String> versionTransform)
Registers a change to modify the build number of JIRA.
|
void |
writeWarFile(Path destinationFile)
Write a new WAR file with all registered modifications.
|
public WarHacker(Path warFile)
warFile
- the JIRA WAR file to use as the base.public void addOperation(WarOperation operation)
public void overrideBuildNumber(java.util.function.Function<String,String> buildNumberTransform)
buildNumberTransform
- how to generate new build number from the old one.public void overrideVersion(java.util.function.Function<String,String> versionTransform)
versionTransform
- how to generate new build number from the old one.public void incrementBuildNumber()
public void incrementVersionString()
public void excludeLibs(String... fileNames)
fileNames
- the names of the files in WEB-INF/lib to exclude. Do not include path.public void addUpgradeTask(Class<? extends UpgradeTask> upgradeTaskClass)
upgradeTaskClass
- the upgrade task class.public void writeWarFile(Path destinationFile) throws IOException
destinationFile
- the new WAR file to generate.IOException
- if an I/O error occurs reading the original WAR or writing the modified WAR.Copyright © 2002-2022 Atlassian. All Rights Reserved.