| 1 | RELEASING |
| 2 | ========= |
| 3 | |
| 4 | I'm writing this in order to keep some notes on how to release on maven central repository. |
| 5 | |
| 6 | After some time I am not releasing this project, things have changed and I forgot the intricate mechanism to deploy jars |
| 7 | on Maven/Sonatype. Now I am trying again, and this time I will keep some notes for future releases here, hoping this |
| 8 | will help. |
| 9 | |
| 10 | RESOURCES |
| 11 | --------- |
| 12 | |
| 13 | Some links first: |
| 14 | |
| 15 | - [OSSRH Guide][] |
| 16 | - [Apache Maven][] |
| 17 | |
| 18 | [OSSRH Guide]: http://central.sonatype.org/pages/ossrh-guide.html |
| 19 | [Apache Maven]: http://central.sonatype.org/pages/apache-maven.html |
| 20 | |
| 21 | SIGNING JARS |
| 22 | ------------ |
| 23 | |
| 24 | In order to sign artifact jars, you need GnuPG. |
| 25 | |
| 26 | You can download GnuPG from [here](https://gnupg.org/download/) or try MacPorts; I've had issues with brew version of GnuPG on OS X so my recommendation is to download the most updated binaries built for OS X; that at the time of writing is from sourceforge project [gpgosx](https://sourceforge.net/p/gpgosx/docu/Download/). |
| 27 | |
| 28 | RELEASE PROCEDURE |
| 29 | ----------------- |
| 30 | |
| 31 | This will upload release artifacts to Sonatype. |
| 32 | |
| 33 | First you need to make sure all tests are passing and packages can be created without errors. |
| 34 | |
| 35 | ```bash |
| 36 | # Check that everything builds smoothly and tests are all passing |
| 37 | $ mvn clean install |
| 38 | |
| 39 | # First you need to remove the `-SNAPSHOT` thing and commit on git |
| 40 | $ mvn versions:set -DnewVersion=1.0.10 |
| 41 | $ mvn versions:commit |
| 42 | $ git commit -am "prepare release owner 1.0.10" |
| 43 | $ git tag owner-1.0.10 |
| 44 | $ git push origin owner-1.0.10:owner-1.0.10 |
| 45 | |
| 46 | # Deploy the signed jars on Sonatype |
| 47 | $ mvn clean deploy -P release-sign-artifacts |
| 48 | |
| 49 | # Prepare for next development iteration |
| 50 | $ mvn versions:set -DnewVersion=1.0.11-SNAPSHOT |
| 51 | $ mvn versions:commit |
| 52 | $ git commit -am "prepare for next development iteration" |
| 53 | $ git push |
| 54 | ``` |
| 55 | |
| 56 | That should do. |
| 57 | |
| 58 | Maybe I should script this, not urgent anyway since releasing is not a daily routine. |
| 59 | |
| 60 | SITE DEPLOY |
| 61 | ----------- |
| 62 | |
| 63 | The site is generated by [Jekyll](https://jekyllrb.com). |
| 64 | |
| 65 | The Jekyll site has an ant file providing help target: |
| 66 | |
| 67 | ```bash |
| 68 | $ cd owner-site |
| 69 | $ ant |
| 70 | Buildfile: [...]/owner/owner-site/build.xml |
| 71 | |
| 72 | help: |
| 73 | [echo] |
| 74 | [echo] ant clean - cleans up the target dir |
| 75 | [echo] ant build - generates the website in the _site dir |
| 76 | [echo] ant publish - publish site to gh-pages |
| 77 | [echo] ant run-drafts - run jekyll serve (with '-w --drafts' options) |
| 78 | [echo] ant run - run jekyll serve (with '-w' option) |
| 79 | [echo] |
| 80 | |
| 81 | BUILD SUCCESSFUL |
| 82 | Total time: 0 seconds |
| 83 | |
| 84 | ``` |
| 85 | |
| 86 | Run and run-drafts require Jekyll installed, and run a local version of the website on `http://localhost:4000`. |
| 87 | The difference between `run` and `run-drafts` is that the blog posts in the `_drafts` directory of the website are shown |
| 88 | or not: the `run` shows an actual preview of what's going to be shown on the website, while the run-drafts also shows |
| 89 | additionally the drafts stored in the `_drafts` folder. |
| 90 | |
| 91 | The `publish` target publishes the website on GitHub Pages, on the `gh-pages` branch of the project, and makes actually |
| 92 | updates the online website. It does so by using git command line tools which is required to be properly installed. |