...
After that, any future releases that you promote from the staging repository will be automatically synced to Central (within a few hours).
Generating JavaDoc via Maven
Add the following to your pom.xml to generate a *-javadoc.jar alongside each JAR that is output during the package phase of your build:
Code Block | ||
---|---|---|
| ||
<build> <plugins> <!-- More plugins... --> <!-- Maven JavaDoc Plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.10.4</version> <configuration> <show>private</show> <nohelp>true</nohelp> </configuration> <executions> <execution> <id>attach-javadocs</id> <phase>package</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <!-- More plugins... --> </plugins> </build> |
Generating Sources via Maven
Add the following to your pom.xml to generate a *-sources.jar alongside each JAR that is output during the package phase of your build:
Code Block | ||
---|---|---|
| ||
<build> <plugins> <!-- More plugins... --> <!-- Maven Sources Plugin --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> <version>3.0.1</version> <executions> <execution> <id>attach-sources</id> <phase>package</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> <!-- More plugins... --> </plugins> </build> |
Signing Your Artifacts via Maven
See http://central.sonatype.org/pages/working-with-pgp-signatures.html
...
Code Block | ||
---|---|---|
| ||
export GPG_TTY=$(tty) |
Generate and Upload a Keypair
If you don't already have one, you will need to generate a GPG key with which you can sign your artifacts.
...
Code Block | ||
---|---|---|
| ||
$ gpg --gen-key |
...
Once you have generated a keypair, you will need to upload your public key to a public keyserver.
...
This will output a .asc file that should be included alongside the file that produced the signature.
Verifying GPG Signatures
As a consumer, you can then verify the authenticity of the Maven artifacts by using the gpg command line tool:
...