-
[MAVEN] signer un jar
Bonjour,
Actuellement je migre un petit projet de ant vers maven. ant possédait un goal signjar qui marchait comme suit :
Code:
<signjar jar="${client.path}/App/monApp.jar" alias="${keystore.alias}" storepass="${keystore.storepass}" keystore="${keystore.location}"/>
Cependant je ne trouve pas l'équivalent sous maven. Pourtant je suppose que les utilisateurs de maven utilise bien des jars signés aussi ?
Qui connaitrait donc un moyen propre de signer ces jars par maven ?
-
Salut,
A mon avis tu peux y arriver en utilisant le plugin 'maven-antrun-plugin', inspire toi du site de maven à cette adresse http://maven.apache.org/plugins/mave...gin/usage.html
sinon tu peux toujours développer ton Mojo (plugin Maven) en utilisant l'API Java de Ant
fait signe de tes résultats, ca pourrait m'intéresser ;)
-
le plugin jar permet de signer des jars, mais le site n'est pas encore à jour. Voici ce qu'il y a dans la doc:
* How to configure jar:sign using pom.xml
If you need to sign a jar, when using the 'jar' packaging, you just need to configure
the sign goal appropriately for the signing to occur automatically during the package phase.
Note that you can automatically verify a jar after signing it.
-------------------
<project>
...
<packaging>jar</packaging>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<keystore>/path/to/your/keystore</keystore>
<alias>youralias</alias>
<storepass>yourstorepassword</storepass>
<!--signedjar>${project.build.directory}/signed/${project.build.finalName}.jar</signedjar-->
<verify>true</verify>
</configuration>
</plugin>
</plugins>
</build>
</project>
-------------------
If you do not specify the signedjar file, your jar will be signed in-place.
If you do specify it, the program will attempt to create the resulting containing directory.
* How to use jar:sign specifying parameters on the command line
-------------------
mvn jar:sign -Dkeystore=/path/to/your/keystore -Dstorepass=yourstorepassword -Dalias=youralias
-------------------
* How to use jar:sign-verify specifying parameters on the command line
-------------------
mvn jar:sign-verify [-Djarpath=/path/to/your/signedjar] [-Dverbose=true [-Dcheckcerts=true] ]
-------------------
* How to disable jar signing
-------------------
mvn ... -Dmaven.jar.skip.sign=true
-------------------
-
En fin de compte puisque je voulais produire un jnlp et que le plugin jnlp permet de signer tous les jars associés, j'ai utilisé cette méthode.