diff --git a/WHATSNEW b/WHATSNEW index 466c356d5..ad8acd175 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -24,6 +24,9 @@ Fixed bugs: Other changes: -------------- + * strict attribute added to . + Bugzilla Report 54889. + Changes from Ant 1.8.4 TO Ant 1.9.0 =================================== @@ -127,7 +130,8 @@ Other changes: archives using Zip64 extensions (files and archives bigger that 4GB and with more that 64k entries). - * a new task can be used to configure the + * a new task can be used to configure the CommandLauncher used by Ant when forking external programs or new Java VMs. Bugzilla Report 52706. diff --git a/manual/Tasks/signjar.html b/manual/Tasks/signjar.html index d6f84be4a..d73f73f48 100644 --- a/manual/Tasks/signjar.html +++ b/manual/Tasks/signjar.html @@ -99,6 +99,11 @@ and lazy is false, the JAR is signed. (true | false) verbose output when signing No; default false + + strict + (true | false) strict checking when signing.
since Ant 1.9.1. + No; default false + internalsf (true | false) include the .SF file inside the signature diff --git a/manual/Tasks/verifyjar.html b/manual/Tasks/verifyjar.html new file mode 100644 index 000000000..4be278811 --- /dev/null +++ b/manual/Tasks/verifyjar.html @@ -0,0 +1,145 @@ + + + + + + +VerifyJar Task + + + + +

VerifyJar

+

Description

+

Verifies JAR files with the jarsigner command line tool. +It will take a named file in the jar attribute. Nested paths are also +supported +

+ + +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
jarthe jar file to verifyYes, unless nested paths have + been used.
aliasthe alias to verify underYes.
storepasspassword for keystore integrity.Yes.
keystorekeystore locationNo
storetypekeystore typeNo
keypasspassword for private key (if different)No
certificates(true | false) display information about certificatesNo; default false
verbose(true | false) verbose output when verifyingNo; default false
strict(true | false) strict checking when verifying.
since Ant 1.9.1.
No; default false
maxmemorySpecifies the maximum memory the jarsigner VM will use. Specified in the + style of standard java memory specs (e.g. 128m = 128 MBytes)No
executableSpecify a particular jarsigner executable + to use in place of the default binary (found in the same JDK as + Apache Ant is running in).
+ Must support the same command line options as the Sun JDK + jarsigner command. + since Ant 1.8.0.
No
+

Parameters as nested elements

+ + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
pathpath of JAR files to verify. since Ant 1.7No
filesetfileset of JAR files to verify. No
syspropertyJVM system properties, with the syntax of Ant + environment variables No, and only one can be supplied
+ + +

Examples

+
+<verifyjar jar="${dist}/lib/ant.jar"
+alias="apache-group" storepass="secret"/>
+
+

+ verifies the ant.jar with alias "apache-group" accessing the + keystore and private key via "secret" password. +

+ + + + + + diff --git a/manual/tasklist.html b/manual/tasklist.html index 716744ca0..6578e55b2 100644 --- a/manual/tasklist.html +++ b/manual/tasklist.html @@ -180,6 +180,7 @@
  • Unwar
  • Unzip
  • Uptodate
  • +
  • VerifyJar
  • Microsoft Visual SourceSafe Tasks
  • Waitfor
  • War
  • diff --git a/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java b/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java index a61ff8f0f..d0b80618e 100644 --- a/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/AbstractJarSignerTask.java @@ -66,6 +66,11 @@ public abstract class AbstractJarSignerTask extends Task { * verbose output */ protected boolean verbose; + /** + * strict checking + * @since Ant 1.9.1 + */ + protected boolean strict = false; /** * The maximum amount of memory to use for Jar signer */ @@ -184,6 +189,15 @@ public abstract class AbstractJarSignerTask extends Task { this.verbose = verbose; } + /** + * do strict checking + * @since Ant 1.9.1 + * @param strict + */ + public void setStrict(boolean strict) { + this.strict = strict; + } + /** * Adds a set of files to sign * @@ -289,6 +303,10 @@ public abstract class AbstractJarSignerTask extends Task { addValue(cmd, "-verbose"); } + if (strict) { + addValue(cmd, "-strict"); + } + //now patch in all system properties for (Environment.Variable variable : sysProperties.getVariablesVector()) { declareSysProperty(cmd, variable);