Kotlin-dsl-samples: multi-project build, inter-project dependencies not working.

Created on 12 Jun 2017  路  3Comments  路  Source: gradle/kotlin-dsl-samples

I am trying to build a multi-project setup with shared project dependency.

During build time I am getting Unresolved reference: Quote error . This class is in shared project which is added as dependency to sibling project.

./gradlew stream-service:build
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (50, 67): Unresolved reference: Quote
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (54, 67): Unresolved reference: Quote
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (73, 13): Unresolved reference: Quote
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (74, 13): Unresolved reference: Quote
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (75, 13): Unresolved reference: Quote
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (76, 13): Unresolved reference: Quote
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (77, 13): Unresolved reference: Quote
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (78, 13): Unresolved reference: Quote
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (79, 13): Unresolved reference: Quote
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (84, 44): Unresolved reference: Quote
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (88, 20): Unresolved reference: it
e: /Work/reactive-apps/stream-service/src/main/kotlin/com/example/StreamApplication.kt: (93, 36): Unresolved reference: Quote

> Task :stream-service:compileKotlin
Using kotlin incremental compilation


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':stream-service:compileKotlin'.
> Compilation error. See log for more details

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


I am using Gradle 4.0-rc-2

How to Reproduce

git clone https://github.com/xmlking/reactive-apps
./gradlew stream-service:build # fail
./gradlew ui-app:test  # fail
./gradlew mongo-data-service:build # pass

Most helpful comment

I have to add following two settings for shared lib project, to resolve this issue for Spring Boot 2.0.0 M1

tasks.withType<BootJar> {
    enabled = false
}
tasks.withType<Jar> {
    enabled = true
}

All 3 comments

I have to add following two settings for shared lib project, to resolve this issue for Spring Boot 2.0.0 M1

tasks.withType<BootJar> {
    enabled = false
}
tasks.withType<Jar> {
    enabled = true
}

It is happening to me as well, but as I am still using the gradle configuration in groovy I had to add the following two lines instead.

bootJar.enabled = false  
jar.enabled = true

Adding the following alone solved the issue

tasks.withType<Jar> {
    enabled = true
}
Was this page helpful?
0 / 5 - 0 ratings