Skip to content

Latest commit

 

History

History
56 lines (47 loc) · 1.89 KB

MAVEN.md

File metadata and controls

56 lines (47 loc) · 1.89 KB

Publish a project to Maven repository

https://central.sonatype.org/pages/ossrh-guide.html

Because this is a JavaFX library, the easiest way to build it is by using the LibericaJDK.

Very first step

When never published to Maven before:

Do not use parent maven pom file!

https://central.sonatype.org/pages/apache-maven.html

"In the past all the plugin configuration and other setup was managed by a Maven parent POM with the latest coordinates of org.sonatype.oss:oss-parent:9. This project leaked SCM, URL and other details and its usage is discouraged."

Create a public key with

Configure your Maven settings.xml file with GnuPG

  • Create a file (Windows): C:\Users\USERNAME.m2\settings.xml - "Kleopatra"
  • Keep the id "ossrh" and fill in the username and password of https://issues.sonatype.org/
<settings>
  <servers>
    <server>
      <id>ossrh</id>
      <username>USERNAME</username>
      <password>PASSWORD</password>
    </server>
  </servers>
</settings>

Publish to repository

For a snapshot version

mvn clean deploy

For a release, update the version in pom.xml first, then:

mvn clean deploy -P release

or when using Maven release plugin:

mvn release:clean release:prepare
   --> Answer the prompts for versions and tags
mvn release:perform

Check your published artifact