(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Uploading to Maven on Github

Description: Share java and android artifacts via our github maven repo.

Keywords: rosjava android maven

Tutorial Level: INTERMEDIATE


This tutorial concerns how to share the artifacts of your development with other java/android programmers.

If you wish to share your rosjava .jar's, then there are two methods. The first is to roll ubuntu debs and share them, though that is limited to ros users of ubuntu only. The second alternative, which also happens to work for android .aar's is to share them via our github maven repo:

The Process

The process for uploading artifacts to our maven repo is as follows:

  • Fork rosjava_mvn_repo

  • Locally clone your fork
  • Configure ROS_MAVEN_DEPLOYMENT_REPOSITORY to your clone

> cd ~
> git clone https://github.com/stonier/rosjava_mvn_repo
# Tell it where to find your shiny new maven artifacts for dependency resolution
> export ROS_MAVEN_REPOSITORY=file://~/rosjava_mvn_repo
# Tell it where to deploy the artifacts
> export ROS_MAVEN_DEPLOYMENT_REPOSITORY=~/rosjava_mvn_repo
  • Rosinstall and compile your rosjava/android source workspaces (e.g. in ~/myjava/install).

> mkdir -p ~/rosjava
> wstool init ~/rosjava/src my_rosjava_sources.rosinstall
> cd ~/rosjava
# make sure to source and use the rosjava sources as an underlay
> source ~/rosjava/devel/setup.bash
# also source any other underlays you are also using
> catkin_make
  • Stage and optionally commit/push changes with the convenience script in the maven repo.

> cd ~/rosjava_mvn_repo
> ./update_maven_repo
  • Send us a pull request to the original maven repo.


Under the Hood

During the compile you should see the output sending the maven artifacts to your maven repo. This actually updates any and every artifact built by your sources, whether there was a version bump or not. For those without version bumps, all it is doing is updating the timestamp - @the update_maven_repo@ convenience script filters these out of the commit/push step and just commits/pushes the changes that are new or have had version bump.

Wiki: rosjava/Tutorials/indigo/Uploading to Maven on Github (last edited 2015-02-11 12:32:26 by DanielStonier)