SwingBits is a collection of useful components and utilities for Java Swing Toolkit.
The documentation can be found in the Project Wiki.
NOTE: The TaskDialog library is becoming a part of SwingBits starting with SwingBits v1.0
Here are some of its features:
Copy the relevant bits from settings.xml.example
into your own ~/.m2/settings.xml:
- a
<server id="sonatype-central-portal">entry with your token as username/password, andnjord.publisher/njord.releaseUrlconfiguration so Njord knows this server means "publish to Central Portal" - (optional) a
<pluginGroup>entry so you can typemvn njord:...instead of the fully-qualified plugin coordinates
For the GPG passphrase, the recommended approach is to not put it in
settings.xml at all — export it as an environment variable right before
signing:
export MAVEN_GPG_PASSPHRASE="your-passphrase"(settings.xml.example also shows the older <server id="gpg.passphrase">
convention, which still works but is discouraged since 3.2.x of the plugin.)
mvn verifyThe release profile (and therefore GPG signing) is not active by
default, so this works without a GPG key present.
-
Locally stage the release (this creates a Njord "store"; the
idbefore::njord:is a throwaway value just to satisfy deploy-plugin syntax):mvn -Prelease deploy -DaltDeploymentRepository=id::njord:
Because the
releaseprofile is active,maven-gpg-pluginsigns the jar, sources jar, javadoc jar and POM during theverifyphase, before Njord stages everything locally. -
List staged stores to get the store name:
mvn njord:list
-
Inspect what got staged (optional but recommended):
mvn njord:list-content -Dnjord.store=release-xxx
-
Validate the store against Central's requirements (optional but recommended — catches missing sources/javadoc/signatures/POM metadata before you publish):
mvn njord:validate -Ddetails -Dnjord.store=release-xxx
-
Publish to Central Portal:
mvn njord:publish -Dnjord.store=release-xxx -Dnjord.publisher=sonatype-cp
-
If publish succeeds, the store is dropped automatically and your release is now on Central Portal (check https://central.sonatype.com/publishing to confirm/finalize, depending on whether your namespace has automatic publishing enabled).
If you ever want to abandon a staged release instead of publishing it:
mvn njord:drop -Dnjord.store=release-xxx- Replace the placeholder
groupId,url,scm,developersandlicensesinpom.xmlwith real values — Central Portal validates that this metadata is present and rejects releases that lack it. version.njordinpom.xmlshould be bumped to whatever the latest Njord release is at the time you use this.- Signing is scoped to the
releaseprofile so everydaymvn test/mvn installdon't require a GPG key on every dev machine / CI job.