-
UPDATE https://central.sonatype.org/register/central-portal/#managing-your-credentials
-
http://javaetmoi.com/2014/09/publier-deployer-releaser-artefact-sur-maven-central/
-
http://javaetmoi.developpez.com/tutoriels/java/publication-maven-central/
-
http://blog.xebia.fr/2011/06/22/deployer-un-artefact-sur-repo1-maven-org/
-
https://blog.oxiane.com/2016/08/31/deployer-son-artifact-sur-maven-central/
-
https://blog.10pines.com/2018/06/25/publish-artifacts-on-maven-central/
-
Username:
OSSRH_USERNAME
-
Password:
OSSRH_PASSWORD
-
Summary : description rapide du projet
-
GroupId : groupId du projet Maven. Ce groupe doit reprendre le nom de domaine du projet (e.g. : fr.xebia, com.googlecode.myproject, etc.)
-
Project URL : l’url du projet (e.g. http://xebia-france.googlecode.com/
-
SCM URL : l’url du gestionnaire de source (e.g. http://xebia-france.googlecode.com/svn/)
-
Nexus Username : le ou les logins de connexion au JIRA : https://issues.sonatype.org/
-
Already Sync To Central : indique si des versions de l’artefact ont déjà été déployées sur le Maven Central Repository (si oui, Sonatype les réintégrera dans le fichier maven-metadata.xml)
-
Description : toute information complémentaire
<settings>
...
<servers>
<server>
<id>ossrh</id>
<username>${OSSRH_USERNAME}</username>
<password>${OSSRH_PASSWORD}</password>
</server>
</servers>
...
</settings>
<id>ossrh</id>
: link betweensetting.xml
andpom.xml
<project>
<modelVersion>...</modelVersion>
<groupId>fr.pinguet62</groupId>
<artifactId>%PROJECT%</artifactId>
<version>...</version>
<packaging>...</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<description>...</description>
<url>https://github.com/pinguet62/%PROJECT%</url>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org</nexusUrl>
</configuration>
</plugin>
</plugins>
</build>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>PINGUET Julien</name>
<email>[email protected]</email>
<url>https://github.com/pinguet62</url>
<roles>
<role>architect</role>
<role>developer</role>
</roles>
<timezone>+1</timezone>
</developer>
</developers>
<scm>
<url>https://github.com/pinguet62/reactor-call-stack</url>
<connection>scm:git:[email protected]:pinguet62/reactor-call-stack.git</connection>
<developerConnection>scm:git:[email protected]:pinguet62/reactor-call-stack.git</developerConnection>
<tag>HEAD</tag>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
</project>
http://central.sonatype.org/pages/working-with-pgp-signatures.html https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key#generating-a-gpg-key
-
Générer les clés :
- Commande :
gpg --gen-key
- Type :
(1) RSA et RSA (par défaut)
- Taille :
2048
- Expiration : /
- Nom + email + Commentaire
- Passphrase (pour sécuriser la clé privée) :
%PASSPHRASE%
Résultat :
Empreinte de la clef = XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXXX
- Commande :
-
Lister les clés :
- Commande :
gpg --list-keys
- Résultat :
pub %SIZE%R/%PUBLIC_KEY_ID% %CREATION_DATE% uid [ ultime ] %NAME% (%COMMENT%) <%EMAIL%> sub %SIZE%R/%PRIVATE_KEY_ID% %CREATION_DATE%
- Commande :
-
Publier la clé :
gpg --keyserver keyserver.ubuntu.com --send-keys %PUBLIC_KEY_ID%
-
Test :
mvn package gpg:sign -Dgpg.passphrase=%GPG_PASSPHRASE%
-
Exporter clé privée :
gpg --armor --export-secret-keys %PUBLIC_KEY_ID%
Options :
- Sélection de la clé publique :
-Dgpg.keyname= %PUBLIC_KEY%
- Passphrase :
-Dgpg.passphrase=%GPG_PASSPHRASE%
-
SNAPSHOT :
- Commande :
mvn deploy
(appellemaven-gpg-plugin
&nexus-staging-maven-plugin
) - https://oss.sonatype.org/content/repositories/snapshots
- Commande :
-
RELEASE :
http://blog.jetoile.fr/2010/04/le-plugin-release-un-peu-demystifie.htmlmvn release:clean
- Préparer :
mvn release:prepare
- Publier :
mvn release:perform
-
Deploy release artifacts into the staging repository https://oss.sonatype.org/service/local/staging/deploy/maven2
-
Promote staged artifacts into repository 'Releases'
-
Download snapshot and release artifacts from group https://oss.sonatype.org/content/groups/public/fr/pinguet62/
-
Download snapshot, release and staged artifacts from staging group https://oss.sonatype.org/content/groups/staging/fr/pinguet62/
URL | Env. | 📥 Upload / 📤 Download |
---|---|---|
https://oss.sonatype.org/content/groups/public/fr/pinguet62/ | Snapshot+Release group | 📤 down |
https://oss.sonatype.org/content/groups/staging/fr/pinguet62/ | Staging group | 📤 down |
https://oss.sonatype.org/content/repositories/snapshots/fr/pinguet62/ | Snapshot | 📥 up & 📤 down |
https://oss.sonatype.org/content/repositories/staging/fr/pinguet62/ | Staging | 📤 down |
https://oss.sonatype.org/service/local/staging/deploy/maven2/ | (Staging +) Release | 📥 up |
https://oss.sonatype.org/content/repositories/releases/fr/pinguet62/ | Release | 📤 down |
Console Nexus : https://oss.sonatype.org