Questions tagged [kotlin-maven-plugin]
15 questions
27
votes
5 answers
Kapt is not working properly with OpenJDK 16
I have an application that uses Kotlin 1.5.0 and Kapt for mapstructs. I have updated my JDK to 16 and I get the following compilation error:
Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.5.0:kapt (kapt) on project X: Compilation…

Nico
- 858
- 2
- 11
- 27
5
votes
1 answer
Creating a multi module project with maven spring and kotlin get unresolved reference
I am trying to build a multi module maven project with kotlin and spring. I get an error when the kotlin-maven-plugin runs the compile phase.
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] ---…

pnts
- 51
- 1
- 2
4
votes
1 answer
How to enable Explicit API mode for maven based Kotlin projects?
I would like to enable Explicit API mode for my Kotlin project. However, I cannot find a way how to do it. On the site, I can see only gradle based configuration:
kotlin {
// for strict mode
explicitApi()
// or
explicitApi =…

Denis
- 3,595
- 12
- 52
- 86
2
votes
1 answer
How to run kotlin test files with mvn test?
I want to run multiple kotlin test files in multiple folders within src/test/kotlin. The problem is when I run mvn test then some tests are running but not all of them. I tried different solutions like adding kotlin-maven-plugin and adding source…

rshncp
- 56
- 3
2
votes
0 answers
Kotlin script fails to build in maven
I'm trying to build kts scripts with maven but I'm unable to compile them. Is it even possible to build kotlin scripts using maven? Same code using gradle compiles just fine.
Script base class:
package com.test.scripts.api
import…

Indrz
- 131
- 1
- 2
- 7
2
votes
1 answer
How to exclude an annotation from Kotlin AllOpen plugin?
I am using Axon Framework, where I can annotate my domain classes with @Aggregate (which is meta-annotated with @Component from Spring). Then I have to apologize for every private method/field I have by marking them final explicitly.
I think in my…

Sam
- 1,832
- 19
- 35
2
votes
1 answer
How to make kapt works with jpa
Maven fails while compileris trying to generated jpa entities.
Gender_.java:[11,50] cannot find symbol Gender
Both classes are exists. Gender class exists in kaptStubs directory, Gender_ in kapt directory.
pom:
…

Irina
- 939
- 1
- 8
- 26
2
votes
0 answers
How specify generate path for annotationProcessPath in kotlin-maven-plugin?
I am using hibernate-jpamodelgen as static jpa generator in kotlin-maven-plugin.
However it can't find original classes.
cannot find symbol [ERROR] symbol: class Type
After inspection, I found that in that case entities generated in…

Irina
- 939
- 1
- 8
- 26
1
vote
0 answers
How to allow Result to be return type in Kotlin?
I researched an error Why can't 'kotlin.Result' be used as a return type? and want to enable it by -Xallow-result-return-type.
I use kotlin-maven-plugin and my pom.xml build section:
…

Dmytro Chasovskyi
- 3,209
- 4
- 40
- 82
1
vote
0 answers
How to bundle kotlinjs dependencies into a single file
Both from reading documentation and experimentation it's relatively easy to configure kotlin-maven-plugin in a multimodule maven project so that kotlin code in one module depending on code in some other module successfully resolves this…

shabunc
- 23,119
- 19
- 77
- 102
0
votes
0 answers
2-staged compilation of Kotlin code with kotlin-maven-plugin
I have a Kotlin maven-based project, compiled with kotlin-maven-plugin.
My project structure looks like following:
+- src/gen/kotlin
+- src/main/kotlin
...
src/gen/kotlin contains sources that will generate other source…

preeze
- 1,061
- 1
- 12
- 18
0
votes
0 answers
Kotlin/Spring Boot Application Fails to Build in Maven using Docker
I am trying to build an image for Kotlin/Spring Boot application. But when I run docker build I get the following error:
[ERROR] Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.7.20:compile (compile) on project download-common:…

hell_storm2004
- 1,401
- 2
- 33
- 66
0
votes
2 answers
How to suppress Kotlin unused parameter warning in all test classes?
In parameterized tests I use hint parameter to clarify test case naming. From the static analyzer point of view this parameter is never used, so this warning from kotlin-maven-plugin appears in the build log:
[WARNING]…

diziaq
- 6,881
- 16
- 54
- 96
0
votes
1 answer
Kotlin 1.5.0 in Maven Multi-Module: java.lang.UnsupportedClassVersionError
I have a Multi-module Maven project. I had to import a maven module Vader (which uses a mix of Kotlin 1.5.0 and Java 11) and use it as a dependency for one of my modules which purely uses java 11. The code compiles well but at runtime I get this…

Gopal S Akshintala
- 1,933
- 1
- 17
- 24
0
votes
0 answers
Kotlin 1.4.0 jpa plugin (kotlin-maven-noarg) never finishes on test-compile, but works fine with Kotlin 1.3.72
I'm returning to a project that hadn't been checked in before a break. My maven build appears to hang in the test-compile while applying the plugin, 'jpa'.
[DEBUG] Plugin classpaths are:…

GlenPeterson
- 4,866
- 5
- 41
- 49