gradle-extra-configurations-plugin icon indicating copy to clipboard operation
gradle-extra-configurations-plugin copied to clipboard

compile(group: 'org.springframework.cloud', name: 'spring-cloud-starter-zookeeper-discovery', version:'2.1.0.RELEASE') { exclude(module: 'zookeeper') }, optional, it's not work

Open halower opened this issue 5 years ago • 1 comments

 compile(group: 'org.springframework.cloud', name: 'spring-cloud-starter-zookeeper-discovery', version:'2.1.0.RELEASE',optional) {
        exclude(module: 'zookeeper')
    }

it's not work,too

my maven code is

    <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zookeeper-discovery</artifactId>
            <version>${spring-cloud-zookeeper.version}</version>
            <optional>true</optional>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.zookeeper</groupId>
                    <artifactId>zookeeper</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

halower avatar Mar 24 '19 12:03 halower

'optional' is a closure.... so....

compile(group: 'org.springframework.cloud', name: 'spring-cloud-starter-zookeeper-discovery', version:'2.1.0.RELEASE') { exclude(module: 'zookeeper') // Manually call the code in the closure ........... //project.ext.optionalDeps << it optionalDeps << it }

shepherdviolet avatar Sep 09 '19 08:09 shepherdviolet