# Clone the repository
git clone https://github.com/yourusername/monocore.git
cd monocore/sdk/java
# Build with Maven
mvn clean installmvn testPublishing to Maven Central now uses the Central Portal system with the Central Publishing Maven Plugin:
-
Register for a Central Portal account at central.sonatype.com.
-
Create and verify a namespace for
dev.microsandboxby proving ownership of the domain.- This is done by adding a DNS TXT record to your domain.
- Follow the instructions provided during namespace registration.
-
Generate a publishing token from the Central Portal:
- Go to your account settings
- Navigate to "Access Tokens"
- Create a new token with publishing permissions
-
Configure your Maven
settings.xmlwith the token:
<settings>
<servers>
<server>
<id>central</id>
<username>YOUR_USERNAME</username>
<password>YOUR_PUBLISHING_TOKEN</password>
</server>
</servers>
</settings>-
Sign your artifacts with GPG:
- Generate a key pair:
gpg --gen-key - Distribute your public key:
gpg --keyserver keyserver.ubuntu.com --send-keys YOUR_KEY_ID
- Generate a key pair:
-
Deploy to Central Repository using the central-publishing-maven-plugin:
# Deploy with the release profile activated for GPG signing
mvn clean deploy -P releaseThe plugin is configured to automatically publish your artifacts and wait until they are fully published to Maven Central.
You can also use the plugin directly:
# Run only the publish goal of the plugin
mvn org.sonatype.central:central-publishing-maven-plugin:publish -P releaseFor more detailed instructions, refer to the Maven Central documentation.