|Note: This tutorial assumes that you have completed the previous tutorials: Rolling RosJava Debs.|
|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 GithubDescription: 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 for uploading artifacts to our maven repo is as follows:
- Update your dependencies (important to ensure you have the latest messages)
> sudo apt-get update > sudo apt-get install --only-upgrade ros-hydro-*
- 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 sources (e.g. in ~/myjava/install).
> mkdir -p ~/rosjava > wstool init ~/rosjava/src my_rosjava_sources.rosinstall > cd ~/rosjava > . /opt/ros/hydro/setup.bash > 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.
Use a source workspace separate to your usual development workspace. The method above currently works, but there might be a problem or two using ROS_MAVEN_DEPLOYMENT_REPOSITORY with some as yet untested workflows (e.g. installing your source workspace).