简体   繁体   English

Maven GPG插件没有签署源和javadoc jar

[英]Maven GPG plugin not signing sources and javadoc jars

I'm attempting to release my project's artifacts to Sonatype using Maven. 我正在尝试使用Maven将项目的工件发布到Sonatype。 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. 我正在使用Maven GPG插件来签署工件,但它没有签署源和javadoc jar(只是主jar),这是Sonatype所需要的。 Here's what I think are the relevant parts of my pom.xml: 这是我认为我的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? 有没有办法告诉它签署这些其他罐子呢?

These changes to the pom solved the problem: 这些对pom的改变解决了这个问题:

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM