1. put a bit more design checks in the plugin
2. go to open source.
After some googling I ended up configuring a Sonatype Open Source Project Repository Hosting. This guide is a very good starting point, I'd only like to fill up some holes I felt missing in the guidance.
1. Before creating a JIRA ticket, you have to own a domain, like tindalos.org, and your groupId will reflect it. Simple way to create a domain is through Go Daddy.
2. As the Guide points out, you should install GPG on your computer. I went very smooth on Mac (as opposed to Windows 8)
3. Put the following snippets into your settings.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<servers> | |
... | |
<server> | |
<id>sonatype-nexus-snapshots</id> | |
<username>john.j.rambo</username> | |
<password>rambospass</password> | |
</server> | |
<server> | |
<id>sonatype-nexus-staging</id> | |
<username>john.j.rambo</username> | |
<password>rambospass</password> | |
</server> | |
</servers> | |
.... | |
<profiles> | |
... | |
<profile> | |
<id>gpg</id> | |
<properties> | |
<gpg.passphrase>yourpassphrase</gpg.passphrase> | |
</properties> | |
<repositories> | |
<repository> | |
<id>central-releases</id> | |
<name>Central Repository</name> | |
<url>http://oss.sonatype.org/content/repositories/releases</url> | |
</repository> | |
</repositories> | |
<pluginRepositories> | |
<pluginRepository> | |
<id>central-releases</id> | |
<name>Central Repository</name> | |
<url>http://oss.sonatype.org/content/repositories/releases</url> | |
</pluginRepository> | |
</pluginRepositories> | |
</profile> | |
... | |
</profiles> | |
... |
4. The pom should look like
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<parent> | |
<groupId>org.sonatype.oss</groupId> | |
<artifactId>oss-parent</artifactId> | |
<version>7</version> | |
</parent> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.mygroup</groupId> | |
<artifactId>myproject</artifactId> | |
<version>0.1-SNAPSHOT</version> | |
<name>How Shall I Name You</name> | |
.... | |
<profiles> | |
<profile> | |
<id>gpg</id> | |
<activation> | |
<property> | |
<name>performRelease</name> | |
<value>true</value> | |
</property> | |
</activation> | |
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-gpg-plugin</artifactId> | |
<version>1.4</version> | |
<configuration> | |
<passphrase>${gpg.passphrase}</passphrase> | |
</configuration> | |
<executions> | |
<execution> | |
<id>sign-artifacts</id> | |
<phase>verify</phase> | |
<goals> | |
<goal>sign</goal> | |
</goals> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
</build> | |
</profile> | |
</profiles> | |
<licenses> | |
<license> | |
<name>The Apache Software License, Version 2.0</name> | |
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> | |
<distribution>repo</distribution> | |
</license> | |
</licenses> | |
<scm> | |
<connection>scm:git:https://gitusername@github.com/gitusername/myproject.git</connection> | |
<developerConnection>scm:git:https://gitusername@github.com/gitusername/myproject.git</developerConnection> | |
<url>origin</url> | |
</scm> | |
</project> |
The groupId should match with the one you have specified when creating the JIRA ticket and somehow resemble to the domain you own.
5. run the following commands in command line
mvn release:clean
mvn release:prepare -Pgpg
mvn release:perform -Pgpg
6. Once you released your artifact with mvn release:perform, log in to Sonatype OSS. Find your staging repository, close it, then release (the first time I think you have to Promote, too and comment on your JIRA ticket).
That's it. In a short while you should see your artifacts in the Central Repo.
Thx Tindalos the correct summary.
ReplyDeleteKeep pushing!