What's the different between all*.exclude and all.exclude in configurations.all

前端 未结 1 1413
故里飘歌
故里飘歌 2021-01-15 00:40

I want to know what exactly different between all*.exclude and all.exclude in configurations.all when you want to exclude dependencies

configurations.all {
          


        
相关标签:
1条回答
  • 2021-01-15 01:04

    The correct syntax is:

    Using the all method

    configurations.all {
        exclude group: 'org.json', module: 'json'
    }
    

    OR

    Using the all property

    configurations {
        all*.exclude(group: 'org.json', module: 'json')
    }
    

    The all property holds a list of all configuration objects within the project configurations.

    If you want to see what it actually it contains you can do:

    println configurations.all.names
    

    OR

    println configurations.all*.name
    

    And the syntax *. is a groovy specific operator called the spread operator. You can read how that works to understand why it worked here.

    0 讨论(0)
提交回复
热议问题