spring-attic / gradle-plugins

Gradle plugins for use in building and publishing open-source Spring projects, e.g. Spring Framework, Spring Integration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using propdeps-plugin with IDEA 13.x causes NoClassDefFoundError on dependencies

fge opened this issue · comments

Versions:

  • gradle 1.10;
  • IDEA 13.0.2;
  • propdeps-plugin 0.0.5.

To reproduce: first, declare we want to use this plugin as per the doc, ie:

configure(allprojects) {
    apply(plugin: "propdeps");
    apply(plugin: "propdeps-maven");
    apply(plugin: "propdeps-idea");
    apply(plugin: "propdeps-eclipse");
}

Second, write a main() (even empty) within a class in a folder declared as a source folder, which has a compile-time dependency.

Then try and execute that main(): fails with a NoClassDefFoundError on one of the compile-time dependencies of this class.

Note:

  • to clarify the above, if the class in question has no dependency whatsoever on any compile-time dependency, execution succeeds;
  • it does not fail if the class in question is in a test source folder!
  • you do not need to declare any dependency as provided or optional;
  • happens also with gradle 1.11, IDEA 13.1 EAP;
  • does not prevent compilation to succeed.

It looks like the runtime classpath which IDEA uses for running mains in a source folder is completely emptied of compile time dependencies as soon as we use this plugin...

thanks @philwebb , I'll take a look at it since I ran into similar issues.

@bclozel Thanks, I'm primarily an eclipse user still so IDEA issues are harder for me to fix.