releng.org 3.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
* ABCL Release Engineering practices

** Maven

Instructions for Releasing ABCL on Sonatype's OSS Maven repository

*** settings.xml

This assumes your settings.xml (/etc/maven2/settings.xml for
Ubuntu-packaged Maven) contains something like this in its
<servers></servers> section:

#+BEGIN_SRC 
 <server>
   <id>sonatype-nexus-snapshots</id>
   <username>sonatype-jira-username</username>
   <password>sonatype-jira-password</password>
 </server>
 <server>
   <id>sonatype-nexus-staging</id>
   <username>sonatype-jira-username</username>
   <password>sonatype-jira-password</password>
 </server>
#+END_SRC

*** Process

First, remember to build it!

#+BEGIN_SRC 
31
ant abcl.jar abcl.source.jar abcl.javadoc.jar abcl.contrib
32
#+END_SRC
33

34 35 36
And maybe test it as well

#+BEGIN_SRC 
37
ant abcl.test
38 39 40
#+END_SRC

For snapshots - development versions - the version in the POM should be like x.y.z-SNAPSHOT
41

42
#+BEGIN_SRC 
43
mvn gpg:sign-and-deploy-file -Dfile=dist/abcl.jar -DpomFile=pom.xml -Durl=https://oss.sonatype.org/content/repositories/snapshots/ -DrepositoryId=sonatype-nexus-snapshots
44 45
mvn gpg:sign-and-deploy-file -Dfile=dist/abcl-sources.jar -DpomFile=pom.xml -Durl=https://oss.sonatype.org/content/repositories/snapshots/ -DrepositoryId=sonatype-nexus-snapshots -Dclassifier=sources
mvn gpg:sign-and-deploy-file -Dfile=dist/abcl-javadoc.jar -DpomFile=pom.xml -Durl=https://oss.sonatype.org/content/repositories/snapshots/ -DrepositoryId=sonatype-nexus-snapshots -Dclassifier=javadoc
46 47
mvn gpg:sign-and-deploy-file -Dfile=dist/abcl-contrib.jar -DpomFile=contrib/pom.xml -Durl=https://oss.sonatype.org/content/repositories/snapshots/ -DrepositoryId=sonatype-nexus-snapshots 
#+END_SRC
48

49 50 51
For releases - the version in the POM should be x.y.z

#+BEGIN_SRC 
52
mvn gpg:sign-and-deploy-file -Dfile=dist/abcl.jar -DpomFile=pom.xml -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging
53 54
mvn gpg:sign-and-deploy-file -Dfile=dist/abcl-${abcl_version}-sources.jar -DpomFile=pom.xml -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -Dclassifier=sources
mvn gpg:sign-and-deploy-file -Dfile=dist/abcl-${abcl_version}-javadoc.jar -DpomFile=pom.xml -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -Dclassifier=javadoc
55 56 57
#+END_SRC

abcl-contrib release
58

59
#+BEGIN_SRC 
60
mvn gpg:sign-and-deploy-file -Dfile=dist/abcl-contrib.jar -DpomFile=contrib/pom.xml -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging 
61 62
mvn gpg:sign-and-deploy-file -Dfile=dist/abcl-contrib-${abcl_version}-sources.jar -DpomFile=contrib/pom.xml -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -Dclassifier=sources
mvn gpg:sign-and-deploy-file -Dfile=dist/abcl-contrib-${abcl_version}-javadoc.jar -DpomFile=contrib/pom.xml -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -Dclassifier=javadoc
63 64 65 66 67 68 69 70 71 72 73 74 75
#+END_SRC

**** Testing downloads 

#+BEGIN_SRC 
mvn org.apache.maven.plugins:maven-dependency-plugin:2.1:get -DrepoUrl=https://oss.sonatype.org/content/repositories/snapshots -Dartifact=org.abcl:abcl-contrib:1.5.0-SNAPSHOT:jar
#+END_SRC

*** See also
<http://www.sonatype.org/nexus/2015/06/02/how-to-publish-software-artifacts-to-maven-central/>
<http://central.sonatype.org/pages/releasing-the-deployment.html>

*** Specifiying GPG executable
76

77 78
For specifying gpg executable, use a property specified via
'-Dgpg.executable=gpg2'.