首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在项目播放器上执行目标org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (符号项目)输入:退出代码:1帮助[ -> 1]

无法在项目播放器上执行目标org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (符号项目)输入:退出代码:1帮助[ -> 1]
EN

Stack Overflow用户
提问于 2020-06-07 20:25:45
回答 1查看 659关注 0票数 0

我试图将我的第一个api上传到maven central,但我仍然收到此错误。我还没能解决这个问题。我正在运行mvn clean deploy,我读到运行mvn clean deploy -Dgpg.skip=true可以工作,但它不工作。

代码语言:javascript
复制
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.411 s
[INFO] Finished at: 2020-06-07T14:15:53+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (sign-artifacts) on project playerinputs: Exit code: 1 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

我已经检查了错误中链接的页面,但我不喜欢它

这是我的pom

代码语言:javascript
复制
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.github.MrNemo64</groupId>
    <artifactId>playerinputs</artifactId>
    <version>1.2</version>
    <name>PlayerInputs</name>
    <description>Useful clases to get player inputs in several ways</description>
    <url>https://github.com/MrNemo64/player-inputs</url>

    <licenses>
        <license>
            <name>MIT License</name>
            <url>http://www.opensource.org/licenses/mit-license.php</url>
        </license>
    </licenses>

    <developers>
        <developer>
            <name>Javier Rodríguez Pérez</name>
            <email>my.nemo_64.otravez@gmail.com</email>
            <organization>org.github.MrNemo64</organization>
            <organizationUrl>https://github.com/MrNemo64/player-inputs</organizationUrl>
        </developer>
    </developers>

    <scm>
        <connection>scm:git:git://github.com/MrNemo64/player-inputs.git</connection>
        <developerConnection>scm:git:ssh://github.com:MrNemo64/player-inputs.git</developerConnection>
        <url>https://github.com/MrNemo64/player-inputs</url>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
        <repository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
    </distributionManagement>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.7</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.2.1</version>
                <executions>
                    <execution>
                        <id>attach-sources</id>
                        <goals>
                            <goal>jar-no-fork</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.9.1</version>
                <executions>
                    <execution>
                        <id>attach-javadocs</id>
                        <goals>
                            <goal>jar</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-gpg-plugin</artifactId>
                <version>1.5</version>
                <executions>
                    <execution>
                        <id>sign-artifacts</id>
                        <phase>verify</phase>
                        <goals>
                            <goal>sign</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <repositories>
        <!-- This adds the Spigot Maven repository to the build -->
        <repository>
            <id>spigot-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
    </repositories>

    <dependencies>
        <!--This adds the Bukkit API artifact to the build -->
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.13.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>3.0.2</version>
        </dependency>
    </dependencies>
</project>

如果你需要更多的信息,请告诉我,谢谢你的帮助!

EN

回答 1

Stack Overflow用户

发布于 2021-03-18 03:31:51

在某些情况下,如果您使用gpg插件来签署您的工件,您可能会得到以下错误,构建将失败。

在项目testng上执行目标org.apache.maven.plugins:maven-gpg-plugin:1.5:sign (符号项目)失败-解析器:退出代码:2

如果您得到上面的错误,有几种方法可以跳过工件签名并执行您的构建。

方法1:编辑POM您可以从POM中禁用gbp插件,或者跳过工件的签名。请参阅以下内容。

代码语言:javascript
复制
<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>maven-gpg-plugin</artifactId>
    <configuration>
        <skip>true</skip>
    </configuration>
</plugin>

方法2:在运行时禁用您还可以在运行时通过以下参数运行mvn build来禁用gpg签名。

代码语言:javascript
复制
mvn clean install -Dgpg.skip

或as

代码语言:javascript
复制
mvn clean install -Dgpg.skip=true
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62245285

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档