rosjava building package error (OSX, Hydro)

asked 2014-04-18 20:47:31 -0600

Artem gravatar image

updated 2014-05-19 03:48:38 -0600

I installed rosjava following these instructions. I had an error building zeroconf_jmdns_suite/build.gradle while installation, but I believe it should not effect the described building package problem. I am following the tutorial .

At this point when I'm executing catkin_create_rosjava_pkg rosjava_catkin_package_a I am getting the following error

Created repo file: /Users/artemlenskiy/ros/rosjava_ws/src/rosjava_catkin_package_a/settings.gradle
Created repo file: /Users/artemlenskiy/ros/rosjava_ws/src/rosjava_catkin_package_a/build.gradle
Created repo file: /Users/artemlenskiy/ros/rosjava_ws/src/rosjava_catkin_package_a/CMakeLists.txt
Created repo file: /Users/artemlenskiy/ros/rosjava_ws/src/rosjava_catkin_package_a/package.xml
Creating gradle wrapper: /Users/artemlenskiy/ros/rosjava/src/rosjava_build_tools/src/rosjava_build_tools/gradle/gradlew -p /Users/artemlenskiy/ros/rosjava_ws/src/rosjava_catkin_package_a wrapper

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'rosjava_catkin_package_a'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not find org.codehaus.groovy:groovy-all:2.2.0.
     Required by:
         :rosjava_catkin_package_a:unspecified > org.ros.rosjava_bootstrap:gradle_plugins:0.2.0

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 8.062 secs
[error] __init__() takes at least 3 arguments (2 given) : <type 'exceptions.TypeError'>

I wonder why is it looking for groovy if I have hydro installed. There is also https://github.com/rosjava/rosjava_mv... missing.

EDIT: I did add groovy-all-2.2.0.jar to classpath, still cannot find it.

EDIT2: As Louise suggested adding groovy-all-2.2.0.jar to ./devel/share/maven/org/codehaus/groovy/groovy-all/2.2.0/

solves the above problem and creates the project.

Now running catkin_make I get

Scanning dependencies of target gradle-rosjava_catkin_package_a
Loading /Users/artemlenskiy/ros/rosjava_ws/src/rosjava_catkin_package_a/package.xml

FAILURE: Could not determine which tasks to execute.

* What went wrong:
Task 'uploadArchives' not found in root project 'rosjava_catkin_package_a'.

* Try:
Run gradlew tasks to get a list of available tasks.

BUILD FAILED

Total time: 2.407 secs
make[2]: *** [rosjava_catkin_package_a/CMakeFiles/gradle-rosjava_catkin_package_a] Error 1
make[1]: *** [rosjava_catkin_package_a/CMakeFiles/gradle-rosjava_catkin_package_a.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

EDIT 3:

Entering the project folder and running ./gradlew setupBuild and then ./gradlew produces no errors.

Is this the right way to build projects with ROS JAVA ?

I don't have any experience with rosjava and gradle, any help is appreciated.

edit retag flag offensive close merge delete

Comments

I haven't used rosjava, so I can't offer much help, but it seems the groovy the messages are talking about is not ROS groovy, but Groovy the JVM language: http://groovy.codehaus.org/

demmeln gravatar image demmeln  ( 2014-04-19 12:02:33 -0600 )edit

Thanks, I suspected that this groovy is different, but never bothered to check. I am curious if someone successfully used rosjava on Mac.

Artem gravatar image Artem  ( 2014-04-20 02:35:58 -0600 )edit
2

I managed to get this working successfully this morning on OSX Mavericks. I had to manually download groovy-all-2.2.0.jar from http://mvnrepository.com/artifact/org.codehaus.groovy/groovy-all/2.2.0 and put it in /devel/share/maven/org/codehaus/groovy/groovy-all/2.2.0/groovy-all-2.2.0.jar.

Louise gravatar image Louise  ( 2014-04-25 02:37:56 -0600 )edit

I suspect there is a more elegant solution which involves editing ROS_MAVEN_REPOSITORY or the dependencies in ivy's build.gradle file but I'm not familiar enough with either maven or gradle to be sure.

Louise gravatar image Louise  ( 2014-04-25 02:38:18 -0600 )edit

This is curious since I am also using groovy v1.8.6 on ubuntu and the `find_gradle` code is actually just simple cmake code.

Daniel Stonier gravatar image Daniel Stonier  ( 2014-05-15 15:41:21 -0600 )edit

I noticed you were using `gradle` in the command above. You should actually be using `gradlew` that should have been created in the root directory of your repo. Perhaps this is really missing? In this case it's the `catkin_create_xxx` script that is not creating the gradlew correctly.

Daniel Stonier gravatar image Daniel Stonier  ( 2014-05-15 15:45:53 -0600 )edit

I've installed rosjava extremely smoothly on Ubuntu systems. I have got it successfully running on MacOS Mavericks, but it involved some pretty inelegant steps - catkin_make isn't happy (had to use catkin_make_isolated) and I think it is something to do with the defaults from catkin_init_workspace

Louise gravatar image Louise  ( 2014-05-15 23:50:36 -0600 )edit

Looks like this may not be creating gradle wrapper correctly on macosx. I've created a ticket to follow up on this at https://github.com/rosjava/rosjava_build_tools/issues/20

Daniel Stonier gravatar image Daniel Stonier  ( 2014-05-18 14:27:06 -0600 )edit