Skip to content

Development and Release

Tadaya Tsuyukubo edited this page Mar 14, 2017 · 15 revisions

Setting up local development environment for datasource-proxy.

Requirement

java6+ for runtime.

For development, JDK8 is required to be compatible with JDBC4.2 API(from java8).

In compilation phase, target is set to 1.6, thus distribution(jar file) runs with java5+.


Release

for my reminder

Prerequisite

  • install PGP
  • configure ~/.m2/settings.xml

PGP installation

install for mac

> sudo port install gnupg

generate key-pair

> gpg --gen-key
Real name: Tadaya Tsuyukubo
Email address: tadaya@ttddyy.net
Comment:

keys are stored in ~/.gnupg

confirm generated key

> gpg --list-keys
> gpg --list-secret-keys

to get public key-id, use gpg --list-keys:

> gpg --list-keys
...
pub   2048R/[KEY_ID] 2013-10-04
...

distribute public key

> gpg --keyserver hkp://pool.sks-keyservers.net --send-keys [KEY_ID]

Reference

settings.xml configuration

  • need to provide credential for sonatype's staging repository

add to ~/.m2/settings.xml

<settings>
  ...
  <servers>

    <!-- for release version staging -->
    <server>
      <id>sonatype-nexus-staging</id>
      <username>your-jira-id</username>
      <password>your-jira-pwd</password>
    </server>

    <!-- for snapshot -->
    <server>
      <id>sonatype-nexus-snapshots</id>
      <username>your-jira-id</username>
      <password>your-jira-pwd</password>
    </server>

  </servers>
  ...
</settings>

for Bintray

add this to setting.xml

  <server>
    <id>bintray</id>
    <username>[MY_BINTRAY_USERNAME]</username>
    <password>[MY_API_KEY]</password>
  </server>

add "distributionManagement" to pom.xml

  <distributionManagement>
    <repository>
      <id>bintray</id>
      <url>https://api.bintray.com/maven/[MY_BINTRAY_USERNAME]/maven/[ARTIFACT_NAME]</url>
    </repository>
  </distributionManagement>

* Reference "set me up" help on bintray's repository setup page.

Release procedure

commands

> git clone git@github.com:ttddyy/datasource-proxy.git dsp-release
> cd dsp-release
> git config user.email tadaya@ttddyy.net
> git config user.name "Tadaya Tsuyukubo"

# first check with dry run
> ./mvnw release:prepare -DdryRun=true
> ./mvnw release:clean

# to try locally add "-DpushChanges=false" (this will not push to github)
> ./mvnw release:prepare -DpushChanges=false

# this will create commits in github
> ./mvnw release:prepare

# upload artifacts to sonatype
> ./mvnw release:perform -s ~/.m2/settings-ttddyy.xml

javadoc

> git checkout gh-pages  (may do "git pull --rebase")
> cp -R target/apidocs javadoc/v[VERSION]
> git add javddoc/v[VERSION]
> git commit -m "..."
> git push

release to maven central

  • login to https://oss.sonatype.org
  • click "Staging Repositories"
  • find a repository which was created by mvn release:perform
    • the repository name should be something like "netttddyy-..."
    • the repository contains newly uploaded artifacts
  • select the repository
  • "Close" the repository
  • refresh from the left bar "Staging Repositories"
  • select the repository
  • "Release" the repository (after released, it'll be synced to the central repository in few hours)

publish bintray

goto bintray and publish uploaded artifact.

Javadoc

to publish javadoc only.

> git clone git@github.com:ttddyy/datasource-proxy.git
> cd datasource-proxy

# generate javadoc
> git checkout [VERSION_TAG]
> ./mvnw javadoc:javadoc

# add javadoc to github pages
> git checkout gh-pages
> cp -R target/site/apidocs javadoc/v[VERSION]
> git add javddoc/v[VERSION]
> git commit -m "..."
> git push  # or git push origin gh-pages

# update github javadoc wiki page
#  https://github.com/ttddyy/datasource-proxy/wiki/Javadoc