Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven GPG plugin not signing sources and javadoc jars

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?

like image 633
Tyler Treat Avatar asked Feb 17 '13 10:02

Tyler Treat


1 Answers

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>
like image 148
Tyler Treat Avatar answered Sep 21 '22 18:09

Tyler Treat