Signs a WAR file. This task can remove existing signing data and add jar manifest attributes to application jars in the configured WAR file, before signing the jars with the provided certificate.
The most common use case is to sign WAR files before deployment to production, or resign in case of expired certificate.
A second common use case is to resign webstart WAR files to ensure that
all jars are signed with the same certificate and at the same time make
sure that the Permissions: all-permissions attributed required
with Java 8 and onwards is always set.
| Type | Name and description |
|---|---|
AddAttributes |
adderThe add-attributes implementation. |
java.util.List<java.lang.String> |
attributesLists jar manifest attributes to be added. |
RemoveSigningData |
cleanerThe signing data cleaner used for removing existing signing data. |
java.lang.Boolean |
signIndicates whether to sign application jar files in the WAR file. |
com.brambolt.util.jar.SignWithJarsigner |
signerThe jar signer implementation used for signing. |
java.lang.Boolean |
unsignIndicates whether signing data should be removed before signing. |
java.lang.Object |
warThe WAR file to process. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
void |
apply()The task action. |
|
protected java.io.File |
apply(java.io.File dir) |
|
protected void |
applyToJar(java.nio.file.Path jarPath) |
|
org.gradle.api.Task |
configure(groovy.lang.Closure closure)Configures the task. |
|
void |
configureAdder()Initializes the attribute adder if an implementation was not provided during configuration. |
|
void |
configureCleaner()Initializes the attribute cleaner if an implementation was not provided during configuration. |
|
void |
configureDefaults()Configures defaults. |
|
void |
configureJarsigner()Initializes the jar signer implementation if an implementation was not provided during configuration. |
|
boolean |
shouldExecute() |
| Methods inherited from class | Name |
|---|---|
class SigningTask |
checkConfiguration, configureSigningParameters, findJavaHome, printConfiguration, trySigningParametersFromCli |
The add-attributes implementation.
Lists jar manifest attributes to be added. Empty by default.
The signing data cleaner used for removing existing signing data.
Indicates whether to sign application jar files in the WAR file.
The jar signer implementation used for signing.
Indicates whether signing data should be removed before signing.
The WAR file to process. The value can be a string path, a file, a path object, or a closure that produces any of these.
The task action.
Configures the task. The task should be configured at least once, to make sure defaults are established.
closure - The configuration closureInitializes the attribute adder if an implementation was not provided during configuration. Subsequent invocations do nothing unless the value is explicitly cleared.
Initializes the attribute cleaner if an implementation was not provided during configuration. Subsequent invocations do nothing unless the value is explicitly cleared.
Configures defaults.
Initializes the jar signer implementation if an implementation was not provided during configuration. Subsequent invocations do nothing unless the value is explicitly cleared.