I'm currently trying to include Project Lombok helper into my Gradle project, but while following their instructions for Gradle within my build.gradle, I'm getting the following error:
Error:(11, 0) Build script error, unsupported Gradle DSL method found: 'provided()'!
Possible causes could be:
My current build.gradle file:
apply plugin: 'java' sourceCompatibility = 1.5 version = '1.0' repositories { mavenCentral() } dependencies { provided "org.projectlombok:lombok:1.14.4" testCompile group: 'junit', name: 'junit', version: '4.11' }
Applying a plugin to a project allows the plugin to extend the project's capabilities. It can do things such as: Extend the Gradle model (e.g. add new DSL elements that can be configured) Configure the project according to conventions (e.g. add new tasks or configure sensible defaults)
This plugin adds Gradle Support to Jenkins. Gradle is managed as another tool inside Jenkins (the same way as Ant or Maven), including support for automatic installation and a new build step is provided to execute Gradle tasks.
There are two types of plugins one is script plugin and second is binary plugin.
The Java Gradle Plugin development plugin can be used to assist in the development of Gradle plugins. It automatically applies the Java Library plugin, adds the gradleApi() dependency to the api configuration and performs validation of plugin metadata during jar task execution.
As of release 2.12, provided
scope is called compileOnly
Old answer:
Provided scope is available in 'war' plugin (http://www.gradle.org/docs/current/userguide/war_plugin.html , providedCompile ) If You don't want to use the 'war' plugin, there is also an opened JIRA issue regarding 'provided' scope http://issues.gradle.org/browse/GRADLE-784 , suggested workaround is to create Your own cofiguration:
configurations { provided }
and set it to be used with your compilation classpath:
sourceSets { main { compileClasspath += configurations.provided } }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With