(!) 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.

Rolling RosJava Debs

Description: Packaging your java (possibly mixed) projects as debs.

Keywords: rosjava debs

Tutorial Level: INTERMEDIATE

Next Tutorial: Uploading to Maven on Github


This is the first of two ways to package (the other being maven) and share your java artifacts.

Why Debs, not Maven Artifacts?

The next tutorial demonstrates how to upload as maven artifacts to our external repository. So this begs the question, why build debs?

  • Provides a natural ros workspace (maven repo in share/maven).

  • Can be installed offline.
  • Allows mixed pages, e.g. python + rosjava

Also, for the present, people can manage their own contributions themselves this way. They do not need to go through the human intensive process of making pull requests for every change in their artifacts. This fact may change if we move our maven repo from github to sonatype.

Preparing for a Bloom Release

There is only one extra step to convert a regular rosjava package to one that can be installed and debianized. Add the following line to your CMakeLists.txt, replacing your maven artifact group/artifact id with whatever it is that you are using.


Once this is done, you can push your catkinized rosjava package through for a regular bloom release.

Bloom Release

At the moment, this is 99% like doing a regular bloom release with just one workaround until a fix for the install step is resolved (you can follow that discussion on the pull request).

The workaround involves patching the debian install rule 1 to utilise our setup.bash.

  • Proceed to make a normal bloom release
  • Checkout the base release branch, e.g. for rosjava_messages

> git clone https://github.com/rosjava-release/rosjava_messages-release.git
> cd rosjava_messages-release
> git checkout -b debian/hydro/rosjava_messages origin/debian/hydro/rosjava_messages
> cd debian
# Edit rules.em
> vim rules.em
  • Append the following text to the bottom of the file:

        # In case we're installing to a non-standard location, look for a setup.sh
        # in the install tree that was dropped by catkin, and source it.  It will
        # set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH.
        if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \
  • Commit and push
  • Re-release.

You only need do this once for each bloom config call - which should be only once for hydro. All future bloom-release commands will utilise this patch.

  1. Official bloom documentation for patching debian rules (1)

Wiki: rosjava/Tutorials/hydro/Rolling RosJava Debs (last edited 2013-11-13 19:47:06 by ScottLivingston)