[GRADLE-1699] import fails for JavaPlugin in buildSrc Created: 28/Jul/11  Updated: 04/Jan/13  Resolved: 07/Sep/11

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-4
Fix Version/s: 1.0-milestone-5

Type: Bug
Reporter: Philip Crotwell Assignee: Adam Murdoch
Resolution: Fixed Votes: 3

Issue Links:
Duplicates GRADLE-1701 Gradle 1.0-M4 fails to create Hierarc... Resolved


Plugins that worked with milestone-3 are failing with milestone-4. I
don't see anything in the breaking changes that would indicate I need
to do anything different in my buildSrc. I do not have a build.gradle
in buildSrc as it used to not be needed. Has something changed?

crotwell$ gradle version
:buildSrc:compileJava UP-TO-DATE
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
4: unable to resolve class org.gradle.api.plugins.JavaPlugin
@ line 4, column 1.
import org.gradle.api.plugins.JavaPlugin

1 error

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileGroovy'.
    Cause: Forked groovyc returned error code: 1
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info
    or --debug option to get more log output.


Total time: 6.754 secs

Comment by Matthew J. McCullough [ 05/Aug/11 ]

Also breaks the M2MetadataPlugin:

Which was compatible with the codebase partway into the RC4 nightlies...

Comment by Mark Maxey [ 06/Aug/11 ]

Everyone may have figured this out by now, but the problem seems to be that the gradleApi() doesn't include gradle-plugins-1.0-milestone-4.jar which contains many necessary classes for plugins, SourceSet, etc. Like others, I've confirmed that my stuff breaks in 4 but works in 3.

Comment by Yoav Landman [ 07/Aug/11 ]

Same for the Artifactory plugin (http://wiki.jfrog.org/confluence/display/RTF/Gradle+Artifactory+Plugin)

Comment by Carl Quinn [ 15/Aug/11 ]

What's the best workaround until this is fixed?

Or, will there be an M5 out soon with a fix?

Comment by Adam Murdoch [ 15/Aug/11 ]

A workaround is:

dependencies {
    compile fileTree(dir: "${gradle.gradleHomeDir}/lib/plugins", include: 'gradle*.jar')

We plan to get M5 out as soon as we've fixed the major regressions in M4.

Generated at Wed Jun 30 12:02:07 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.