...
Code Block |
---|
|
docker run -it --rm -v $(pwd):/build -w /build maven:3-jdk-8 mvn clean install |
Publishing Artifacts
To easily run your own test Nexus repository via Docker:
Code Block |
---|
|
docker run -d -p 8081:8081 --name nexus sonatype/nexus:oss |
OSSRH
For a more long-term solution for hosting your (open-source) Maven artifacts, you can follow these steps to deploy them to OSSRH. OSSRH will even sync your released artifacts with Maven Central on your behalf.<placeholder>
Third-Party Dependencies
Code Block |
---|
|
mvn deploy:deploy-file -Dfile=./indri-5.11.jar -DgroupId=edu.illinois.lis -DartifactId=indri -Dversion=5.11-SNAPSHOT -Dpackaging=jar -Durl=https://oss.sonatype.org/content/repositories/snapshots/ -DrepositoryId=ossrh
mvn deploy:deploy-file -Dfile=./indri-5.11.jar -DgroupId=edu.illinois.lis -DartifactId=indri -Dversion=5.11-SNAPSHOT -Dpackaging=jar -Durl=https://oss.sonatype.org/content/repositories/snapshots/ -DrepositoryId=ossrh |
NOTE: If you attempt to deploy a SNAPSHOT to staging, or a non-SNAPSHOT to snapshots, the command will fail.
Syncing to Maven Central
Even OSSRH has a strict list of requirements for syncing artifacts to Maven Central.