[GRADLE-3101] Changes to IDEA scopes mapping can trigger dependency resolving Created: 06/Jun/14  Updated: 23/Jun/14  Resolved: 14/Jun/14

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

Type: Bug
Reporter: Radim Kubacki Assignee: Radim Kubacki
Resolution: Won't Fix Votes: 0

Known Issue Of:
2.0

 Description   

Modifications to IDEA scopes using += operator can cause dependency resolving for configuration and the configuration cannot be changed after that. It means script like this:

apply plugin: 'java'
apply plugin: 'idea'

configurations {
  provided
  provided.extendsFrom(compile)
}

idea {
  module {
    scopes.PROVIDED.plus += configurations.provided
  }
}
dependencies {
    provided '...'
}

will fail.

Possible ways how to work around this is to avoid += operator or to push this block towards the end of build script.



 Comments   
Comment by Daz DeBoer [ 12/Jun/14 ]

This bug is due to a change in the way that groovy evaluates '+='.

The general solution is to switch the idea plugin to replace:

scopes.PROVIDED.plus += project.configurations.provided

with

scopes.PROVIDED.plus += [project.configurations.provided]

Comment by Radim Kubacki [ 14/Jun/14 ]

We're not going to fix this: there is a simple way how to migrate build scripts (wrapping the right side argument into a list or using << operator) and possible fixes look to complex at the moment.

Comment by Szczepan Faber [ 23/Jun/14 ]

This issue has been thoroughly documented in the 2.0 release notes. We cannot really fix it but there's a very easy solution to the problem (documented).

Generated at Wed Jun 30 12:39:59 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.