akhikhl / wuff

Gradle plugin for automating assembly of OSGi/Eclipse bundles and applications
MIT License
153 stars 51 forks source link

Wuff failed with exception #87

Closed romu70 closed 9 years ago

romu70 commented 9 years ago

Hi, I'm doing some testing with Wuff, and I get a exception. I'm trying to convert a small Eclipse project to Gradle with Wuff. This project is made of 2 Eclipse features, each feature contains one plugin.

At the root folder (which holds 4 sub-folders for the 2 features and the 2 plugins), I created the settings.gradle and build.gradle as described in the wiki. And when I run gradle build or gradle dependencies, I get the following output:

A problem occurred evaluating root project 'src'.
> Failed to apply plugin [id 'org.akhikhl.wuff.eclipse-bundle']
   > Cannot cast object '[configuration ':com.xxxxx.yyyyy.zzzz:privateLib']' with class 'java.util.ArrayList' to class 'org.gradle.api.file.FileCollection' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.gradle.api.file.FileCollection(org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated)

And here I'm stuck and need a bit of help. Thanks.

nedtwigg commented 9 years ago

I think somewhere in your build.gradle you're passing an array, but Gradle wants a regular string. Seeing more of your buildscript would help diagnose it.

romu70 commented 9 years ago

Thanks to help. I'm totally new to Gradle and Wuff, so I did the same try as described in the first Wuff tutorial: https://github.com/akhikhl/wuff/wiki/Convert-existing-Eclipse-plugins-and-apps-to-Gradle

I made only the first step, Eclipse plugin.

I run it on Fedora 22 + OpenJDK 8. I'll try with Oracle JDK asap to see if it's different.

EDIT: tested with Oracle JDK 8u45, same exception.

romu70 commented 9 years ago

Hi, no news on this exception? Because I'm totally stuck on this, I just can't use Wuff at all. Here is the build.gradle:

buildscript {
  repositories {
    mavenLocal()
    jcenter()
  }

  dependencies {
    classpath 'org.akhikhl.wuff:wuff-plugin:+'
  }
}

subprojects {

  repositories {
    mavenLocal()
    jcenter()
  }

  apply plugin: 'java'
  if(name == 'MyRcpApp')
    apply plugin: 'org.akhikhl.wuff.eclipse-rcp-app'
  else
    apply plugin: 'org.akhikhl.wuff.eclipse-bundle'
}

Thanks.

nedtwigg commented 9 years ago

This describes a multi-project build. Does your directory tree look like this?

build.gradle
settings.gradle
org.akhikhl.wuff.eclipse-rcp-app/
org.akhikhl.wuff.eclipse-eclipse-bundle/
romu70 commented 9 years ago

No, but should it be? org.akhikhl.wuff.eclipse-rcp-app & org.akhikhl.wuff.eclipse-eclipse-plugin are just wuff components, am I wrong?

I modified a bit the build.gradle to make things even more simple.

buildscript {
  repositories {
    mavenLocal()
    jcenter()
  }

  dependencies {
    classpath 'org.akhikhl.wuff:wuff-plugin:+'
  }
}

subprojects {

  repositories {
    mavenLocal()
    jcenter()
  }

  apply plugin: 'java'
  apply plugin: 'org.akhikhl.wuff.eclipse-bundle'
}

my workspace folder contains:

build.gradle
settings.gradle
my.own.plugin

The last folder is of course the Eclipse plugin I want to build with Gradle, it contains...nothing. Again, I'm just following the tutorial, nothing more (and nothing less I hope).

nedtwigg commented 9 years ago

Aha! I would start off by cloning wuff and using the examples. They will show you the correct folder structure.

romu70 commented 9 years ago

ok, let's try this. Thanks ned.

romu70 commented 9 years ago

So, I've just tested with the examples provided by Wuff. I need to build plugins for the moment. I've tested with the 4 Plugins examples, and I've the exact same exception.

Help!

nedtwigg commented 9 years ago

Okay, so if you go to examples\IdeApp-1\MyIdeApp and type gradlew build, what do you get?

romu70 commented 9 years ago

Hi Ned, I'm on Linux, so I type gradle build, same exception with the IdeApp-1 example.

nedtwigg commented 9 years ago

The 'w' isn't for Windows, it's for wrapper.

What's the output of gradle --version? I'm suspicious that you've got an old version.

The great thing about the gradle wrapper is that it ensures that you're using the correct version. Wuff uses the wrapper script. Try executing this from the root directory of the wuff project:

./gradlew -b examples/IdeApp-1/MyIdeApp/build.gradle

romu70 commented 9 years ago

I ran Gradle 2.2.1. Not, with gradlew, it's downloading a big bunch of data !

nedtwigg commented 9 years ago

Wuff is based on 2.4 at present, so I guess 2.2.1 is too old. If it's downloading a ton of stuff, then it's working - the first thing Wuff does is download a full Eclipse SDK and deltapack.

You should have something working now, but I would recommend getting a stronger foundation in gradle fundamentals first. Wuff is great, but it's pretty complex. If you don't understand Gradle fundamentals, I think you're gonna have a frustrating experience.

http://gradle.org/getting-started-gradle-java/#developer

romu70 commented 9 years ago

Thanks a lot Ned, it works now. I've already read the Gradle documentation, I need to port all of our proprietary build system (about 100 Eclipse projects) to Gradle, so, it will be a long job.

Anyway, thanks for the help, I'm going to close the ticket.

aykutkilic commented 7 years ago

Hello I'm experiencing the same problem with the latest version of wuff and gradle v 3.2.1.

C:\Users\kral_\Desktop\wuff-master\examples>gradle build
:build_EfxclipseApp_1_MyEfxclipseApp
Download https://jcenter.bintray.com/org/akhikhl/wuff/wuff-plugin/0.0.14/wuff-plugin-0.0.14.pom
Download https://jcenter.bintray.com/org/akhikhl/unpuzzle/unpuzzle-plugin/0.0.18/unpuzzle-plugin-0.0.18.pom
Download https://jcenter.bintray.com/org/akhikhl/unpuzzle/unpuzzle-eclipse2maven/0.0.18/unpuzzle-eclipse2maven-0.0.18.pom
Download https://jcenter.bintray.com/org/akhikhl/unpuzzle/unpuzzle-osgi2maven/0.0.18/unpuzzle-osgi2maven-0.0.18.pom
Download https://jcenter.bintray.com/org/akhikhl/unpuzzle/unpuzzle-utils/0.0.18/unpuzzle-utils-0.0.18.pom
Download https://jcenter.bintray.com/org/akhikhl/wuff/wuff-plugin/0.0.14/wuff-plugin-0.0.14.jar
Download https://jcenter.bintray.com/org/akhikhl/unpuzzle/unpuzzle-plugin/0.0.18/unpuzzle-plugin-0.0.18.jar
Download https://jcenter.bintray.com/org/akhikhl/unpuzzle/unpuzzle-eclipse2maven/0.0.18/unpuzzle-eclipse2maven-0.0.18.jar
Download https://jcenter.bintray.com/org/akhikhl/unpuzzle/unpuzzle-osgi2maven/0.0.18/unpuzzle-osgi2maven-0.0.18.jar
Download https://jcenter.bintray.com/org/akhikhl/unpuzzle/unpuzzle-utils/0.0.18/unpuzzle-utils-0.0.18.jar
:build_EfxclipseApp_1_MyEfxclipseApp FAILED

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\kral_\Desktop\wuff-master\examples\EfxclipseApp-1\MyEfxclipseApp\build.gradle' line: 20

* What went wrong:
A problem occurred evaluating root project 'MyEfxclipseApp'.
> Failed to apply plugin [id 'org.akhikhl.wuff.efxclipse-app']
   > Cannot cast object '[configuration ':privateLib']' with class 'java.util.ArrayList' to class 'org.gradle.api.file.FileCollection' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.gradle.api.file.FileCollection(org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated)

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

BUILD FAILED
C:\Users\kral_\Desktop\wuff-master\examples>gradle -version

 ------------------------------------------------------------
Gradle 3.2.1
------------------------------------------------------------

Build time:   2016-11-22 15:19:54 UTC
Revision:     83b485b914fd4f335ad0e66af9d14aad458d2cc5

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_112 (Oracle Corporation 25.112-b15)
OS:           Windows 10 10.0 amd64

Top of the stacktrace:

* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'MyEfxclipseApp'.
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:92)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:176)
        at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:181)
        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
        at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:573)
        at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:125)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
        at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:162)
        at org.gradle.internal.Factories$1.create(Factories.java:25)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:159)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:36)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:118)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:112)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:98)
        at org.gradle.api.tasks.GradleBuild.build(GradleBuild.java:121)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.doExecute(DefaultTaskClassInfoStore.java:141)
aykutkilic commented 7 years ago

gradlew build seems to run until the error below:

[buildinfo] Not using buildInfo properties file for this build.
Publication named 'mavenJava' does not exist for project ':' in task ':artifactoryPublish'.
None of the specified publications matched for project ':' - nothing to publish.
:build UP-TO-DATE
:libs:unpuzzle:downloadEclipse
Downloading file: http://mirror.netcologne.de/eclipse//technology/epp/downloads/release/luna/SR2/eclipse-jee-luna-SR2-win32-x86_64.zip
:libs:unpuzzle:downloadEclipse FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':libs:unpuzzle:downloadEclipse'.
> http://mirror.netcologne.de/eclipse//technology/epp/downloads/release/luna/SR2/eclipse-jee-luna-SR2-win32-x86_64.zip

* 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: 55.741 secs