ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Anyone can help me in gradle building problem?

asked 2012-08-20 12:22:00 -0500

wildfire gravatar image

updated 2012-08-21 21:00:41 -0500

KruseT gravatar image

I have some compiling problem but just don't know why...... I successfully build some programs before but after I change something, all program just failed. Can anybody tell me what's this problem? very very thankful...

  • Where: Build file '/home/wildfire/my_workspace/ajpf_ros/build.gradle' line: 11

  • What went wrong: A problem occurred evaluating root project 'ajpf_ros'. Cause: Could not find method maven() for arguments [build_3bcu47ed6p0s77r3m7ndupfh7r$_run_closure1_closure3@1ec3c6d] on root project 'ajpf_ros'.

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


Total time: 4.096 secs

I've checked other program and it seems like not a "gradle building problem". Is this error come from my wrong code? It's just a very simple one extended from tutorial.

The is

apply plugin: 'java'

apply plugin: 'maven'

apply plugin: 'application'
mainClassName = 'org.ros.RosRun'

sourceCompatibility = 1.6
targetCompatibility = 1.6

repositories {
  maven {
    url ''

version = '0.0.0-SNAPSHOT'
group = 'ros.my_stack'

dependencies {
  compile 'ros.rosjava_core:rosjava:0.0.0-SNAPSHOT'
 wildfire@ubuntu:~/my_workspace/ajpf_ros$ gradle --version

 Gradle 1.0-milestone-3

 Gradle build time: Thursday, September
 8, 2011 4:06:52 PM UTC Groovy: 1.7.10
 Ant: Apache Ant(TM) version 1.8.2
 compiled on August 19 2011 Ivy: non
 official version JVM: 1.6.0_24 (Sun
 Microsystems Inc. 20.0-b12) OS: Linux
 3.0.0-24-generic i386
edit retag flag offensive close merge delete


Please describe in detail what you are doing before getting the error, see

KruseT gravatar image KruseT  ( 2012-08-21 02:40:48 -0500 )edit

The java code also has plenty of problems, but those have nothing to do with the error you get. Please also run the gradle / gradlew command that you use with --version, and post the result here.

KruseT gravatar image KruseT  ( 2012-08-21 02:54:23 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2012-08-20 21:49:38 -0500

KruseT gravatar image

updated 2012-08-21 20:58:01 -0500

You'll be more successfull searching for answers regarding gradle if you just use google:

Maybe this helps:

You use gradle 1.0-milestone-3. As the link above says, you need at least gradle 1.0-milestone-5. So your gradle version is just too old. Use the gradlew wrapper from rosjava_core as it says in the tutorial.

You can also get the gradlew wrapper by running:

$ hg clone

Anywhere on your disk, and copying the file 'gradlew' and the 'gradle' directory to your project, and then always using that gradlew instead of just gradle.

edit flag offensive delete link more

answered 2012-08-20 23:59:19 -0500

damonkohler gravatar image

You probably did not apply the maven plugin.

edit flag offensive delete link more

Question Tools


Asked: 2012-08-20 12:22:00 -0500

Seen: 14,595 times

Last updated: Aug 21 '12