From 93eabb4361c5953330d3827da3e61496c9ecf605 Mon Sep 17 00:00:00 2001 From: Aaron Bembenek Date: Wed, 30 Oct 2024 19:33:02 -0400 Subject: [PATCH] Release on Maven Central (#24) * Publish on Maven Central. * Fix license metadata. --- README.md | 28 ++++++++++-- make_release.sh | 10 ++++- pom.xml | 112 ++++++++++++++++++++++++++++++++++++++++++------ 3 files changed, 133 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 05d2849..9df395d 100644 --- a/README.md +++ b/README.md @@ -21,15 +21,35 @@ subdirectory. # Requirements * Java 8+ -* Maven (v3.6.3 is known to work); necessary only for compilation +* Maven (v3.6.3 is known to work); not necessary for running the pre-built JAR -# Compilation +# Setup + +## Pre-Built JAR A pre-built JAR can be found on the -[Releases](https://github.com/HarvardPL/AbcDatalog/releases) section of GitHub. +[Releases](https://github.com/HarvardPL/AbcDatalog/releases) section of the GitHub repository. + +## Maven Central + +AbcDatalog is released on [Maven Central](https://central.sonatype.com/artifact/io.github.harvardpl/AbcDatalog) +and can be easily added as a library to another Maven project by including a +snippet like this in that project's `pom.xml` file: + +``` + + io.github.harvardpl + AbcDatalog + [X.Y.Z] + +``` + +Replace `[X.Y.Z]` with the most recent AbcDatalog version. + +## Compilation If you desire, you can compile the source code into a JAR using Maven. From -this directory, run `mvn package` to build the archive +the project root directory, run `mvn package` to build the archive `target/AbcDatalog-[X.Y.Z]-jar-with-dependencies.jar` (where `[X.Y.Z]` is the version number). diff --git a/make_release.sh b/make_release.sh index 073896a..64e95c5 100755 --- a/make_release.sh +++ b/make_release.sh @@ -16,7 +16,7 @@ mvn license:update-file-header # Make sure code is formatted consistently mvn com.spotify.fmt:fmt-maven-plugin:format # Generate Javadocs -mvn javadoc:javadoc +mvn javadoc:javadoc -Prelease git stash # Update the Javadocs on the website @@ -29,3 +29,11 @@ git push git checkout master git stash pop + +# To upload the new release to Maven Central, run: +# +# mvn clean deploy -Prelease +# +# (This assumes you have a settings.xml file with the GPG passphrase and a +# Sonatype token.) Once the package is validated, you can publish it using the +# interface on . \ No newline at end of file diff --git a/pom.xml b/pom.xml index d3ffd9a..fa8fb5a 100644 --- a/pom.xml +++ b/pom.xml @@ -2,15 +2,42 @@ 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"> 4.0.0 - edu.harvard.seas.pl + + io.github.harvardpl AbcDatalog - 0.7.0 - AbcDatalog + 0.7.1 + jar + + ${project.groupId}:${project.artifactId} + An implementation of the logic programming language Datalog. + https://harvardpl.github.io/AbcDatalog/ + + + + The 3-Clause BSD License + https://opensource.org/license/bsd-3-clause + + + + + + Aaron Bembenek + aaron.bembenek@gmail.com + + + + + scm:git:git://github.com/HarvardPL/AbcDatalog.git + scm:git:ssh://github.com:HarvardPL/AbcDatalog.git + https://github.com/HarvardPL/AbcDatalog/tree/master/ + + UTF-8 1.8 1.8 + junit @@ -23,6 +50,7 @@ 3.1.1 + @@ -62,14 +90,6 @@ - - org.apache.maven.plugins - maven-javadoc-plugin - 3.3.0 - - none - - com.spotify.fmt fmt-maven-plugin @@ -82,6 +102,74 @@ + + org.sonatype.central + central-publishing-maven-plugin + 0.6.0 + true + + central + + - + + + + release + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 3.3.0 + + none + + + + attach-javadocs + + jar + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + + + + \ No newline at end of file