【发布时间】:2014-01-14 08:31:36
【问题描述】:
我想使用以下 maven-script 为我的 jars 签名以用于 webstart 应用程序:
<plugin>
<inherited>false</inherited>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>signWebJars</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<mkdir dir="${project.build.directory}/signedjars" />
<signjar destDir="${project.build.directory}/signedjars"
tsaurl="http://timestamp.my-tsa-url.com"
alias="server" keystore="src/main/assembly/MyKeystore.jks"
storepass="password" preservelastmodified="true" lazy="true">
<path>
<fileset dir="${project.build.directory}/dependenciesForSign"
includes="*.jar" />
</path>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
因为我在代理后面,所以我在 settings.xml 中配置了一个,maven 可以访问互联网。现在我需要联系证书颁发机构的 tsaurl。但是对于给定的 ant 任务,这是行不通的:
[signjar] jarsigner: unable to sign jar: no response from the Timestamping Authority. When connecting from behind a firewall then an HTTP proxy may need to be specified. Supply the following options to jarsigner:
[signjar] -J-Dhttp.proxyHost=<hostname>
[signjar] -J-Dhttp.proxyPort=<portnumber>
我尝试向 ant 任务提供代理信息,但这不起作用。在Ant Signjar Task 的手册中我刚刚发现:Ant 尚不支持此签名过程的代理设置。
我怎样才能让它工作?或者您是否建议另一种方法来签署文件夹中的所有 jar - 当然还有代理支持?
【问题讨论】:
-
你得到答案了吗?
-
否,但找到了一种无需代理的方法。将切换到 maven 签名 jar 插件,该插件可以签名我的项目 AMD 的所有依赖项,而不仅仅是项目工件 jar。
标签: java maven ant proxy maven-antrun-plugin