Dependency on a webpack bundle file generated by kotlin-frontend-plugin


#1

I use kotlin-frontend-plugin to generate a webpack bundle.
Everything works fine, a my-client.jar is generated containing the main.bundle.js webpack bundle file.

What I would like is to use this my-client.jar file as a runtime dependency of my Spring Boot application:

runtime project(":my-client")

Unfortunatelly this fails:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':my-server:bootJar'.
> Could not resolve all task dependencies for configuration ':my-server:runtimeClasspath'.
   > Could not resolve project :my-client.
     Required by:
         project :my-server
      > Unable to find a matching variant of project :my-client:
          - Variant 'apiElements':
              - Required org.gradle.usage 'java-runtime' and found incompatible value 'java-api'.
              - Required org.jetbrains.kotlin.platform.type 'jvm' and found incompatible value 'js'.
          - Variant 'runtimeElements':
              - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime-jars'.
              - Required org.jetbrains.kotlin.platform.type 'jvm' and found in

Do you have any idea what this error message means in practice? :slight_smile:
I tried to use the runtimeElements scope instead of runtime but it fails too…