Si vous utilisez maven-jar-plugin
, vous pouvez spécifier unique pot à signer en utilisant le paramètre "jarPath". La configuration suivante provoque le pot-avec-dépendances fichier à signer à la place du fichier jar-moins de dépendance:
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>sign</goal>
</goals>
</execution>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- NOTE: The secret key is in shared version control. The
password is in shared version control. This IS NOT
SECURE. It's intended to help avoid accidentally
loading the wrong class, nothing more. -->
<jarPath>${project.build.directory}/${project.build.FinalName}-${project.packaging}-with-dependencies.${project.packaging}</jarPath>
<keystore>${basedir}/keystore</keystore>
<alias>SharedSecret</alias>
<storepass>FOO</storepass>
</configuration>
</plugin>
Si vous voulez signer les deux, je ne sais pas comment faire avec maven-jar-plugin
, donc vous devrez peut-être regarder dans les autres options mentionnées ci-dessus.
Ce serait un paramètre plugin jarsigner (http://maven.apache.org/plugins/maven-jarsigner-plugin/sign-mojo.html#archiveDirectory), mais la cible est pas une bonne valeur. Le répertoire cible ne correspond pas à la racine du fichier jar désiré. – Eero