Skip to content

Commit

Permalink
configure the gpg sign plugin correctly and add a script automating t…
Browse files Browse the repository at this point in the history
…he deployment to Maven Central; add documentation of how to configure the deployment
  • Loading branch information
stephanrauh committed Aug 12, 2024
1 parent ace69ce commit 2452449
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions publish-to-Maven-Central.sh
Original file line number Diff line number Diff line change
@@ -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:
#<settings>
# <servers>
# <server>
# <id>ossrh</id>
# <username>(token-user from the Maven Central Nexus UI)</username>
# <password>(token from the Maven Central Nexus UI)</password>
# </server>
# </servers>
# <profiles>
# <profile>
# <id>sign-artifacts</id>
# <properties>
# <gpg.keyname>(id of the gpg key you're using to sign the files)</gpg.keyname>
# <gpg.passphrase>(passphrase of that gpg key)</gpg.passphrase> <!-- Store encrypted if possible -->
# </properties>
# </profile>
# </profiles>
# <activeProfiles>
# <activeProfile>sign-artifacts</activeProfile>
# </activeProfiles>
#</settings>

./gradlew clean publishToMavenLocal

mvn clean deploy -P MavenCentral

0 comments on commit 2452449

Please sign in to comment.