gpt4 book ai didi

java - Maven jarsigner 插件在发布期间不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:53:39 26 4
gpt4 key购买 nike

我需要对发布的 jar 进行签名,我想使用 maven jarsigner 插件来完成。所以我这样添加:

        <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jarsigner-plugin</artifactId>
<version>1.2</version>
<configuration>
<archive>target/${myarchive}.jar</archive>
<keystore>${key.location}</keystore>
<storepass>${keypass}</storepass>
<alias>${key.alias}</alias>
<verbose>true</verbose>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>

我在命令行中提供了缺少的参数。

当我运行 mvn install 时,一切正常,存档已签名。但是当我运行 release:prepare release:perform 时,jarsigner 插件失败:`The parameters 'alias' for goal org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign are missing or无效'

当我在 Debug模式下运行时,我看到以下内容:

对于 mvn install:

[DEBUG] Configuring mojo org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign from plugin realm ClassRealm[plugin>org.apache.m
aven.plugins:maven-jarsigner-plugin:1.2, parent: sun.misc.Launcher$AppClassLoader@6d6f0472]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign' with basic configurator -->
[DEBUG] (f) alias = myalias
[DEBUG] (f) archive = myarchive
[DEBUG] (f) arguments = []
[DEBUG] (f) keystore = mykeystore
[DEBUG] (f) processAttachedArtifacts = true
[DEBUG] (f) processMainArtifact = true
[DEBUG] (f) project = MavenProject: com.playtech.chat:ums_supportchatapplet:12.4-SNAPSHOT @ *********\pom.xml
[DEBUG] (f) removeExistingSignatures = false
[DEBUG] (f) skip = false
[DEBUG] (f) storepass = changeit
[DEBUG] (f) verbose = true
[DEBUG] -- end configuration --

但是当我运行 release:prepare release:perform 时,我看到:

Configuring mojo org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-jarsigner-plugin:1.2, parent: sun.misc.Launcher$AppClassLoader@553f5d07]
[INFO] [DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jarsigner-plugin:1.2:sign' with basic configurator -->
[INFO] [DEBUG] (f) archive = myarchive
[INFO] [DEBUG] (f) arguments = []
[INFO] [DEBUG] (f) processAttachedArtifacts = true
[INFO] [DEBUG] (f) processMainArtifact = true
[INFO] [DEBUG] (f) project = MavenProject: com.playtech.chat:ums_supportchatapplet:12.4.0.1 @ *****\pom.xml
[INFO] [DEBUG] (f) removeExistingSignatures = false
[INFO] [DEBUG] (f) skip = false
[INFO] [DEBUG] (f) verbose = true
[INFO] [DEBUG] -- end configuration --

所以除了archive属性,其他属性在发布时都被忽略了。

非常感谢任何想法。

最佳答案

找到答案了。

简而言之,-D 参数不会从命令行传递到发布插件。
应使用 -Darguments=

有关更多详细信息,请阅读此 blog post这帮助我解决了这个问题。

关于java - Maven jarsigner 插件在发布期间不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10698558/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com