maven-oss-parent NOT MAINTAINED ANYMORE
Know how to upload to maven central
Description
Maven oss parent pom helps open source projects to deploy and release Maven repositories to maven central (https://central.sonatype.org) Since the official support is from oss-parent is deprecated. This pom creates a release profile which will:
- compile (optional - default=on)
- find duplicate imports (optional - default=on)
- generate test report (jacoco - optional - default=on)
- generate sources
- generate javadocs
- generate gpg signed files
- tag project version
- upload to sonatype nexus
- deploy to sonatype nexus
- release to sonatype nexus
Attention
You should read Maven Central Terms before using this repository and deploy anything. You wont be able to rename or delete any pushed repository.
Usage
- Call
mvn clean deploy -P release
after setup the parent to deploy and release your project to maven central - The repository will be uploaded, deployed, released and central sync activated on Sonatype Nexus
- The repository will be published to Maven Central, typically within 10 minutes, though updates to Maven Central can take up to two hours.
- There is no formal relationship between Maven Central and MVN-Repository, there is no know how for frequency or accuracy of their updates. (I will update this after MVN-Repository respond in the next century)
General setup
Project requirements
- Detailed documentation can be found here: Sonatype
- Public git repository (like on GiHub)
- LICENSE file in root folder (like LICENSE)
- README.md file in root folder (like README.md)
- Account on Sonatype Jira
- Create Issue on Sonatype Jira
- gpg installed and setup - like: gpg simple docu
gpg --gen-key
gpg --list-secret-keys
gpg --keyserver hkp://pool.sks-keyservers.net --send-keys [your secret id]
- settings.xml file in maven home folder (like Settings documentation)
<settings>
<servers>
<server>
<id>ossrh</id>
<username>[Sonatype Jira username]</username>
<password>[Sonatype Jira password]</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.passphrase>[gpg passphrase]</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
POM requirements Example pom
- POM setup parent
<parent>
<groupId>berlin.yuna</groupId>
<artifactId>maven-oss-parent</artifactId>
<version>0.0.1</version>
</parent>
- POM Project <name>, <description>, <url>, tag -like:
<name>${project.artifactId}</name>
<description>[some description...]</description>
<url>https://github.com/YunaBraska/maven-oss-parent</url>
<developers>
<developer>
<name>Yuna Morgenstern</name>
<email>[email protected]</email>
</developer>
</developers>
- POM name and mail is needed - like:
<developers>
<developer>
<name>Yuna Morgenstern</name>
<email>[email protected]</email>
</developer>
</developers>
- POM tag for public open source licenses - like:
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
- POM tag for public sources - like:
<scm>
<connection>scm:git:https://github.com/YunaBraska/maven-oss-parent</connection>
<developerConnection>scm:git:https://github.com/YunaBraska/maven-oss-parent</developerConnection>
<url>https://github.com/YunaBraska/maven-oss-parent.git</url>
</scm>