From 2452449dffd1207dfcc5d7214ef3ad2ce6a6c8eb Mon Sep 17 00:00:00 2001 From: Stephan Rauh <3045767+stephanrauh@users.noreply.github.com> Date: Fri, 9 Aug 2024 12:33:09 +0200 Subject: [PATCH] configure the gpg sign plugin correctly and add a script automating the deployment to Maven Central; add documentation of how to configure the deployment --- publish-to-Maven-Central.sh | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 publish-to-Maven-Central.sh diff --git a/publish-to-Maven-Central.sh b/publish-to-Maven-Central.sh new file mode 100755 index 00000000..eccb1dc4 --- /dev/null +++ b/publish-to-Maven-Central.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# This file is used to publish the library to Maven Central. +# First, it runs the Gradle task to generate the resource files and to override the +# resource files of the Maven Central version with the ones in the gradleResources directory. +# After that, it calls the Maven deploy command to publish the library to Maven Central. +# It would be more convenient to use the Gradle plugin to publish the library to Maven Central, +# but that doesn't seem to be possible. The Gradle plugin always stops with a "400 Bad Request" error. + +# This script requires a settings.xml file in the .m2 directory with the following content: +# +# +# +# ossrh +# (token-user from the Maven Central Nexus UI) +# (token from the Maven Central Nexus UI) +# +# +# +# +# sign-artifacts +# +# (id of the gpg key you're using to sign the files) +# (passphrase of that gpg key) +# +# +# +# +# sign-artifacts +# +# + +./gradlew clean publishToMavenLocal + +mvn clean deploy -P MavenCentral \ No newline at end of file