[GRADLE-2701] "exclude" specified in the top-level build file using allprojects clause is not applied when generating eclipse files for a subproject Created: 08/Mar/13  Updated: 02/Apr/13  Resolved: 02/Apr/13

Status: Resolved
Project: Gradle
Affects Version/s: 1.4
Fix Version/s: None

Type: Bug
Reporter: Hemant Gokhale Assignee: Unassigned
Resolution: Not A Bug Votes: 0

Known Issue Of:
1.4

 Description   

I have a project with multiple sub-projects. The top-level build file has this:

allprojects {
configurations

{ all*.exclude group: 'group_name', module: 'module_name' }

}

When I generate eclipse files for a sub-project using the eclipse task, this exclusion is ignored. If I add the configurations block directly in the sub-project build file it works as expected.



 Comments   
Comment by Adam Murdoch [ 27/Mar/13 ]

Using `all*.exclude` configures all the configurations defined at the moment the statement is called. If you do this in the root build script, the subprojects will not yet be configured and so there will be no configurations defined.

You need to do this instead:

allprojects {
configurations.all

{ exclude group: 'group_name', module: 'module_name' }

}

The `all { }` method is lazy and configures the configurations as they are defined.

Comment by Hemant Gokhale [ 31/Mar/13 ]

I tried that and it worked like a charm! Thank you, Adam.

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