7

I use ant for sign my jars for web-start deployment. Ant.signjar is very slow when web-start signing. How to speedup signing process ?

jreznot
  • 2,694
  • 2
  • 35
  • 53
  • 1
    How many jars do you sign? – Dan D. Jan 21 '13 at 12:41
  • 1
    +1, I face same problem. It would be good if `Ant` can check if target exists and it is signed, so just skip signing again. – Nikolay Kuznetsov Jan 21 '13 at 12:43
  • I believe ant does check if target is signed with the correct key before signing. That's been my experience when I use ant.signjar from within Gradle. (and I'm not using Gradle's incremental build with the inputs and outputs, it's ant.signjar that is skipping the signing). – Jason Nov 07 '13 at 21:26

2 Answers2

2

I found one possible solution.

Earlier in build script ant.signjar called sequentially for all jars (We use gradle for build, more than 20 MB dependecies). Now i use groovy library GPars methods: withPool(4) and eachParallel { ant.signjar }. It is cool for 2 cores in my pc and 4 cores in build server. (for 3 times faster)

Second trick is cache: we use cached signed jars for all RELEASE/NON-SNAPSHOT dependencies. When we run build without clean, it runs faster because uses cached signed libs from build directory.

jreznot
  • 2,694
  • 2
  • 35
  • 53
  • 1
    This is exactly what I'm looking to do, how did you go about caching 3rd party signed jars? I'm using a nexus repo, but I'd like to sign jars in this repo and not have to worry about doing anything manual when we upgrade versions of our dependencies. – Tom Hartwell Feb 15 '14 at 02:17
0

I generally use 2 targets: one to sign the whole project and one to only sign my jars. So the latter will not re-sign dependencies and make the signing process much quicker.

assylias
  • 321,522
  • 82
  • 660
  • 783