maven2gradle generates deprecated property assignment

I am using gradle 1.4’s maven2gradle. The build file it generated had a dependency section like this (I removed unimportant dependencies from the list here):

dependencies {
    testCompile group: 'org.easytesting', name: 'fest-assert', version:'1.4'
    compile(group: 'junit', name: 'junit', version:'4.8.2') {
        provided : true
    }
}

When I did a build, grade complained:

Usage of statement labels in build scripts has been deprecated and is scheduled to be removed in Gradle 2.0. In case you tried to configure a property named ‘provided’, replace ‘:’ with ‘=’ or ’ '. Otherwise it will not have the desired effect.

provided : true

^.

I’m not sure what should be here, because “provided” doesn’t appear to be a valid property.

Thanks for reporting this problem. I’ve exported it to JIRA. There are actually two problems here:

  • As correctly pointed out by Gradle, the generated syntax is incorrect. * There is no ‘provided’ property.

For projects that have the ‘war’ plugin applied, you can use the ‘providedCompile’ configuration. For other projects, I recommend to search the Gradle Forums/Stack Overflow/Google for how to achieve something similar to Maven’s ‘provided’ in Gradle.

Please bear with us, and keep in mind that it’s early times for ‘maven2gradle’.

Thanks for the confirmation.

I’m frustrated that migrating from Maven is not documented (or certainly not very well) given that it would seem to be a common situation. I know that the Gradle developers want to do things differently than Maven, but pointing to “Gradle Forums/SO/Google” for how to solve a very common situation isn’t helping.

Why isn’t it helping? The question has been asked and answered numerous times before, and you should be able to find a decent answer in a couple of minutes. Alternatively, you could also check how prominent Gradle users like Spring have solved this problem.

PS: I’m actually in favor of having a “provided” scope in Gradle, but it’s not my call.

Ted, Would it be possible to send me the pom, or the dependency section of the POM that I can test with?

Please mail it directly to me. Regards, Peter Walker COO Gradleware Inc. peter.walker@gradleware.com http://www.gradleware.com/team#peter-walker http://www.linkedin.com/in/peterbwalker Phone: 914 418 4010

Ted,

This has been fixed in our nightly distribution and will be shipped in 1.6. Would you be able to try this out and report feedback here?