[GRADLE-2691] maven2gradle generates deprecated property assignment Created: 22/Feb/13  Updated: 28/Mar/13  Resolved: 28/Mar/13

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.6-rc-1

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 0


 Description   

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.



 Comments   
Comment by Gradle Forums [ 22/Feb/13 ]

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`.

Comment by Peter Walker (Inactive) [ 27/Feb/13 ]

Luke and I had a quick chat on this. We think that changing the current text to a comment along the lines of:
compile(group: 'junit', name: 'junit', version:'4.8.2')

{ /* This dependency was originally in the maven provided scope, but the project was not of type war. * This behavior is not yet support by Gradle, so this dependency has been converted to a compile dependency. * Please review and delete this closure when resolved. */ }
Generated at Wed Jun 30 12:28:52 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.