Skip to content

Commit

Permalink
Prepare publishing binaries to maven central via sonatype OSS reposit…
Browse files Browse the repository at this point in the history
…ory hosting (#656)

* Prepare publishing binaries to maven central via sonatype OSS repository hosting
  • Loading branch information
matthiasblaesing authored Jun 17, 2016
1 parent 3a803b7 commit 494959b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 23 deletions.
8 changes: 4 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@
<property name="pom-platform" value="pom-jna-platform.xml" />

<!-- defined maven snapshots and staging repository id and url -->
<property name="maven-snapshots-repository-id" value="snapshots.java.net" />
<property name="maven-snapshots-repository-url" value="https://maven.java.net/content/repositories/snapshots/" />
<property name="maven-staging-repository-id" value="staging.java.net" />
<property name="maven-staging-repository-url" value="https://maven.java.net/service/local/staging/deploy/maven2/" />
<property name="maven-snapshots-repository-id" value="oss.sonatype.org" />
<property name="maven-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots/" />
<property name="maven-staging-repository-id" value="oss.sonatype.org" />
<property name="maven-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" />

<!-- Miscellaneous -->
<property name="build.compiler.emacs" value="true"/>
Expand Down
8 changes: 8 additions & 0 deletions pom-jna-platform.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@
<role>Owner</role>
</roles>
</developer>
<developer>
<email>[email protected]</email>
<name>Matthias Bläsing</name>
<url>https://github.com/matthiasblaesing/</url>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>

<dependencies>
Expand Down
8 changes: 8 additions & 0 deletions pom-jna.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@
<role>Owner</role>
</roles>
</developer>
<developer>
<email>[email protected]</email>
<name>Matthias Bläsing</name>
<url>https://github.com/matthiasblaesing/</url>
<roles>
<role>Developer</role>
</roles>
</developer>
</developers>

</project>
37 changes: 18 additions & 19 deletions www/PublishingToMavenCentral.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,31 @@ Publishing JNA to Maven Central
One Time
--------

* Create an account in the [sonatype jira](https://issues.sonatype.org/secure/Signup!default.jspa)
* Get the account enabled for publishing to the net.java.dev.jna groupId
(contact an existing uploader for this)
* Set up your gpg keys as described [here](http://central.sonatype.org/pages/working-with-pgp-signatures.html). Make sure you distribute your public key.
* Make sure you have a settings.xml file (in directory: ${user.home}/.m2/). For example:
* Make sure you have a settings.xml file (in directory: ${user.home}/.m2/).
For example (Replace *myossrhuser* and *myossrhpwd* with the account credentials):

<settings>
...
<servers>
...
<!-- java.net repos for sync to maven central -->
<server>
<id>snapshots.java.net</id>
<username>myjavanetuser</username>
<password>myjavanetpwd</password>
</server>
<server>
<id>staging.java.net</id>
<username>myjavanetuser</username>
<password>myjavanetpwd</password>
<id>oss.sonatype.org</id>
<username>myossrhuser</username>
<password>myossrhpwd</password>
</server>
...
</servers>
...
<settings>

Because we are still deploying to maven repositories via java.net, see [Java.net Maven Repository Usage Guide](http://java.net/projects/maven2-repository/pages/MigrationAndCleanupRelatedDocumentation) for more info.
The binaries are hosted in the Sonatype OSSRH (OSS Repository Hosting) system,
and mirrored from there to maven central.

See [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more info.

Publish Snapshot
----------------
Expand All @@ -37,9 +38,9 @@ Publish Snapshot
Before doing a full jna release, we can publish a development SNAPSHOT of the "next" release for people to test. The
SNAPSHOT will be published in the staging repository:

https://maven.java.net/content/repositories/snapshots/
[https://oss.sonatype.org/content/repositories/snapshots/](https://oss.sonatype.org/content/repositories/snapshots/)

see: https://maven.java.net/content/repositories/snapshots/net/java/dev/jna/ for the various jars.
see: [https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/](https://oss.sonatype.org/content/repositories/snapshots/net/java/dev/jna/) for the various jars.

To publish a development SNAPSHOT do the following:

Expand All @@ -52,10 +53,8 @@ full release is performed).
Publish Release
---------------

* Verify the &lt;version> tags in [pom-jna.xml](https://github.com/java-native-access/jna/blob/master/pom-jna.xml) and [pom-jna-platform.xml](https://github.com/java-native-access/jna/blob/master/pom-jna-platform.xml)
* Verify the &lt;version> tags in [pom-jna.xml](https://github.com/java-native-access/jna/blob/master/pom-jna.xml)
and [pom-jna-platform.xml](https://github.com/java-native-access/jna/blob/master/pom-jna-platform.xml)
match the version (jna.version) in [build.xml](https://github.com/java-native-access/jna/blob/master/build.xml).
* Run `ant -Dmaven-release=true stage`. This uploads current checkout to [maven.java.net](https://maven.java.net).
* Follow steps from [Releasing the Deployment](http://central.sonatype.org/pages/releasing-the-deployment.html).
Note that the releases are managed from [maven.java.net](https://maven.java.net).


* Run `ant -Dmaven-release=true stage`. This uploads current checkout to [oss.sonatype.org](https://oss.sonatype.org).
* Follow steps from [Releasing the Deployment](http://central.sonatype.org/pages/releasing-the-deployment.html).

0 comments on commit 494959b

Please sign in to comment.