You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I have a multi-module Maven project, in which one of the shared modules is called commons and is used by other modules (let's called them A and B).
All modules (A, B and commons) contain classes that are @Serializable.
All modules do have kotlinx-serialization-json-jvm dependency.
The kotlin-maven-plugin is configured for all modules as follows:
When compiling the project, I'm getting an error on the first module that is using commons as dependency (e.g. A):
Your current kotlinx.serialization core version is 2.0.20, while current Kotlin compiler plugin unknown requires at least 1.0-M1-SNAPSHOT. Please update your kotlinx.serialization runtime dependency.
When I removed all @Serializable classes from commons and got rid of the plugin there, project was compiling again.
As a temporary workaround, I can suppress errors on all @Serializable classes which makes the compilation working: @Suppress("PROVIDED_RUNTIME_TOO_LOW", "INLINE_CLASSES_NOT_SUPPORTED") To Reproduce
In commons module:
@JvmInline
@Serializable
value classUserId(
valid:String,
)
In A module:
importcommons.UserId
@Serializable
data classEvent(
valuserId:UserId,
)
Expected behavior
Multi-module Maven project can be compiled without any errors.
Environment
Kotlin version: 2.0.20
Library version: 1.7.2
Kotlin platforms: JVM
Maven version: 3.9.7
IDE version: IntelliJ IDEA 2024.2.1
Other relevant context: MacOS 14.5, JRE 21.0.4 Temurin
The text was updated successfully, but these errors were encountered:
IDE Version: IntelliJ IDEA 2024.2.3 (Ultimate Edition)
Details:
The @Suppress("PROVIDED_RUNTIME_TOO_LOW", "INLINE_CLASSES_NOT_SUPPORTED") workaround works for me
Fails the same way building within IntelliJ and with gradlew command line build:
$ ./gradlew build
> Task :compileKotlin FAILED
e: file:///Path/to/Example.kt:5:1 Your current kotlinx.serialization core version is 2.0.20, while current Kotlin compiler plugin unknown requires at least 1.0-M1-SNAPSHOT. Please update your kotlinx.serialization runtime dependency.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> 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.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 814ms
1 actionable task: 1 executed
Describe the bug
I have a multi-module Maven project, in which one of the shared modules is called
commons
and is used by other modules (let's called themA
andB
).All modules (
A
,B
andcommons
) contain classes that are@Serializable
.All modules do have
kotlinx-serialization-json-jvm
dependency.The
kotlin-maven-plugin
is configured for all modules as follows:When compiling the project, I'm getting an error on the first module that is using
commons
as dependency (e.g.A
):When I removed all
@Serializable
classes fromcommons
and got rid of the plugin there, project was compiling again.As a temporary workaround, I can suppress errors on all
@Serializable
classes which makes the compilation working:@Suppress("PROVIDED_RUNTIME_TOO_LOW", "INLINE_CLASSES_NOT_SUPPORTED")
To Reproduce
In
commons
module:In
A
module:Expected behavior
Multi-module Maven project can be compiled without any errors.
Environment
The text was updated successfully, but these errors were encountered: