【问题标题】:Maven gpg plugin cant find artifactMaven gpg插件找不到工件
【发布时间】:2020-03-12 09:44:30
【问题描述】:

我一直在尝试将我的项目推送到 maven 存储库中,并且我正在尝试正确配置我的 maven gpg 插件,我目前将其用作

                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>

但它似乎无法找到我的工件,因为它给出了 rr

Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.6:sign (default-cli) on project fitnesse-bootstrap-plus-theme: The project artifact has not been assembled yet. Please do not invoke this goal before the lifecycle phase "package".

我的 jar 在根/目标文件夹中生成。

【问题讨论】:

  • 你怎么称呼 Maven?

标签: maven pom.xml maven-gpg-plugin


【解决方案1】:

当您需要安装/部署签名时,您应该将maven-gpg-plugin 绑定到在package 阶段之后和installdeploy 之前执行的阶段verify

所以你的配置看起来像:

                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>

您也可以省略&lt;phase&gt;verify&lt;/phase&gt;,因为maven-gpg-plugin 是默认绑定到正确的阶段。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-05-24
    • 1970-01-01
    • 1970-01-01
    • 2018-04-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多