Gradle - Signing Web Launch Jar

I am currently creating a Gradle construct for a Java Web Start Swing Application. It mainly uses the steps described at: http://www.apprenticeshipnotes.org/2013/01/generating-webstart-files-using-gradle.html

The huge problem with building Gradle is that we waste time signing immutable JARs every time we build (by far the most time spent) to build the application.

I've been looking at Gradle code on Github looking for other recipes that might point me in the right direction, but I can't figure out how I'm going to go from a set of tasks that take build artifacts of an existing configuration, sign them, and then link them in an application with something much more efficient.

My idea was to be able to resolve dependencies and then determine if there was a "signed" version of that dependency in the repository. If there was no signed dependency, the assembly will sign this artifact and upload to the repository.

The simpler approach I was trying to do is a project that takes the application's project runtime configuration and somehow iterates over dependencies, signs and downloads artifacts to the repo, but it's not clear to me how I can do this using the configuration API. Just getting in the config files is not enough, because I would like to get dependency information for each JAR file.

It also gets a little more difficult to download the JAR because if for example I download a signed jar like metrics-json-3.0.2.jar as metrics-json-signed-3.0.2.jar I will need to update the POM for the link for signed artifacts. It looks like there should be a simpler approach

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>com.codahale.metrics</groupId> <artifactId>metrics-parent</artifactId> <version>3.0.2</version> </parent> <artifactId>metrics-json</artifactId> <name>Jackson Integration for Metrics</name> <packaging>bundle</packaging> <description> A set of Jackson modules which provide serializers for most Metrics classes. </description> <dependencies> <dependency> <groupId>com.codahale.metrics</groupId> <artifactId>metrics-core</artifactId> <version>${project.version}</version> </dependency> <dependency> <groupId>com.codahale.metrics</groupId> <artifactId>metrics-healthchecks</artifactId> <version>${project.version}</version> <optional>true</optional> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${jackson.version}</version> </dependency> </dependencies> </project>

Please note that this is different from the signing mechanism provided by the existing signing plugin: http://www.gradle.org/docs/current/userguide/signing_plugin.html

+3


source to share





All Articles