【问题标题】:webstart-maven-plugin can not sign jar due to timestamp request rejection由于时间戳请求被拒绝,webstart-maven-plugin 无法签署 jar
【发布时间】:2018-05-04 06:28:37
【问题描述】:

我们有一个项目使用 webstart-maven-plugin 创建一个 Java Webstart JNLP 工件。

但是在 maven compile 上我总是得到

[ERROR] 未能执行目标 org.codehaus.mojo:webstart-maven-plugin:1.0-beta-6:jnlp-download-servlet (默认)在项目 webstart 上:无法签署 jar ...\target\jnlp\libs\unprocessed_commons-codec-1.10.jar,使用 -X 有详细的错误

使用 -X 运行显示:

jarsigner: 无法签署 jar: java.io.IOException: 错误生成 时间戳:时间戳请求被拒绝。无法识别或 不受支持的算法标识符。

由于this bug,我将我的 JDK 更新为 1.8(仅用于测试目的,因为我目前仍需要 1.7 的产品):

java -version  
java version "1.8.0_172"  
Java(TM) SE Runtime    Environment (build 1.8.0_172-b11)

但我仍然收到上述错误。

要获取我们使用 URL http://sha1timestamp.ws.symantec.com/sha1/timestamp 的时间戳,请参阅下面的 maven 插件配置。

我的问题是:对于我的同事来说,它可以工作,他们有相同的 Java 版本、相同的 maven 项目设置等。 因此,这在我的本地环境中必须是一个问题。有什么想法吗?

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>webstart-maven-plugin</artifactId>
    <version>1.0-beta-6</version>
    <executions>
        <execution>
            <phase>process-resources</phase>
            <goals>
                <goal>jnlp-download-servlet</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <outputJarVersions>true</outputJarVersions>
        <outputDirectoryName>webstart</outputDirectoryName>
        <excludeTransitive>false</excludeTransitive>
        <templateDirectory>src/main/resources/jnlp</templateDirectory>
        <libPath>libs</libPath>
        <verbose>true</verbose>
        <unsignAlreadySignedJars>true</unsignAlreadySignedJars>
        <jnlpFiles>
            <jnlpFile>
                <templateFilename>abc.vm</templateFilename>
                <outputFilename>abc.jnlp</outputFilename>
                <jarResources>
                    ...
                </jarResources>
            </jnlpFile>
        </jnlpFiles>
        <sign>
            <keystore>${pathKeystore}</keystore>
            <storepass>${passstore}</storepass>
            <keypass>${passkey}</keypass>
            <alias>${alias}</alias>
            <tsaLocation>${tsaLocation}</tsaLocation>
            <arguments>
                <argument>-J-Djavax.net.ssl.trustStore=${project.build.directory}/../myTruststore.jks</argument>
                <argument>-J-Djavax.net.ssl.trustStorePassword=myPassword</argument>
                <argument>-J-Djavax.net.ssl.keyStore=${project.build.directory}/../myTruststore.jks</argument>
                <argument>-J-Djavax.net.ssl.keyStorePassword=myPassword</argument>
                <argument>-J-Dhttps.proxyHost=proxy.mycompany.com</argument>
                <argument>-J-Dhttps.proxyPort=3128</argument>
                <argument>-J-Dhttp.proxyHost=proxy.mycompany.com</argument>
                <argument>-J-Dhttp.proxyPort=3128</argument>
            </arguments>

        </sign>
        <unsign>true</unsign> <!-- unsign already signed packages and sign them with own key -->
    </configuration>
</plugin>

...         
<tsaLocation>http://sha1timestamp.ws.symantec.com/sha1/timestamp</tsaLocation>  

【问题讨论】:

    标签: jar-signing maven-webstart-plugin


    【解决方案1】:

    删除时构建工作

    <tsaLocation>${tsaLocation}</tsaLocation>
    

    来自签名配置 --> 没有从时间戳服务器获取时间戳,但 jar 已签名。

    【讨论】:

    • 这仅仅意味着您没有使用任何时间戳服务器,这是不可取的。如果您遵循上述方法,您将收到以下错误:“警告:未提供 -tsa 或 -tsacert,并且此 jar 没有时间戳。如果没有时间戳,用户可能无法在签署者证书到期日期后验证此 jar (2022-07-01) 或任何未来的撤销日期之后。”
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-18
    • 1970-01-01
    • 2019-12-06
    • 1970-01-01
    • 2011-02-06
    相关资源
    最近更新 更多