spring-gradle-plugins / spring-build-conventions

Contains common build logic and uses conventions to build a Spring Project with Gradle
14 stars 18 forks source link

IntelliJ doesn't properly resolve dependencies with Gradle 4.8 and this plugin #28

Closed vpavic closed 5 years ago

vpavic commented 6 years ago

With Gradle 4.8, IntelliJ doesn't properly resolve dependencies for a module that relies on this plugin (namely io.spring.convention.spring-test) and declares only testCompile dependencies. The net result of this is that the project can't be compiled in IDE.

This behavior can be reproduced using Spring Session, where docs module declares the following dependencies:

dependencies {
    testCompile project(':spring-session-core')
    testCompile project(':spring-session-data-redis')
    testCompile project(':spring-session-hazelcast')
    testCompile project(':spring-session-jdbc')
    testCompile 'org.springframework:spring-jdbc'
    testCompile 'org.springframework:spring-messaging'
    testCompile 'org.springframework:spring-webmvc'
    testCompile 'org.springframework:spring-websocket'
    testCompile 'org.springframework.security:spring-security-config'
    testCompile 'org.springframework.security:spring-security-web'
    testCompile 'org.springframework.security:spring-security-test'
    testCompile 'junit:junit'
    testCompile 'org.mockito:mockito-core'
    testCompile 'org.springframework:spring-test'
    testCompile 'org.assertj:assertj-core'
    testCompile 'com.hazelcast:hazelcast'
    testCompile 'io.lettuce:lettuce-core'
    testCompile 'javax.servlet:javax.servlet-api'
}

With Gradle 4.7 (project at commit spring-projects/spring-session@63f1050) this is resolved as expected:

gradle-4 7

However with Gradle 4.8 (project at commit spring-projects/spring-session@4a52de0) this is resolved as:

gradle-4 8

Which results in compilation errors. If however a single dependency is declared as compile dependency, then things do work with 4.8:

gradle-4 8-workaround

I've tracked the root cause to use of propdeps-idea - with that plugin out of the picture, the dependencies are resolved as expected. Perhaps we could consider replacing the propdeps-plugin with gradle-extra-configurations-plugin?

vpavic commented 5 years ago

I believe this was resolved with #33.