Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Could not find method groovy() for arguments [org.codehaus.groovy:groovy-all:1.8.8] on root project #68

Closed
tknerr opened this issue Aug 6, 2014 · 8 comments

Comments

@tknerr
Copy link

tknerr commented Aug 6, 2014

Followed your guide here but got this exception:

[workspace] $ /var/lib/jenkins/tools/hudson.plugins.gradle.GradleInstallation/Gradle_2.0/bin/gradle -DjenkinsUrl=http://localhost:8080/jenkins -DgitUrl=git+ssh://xxx@acme.org/home/xxx/git/repos/maven-dummy.git -DtemplateJobPrefix=MyDummy -DtemplateBranchName=master -DnestedView=MyDummy-branches -DdryRun=true syncWithRepo

FAILURE: Build failed with an exception.

* Where:
Build file '/data/jenkins/jobs/SyncDummyGitBranchesWithJenkins/workspace/build.gradle' line: 9

* What went wrong:
A problem occurred evaluating root project 'workspace'.
> Could not find method groovy() for arguments [org.codehaus.groovy:groovy-all:1.8.8] on root project 'workspace'.

* 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: 3.806 secs
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE

This is using:

  • Jenkins 1.572
  • Gradle Plugin 1.24 (added Gradle 2.0 installation)
  • GIT Plugin 2.2.4
  • jenkins-build-per-branch from master

Any ideas?

@tknerr
Copy link
Author

tknerr commented Aug 6, 2014

More output with --stacktrace and --debug:
https://gist.github.com/tknerr/5314611de7ef30339eb4

@tknerr
Copy link
Author

tknerr commented Aug 6, 2014

I seem to get past that error by using Gradle 1.12 instead of 2.0

@tknerr
Copy link
Author

tknerr commented Aug 6, 2014

Solution: use Gradle 1.x :-)

@tknerr tknerr closed this as completed Aug 6, 2014
@tinyrye
Copy link

tinyrye commented Feb 10, 2015

I had the same problem as you using Gradle 2.1 and went back to Gradle 1.8. After doing so Gradle informed me this was unnecessary:

"The groovy configuration has been deprecated and is scheduled to be removed in Gradle 2.0. Typically, usages of 'groovy' can simply be replaced with 'compile'. In some cases, it may be necessary to additionally configure the 'groovyClasspath' property of GroovyCompile and Groovydoc tasks."

I upgraded to Gradle 2.2, and running Gradle tasks were successful after changing 'groovy' dependency configs to 'compile'. I tried with both the wrapper and the native install of gradle.

Presumably Gradle 2.1 would have also worked; I stayed with 2.2 since I already put forth the effort of installing it (originally in the hopes that 2.1 -> 2.2 was the solution.)

@mukeshkamboj
Copy link

@tinyrye
I am new to gradle. There is below line in dependencies block in build.gradle file.

groovy 'org.codehaus.groovy:groovy:2.2.1'

Why do we require this. This is breaking build with gradle 2.2.1 version. What is the use of it and alternative of it.

Please point me to the link where i can study this.

mohamedelhabib pushed a commit to mohamedelhabib/jenkins-build-per-branch that referenced this issue May 28, 2015
@mcordone
Copy link

I know this is a little bit old but getting same error using Gradle 2.3 or 2.7, is this issue has ever been address? any solution?

Thanks

@voidabhi
Copy link

voidabhi commented Jun 1, 2016

+1

@jamesdh
Copy link
Contributor

jamesdh commented Jun 2, 2016

It's a legacy declaration for using groovy in earlier Gradle 1.x versions. That's why it's good practice to include the gradle wrapper in gradle projects, and hence why it's suggested to use gradlew within this project while running it as opposed to your local host systems installation of gradle.

jamesdh added a commit that referenced this issue Jun 2, 2016
And clean up other dependencies. Fixes #68 for those not using ancient versions of gradle and not using the gradle wrapper.
prosegay pushed a commit to VoltDB/jenkins-build-per-branch that referenced this issue Sep 24, 2018
And clean up other dependencies. Fixes entagen#68 for those not using ancient versions of gradle and not using the gradle wrapper.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants