I have multi-module Gradle project. It consists of 3 native Spring Boot microservices and common module. Build on 8.14.3
as well on previous versions works successfully. But after upgrade to 9.0.0
the build fails with:
The Kotlin Gradle plugin was loaded multiple times in different subprojects, which is not supported and may break the build.
This might happen in subprojects that apply the Kotlin plugins with the Gradle 'plugins { ... }' DSL if they specify explicit versions, even if the versions are equal.
Please add the Kotlin plugin to the common parent project or the root project, then remove the versions in the subprojects.
If the parent project does not need the plugin, add 'apply false' to the plugin line.
See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
The Kotlin plugin was loaded in the following projects: ':book-service', ':common-model'
> Task :user-service:collectReachabilityMetadata FAILED
> Task :book-service:openApiGenerate
invokerPackage with kotlin-spring generator is ignored. Use packageName.
############################################################################################
# Thanks for using OpenAPI Generator. #
# We appreciate your support! Please consider donation to help us maintain this project. #
# https://opencollective.com/openapi_generator/donate #
############################################################################################
Successfully generated code to ...event-driven-architecture\book-service/build/generated/openapi
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':user-service:collectReachabilityMetadata'.
> Failed to query the value of task ':user-service:collectReachabilityMetadata' property 'metadataService'.
> Could not isolate value org.graalvm.buildtools.gradle.internal.GraalVMReachabilityMetadataService$Params_Decorated@4c8d90b of type GraalVMReachabilityMetadataService.Params
> Resolution of the configuration ':book-service:detachedConfiguration9' was attempted without an exclusive lock. This is unsafe and not allowed.
* Try:
> For more information, please refer to https://docs.gradle.org/9.0.0/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors in the Gradle documentation.
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to generate a Build Scan (Powered by Develocity).
> Get more help at https://help.gradle.org.
BUILD FAILED in 3s
5 actionable tasks: 5 executed
The command to start build is ./gradlew :book-service:bootBuildImage :user-service:bootBuildImage :notification-service:bootBuildImage
.
org.gradle.parallel
is true
in gradle.properties
. If I set false
, there is no error. That also increases build time.
Have tried several solutions with no result. Do I need to fix build scripts somehow or is it a bug?