[GRADLE-1025] don't force users to declare buildscript { } classpath for gradle's own idea plugin Created: 10/Jul/10  Updated: 04/Jan/13  Resolved: 24/Nov/10

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 0.9-rc-1

Type: Improvement
Reporter: Chris Beams Assignee: Hans Dockter
Resolution: Fixed Votes: 0


Per the user guide, the way to use the idea plugin is as follows:

    buildscript {
        repositories {
            mavenRepo urls: 'http://gradle.artifactoryonline.com/gradle/plugins'
        dependencies {
            classpath "org.gradle.plugins:gradle-idea-plugin:0.2"

followed by:

    apply plugin: 'org.gradle.idea'

I was a bit surprised by this, having come from using the eclipse plugin, which has a more built-in feel. I can simply say apply plugin: 'eclipse' and I'm done.

Why the difference with idea?

Comment by Adam Murdoch [ 10/Jul/10 ]

The difference is historical. The idea plugin code was originally written outside the Gradle source repository. Since the 0.9-preview3 release, it has moved into the Gradle repository. And so, it's now part of the distribution, and you use it the same way that you use the eclipse plugin.

Comment by Chris Beams [ 10/Jul/10 ]

great, thanks. has the documentation been updated (in trunk) as well?

Comment by Chris Beams [ 10/Jul/10 ]

Originally, I was trying

apply plugin: 'idea'

which resulted in gradle complaining as follows:

* What went wrong:
A problem occurred evaluating root project 'myproject'.
Cause: Plugin with id 'idea' not found.


apply plugin: 'org.gradle.idea'

results in the same error.

The only way I'm able to resolve this is by adding the buildscript

{ ... }

block as advertised in the current docs.

I'm using 0.9-preview-3, btw.

Comment by Chris Beams [ 10/Jul/10 ]

reopening, based on my previous comment

Comment by Adam Murdoch [ 10/Jul/10 ]

My previous comment was a bit unclear. The idea plugin was not included in the 0.9-preview-3 release, and so you have to use the buildscript { } declaration if you're using that release.

After we did the 0.9-preview-3 release, we merged the idea plugin into trunk (and updated the documentation too), so that in the next release the idea plugin will work the same way as the eclipse plugin.

Comment by Chris Beams [ 10/Jul/10 ]

Ah, that's clear, thanks. Hopefully the plugin name will simply be 'idea'? This is symmetrical with the non-qualified 'eclipse' plugin name. It would be (aesthetically) unfortunate to have

apply plugin: 'eclipse'
apply plugin: 'org.gradle.idea'
Comment by Adam Murdoch [ 10/Jul/10 ]

it's called 'idea'.

Generated at Wed Jun 30 11:44:59 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.