I am new to gradle. I use 1.11. I have small prototype project designed originally for maven. It is simple project using Wildfly 8 as application server and programmed with Eclipse Kepler.
I tried to convert POM using gradle init. Original POM: https://gist.github.com/anonymous/beb29d5e42ccfdd298d5
Generated build.gradle (only change I did was changing Compatibility=1.5 to 1.7): https://gist.github.com/anonymous/e388344a7786faeda448
What is shown after execution (just 'gradle’ command in directory with this build.gradle):
D:\devel\workspace\testland\bookman-back-lend>gradle
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\devel\workspace\testland\bookman-back-lend\build.gradle' line: 21
* What went wrong:
A problem occurred evaluating root project 'bookman-back-lend'.
> Could not find method providedCompile() for arguments [{group=javax.enterprise, name=cdi-api, version=1.1}, build_72hast944m6jurcoj1ihtgd2no$_run_closure2_closure5@59e64a6f] on root project 'bookman-back-lend'.
* 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.156 secs
Problem seems to be with this snippet:
providedCompile(group: 'javax.enterprise', name: 'cdi-api', version:'1.1') {
exclude(module: 'jsr250-api')
exclude(module: 'el-api')
exclude(module: 'jboss-interceptors-api_1.1_spec')
}
It looks like bug in gradle init (it is incubating, after all). Is there any fix that I could apply by hand to generated file?
Unfortunately, I do not know yet how to create build.gradle from scrath that would build, compile and send app to Wildfly (in essence, what maven plugin wildfly:deploy does).