Maven GPG插件未签名源和Javadoc jar [英] Maven GPG plugin not signing sources and javadoc jars

查看:112
本文介绍了Maven GPG插件未签名源和Javadoc jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Maven将项目的工件发布到Sonatype.我正在使用Maven GPG插件对构件进行签名,但未对Sonatype所需的源文件和Javadoc jar(仅是主jar)进行签名.我认为这是我pom.xml的相关部分:

I'm attempting to release my project's artifacts to Sonatype using Maven. I'm using the Maven GPG plugin to sign the artifacts, but it's not signing the sources and javadoc jars (just the main jar), which is required by Sonatype. Here's what I think are the relevant parts of my pom.xml:

<plugins>
    ...
    <plugin>
        <artifactId>maven-source-plugin</artifactId>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <phase>install</phase>
                    <goals>
                        <goal>jar-no-fork</goal>
                    </goals>
                </execution>
            </executions>
    </plugin>
    <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
            <execution>
                <id>attach-javadocs</id>
                <phase>install</phase>
                <goals>
                    <goal>jar</goal>
                </goals>
                </execution>
        </executions>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
        <executions>
            <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                    <goal>sign</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    ...
</plugins>

有没有办法告诉它在其他罐子上签名?

Is there any way to tell it to sign these others jars too?

推荐答案

这些对pom的更改解决了该问题:

These changes to the pom solved the problem:

<plugins>
    ...
    <plugin>
        <artifactId>maven-source-plugin</artifactId>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
    </plugin>
    <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <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.4</version>
        <executions>
            <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                    <goal>sign</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    ...
</plugins>

这篇关于Maven GPG插件未签名源和Javadoc jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆