- keystoreを予め作っておく
- jarをおいておくフォルダを予め作っておく
- maven-jar-pluginでjarを作る
- maven-jarsigner-pluginで署名付きjarを作る
1.2.はmavenを走らせる前に予め作っておきました。3.4. はcompileのフェーズで実行。サンプルのpom.xmlは以下:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>make-a-jar</id>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<includes>
<include><!-- Include files--></include>
</includes>
<outputDirectory><!-- Output directory --></outputDirectory>
<finalName><!-- jar name --></finalName>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version>
<configuration>
<archive><!-- jar file --></archive>
<keystore><!-- keystore file --></keystore>
<storepass><!-- password--></storepass>
<alias><!-- alias --></alias>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<id>sign-a-jar</id>
<phase>compile</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
http://maven.apache.org/plugins/maven-jar-plugin/usage.html
http://stackoverflow.com/questions/3598424/jar-signing-strategy-in-maven-projects
http://stackoverflow.com/questions/4757426/maven-specify-the-outputdirectory-only-for-packaging-a-jar
0 件のコメント:
コメントを投稿