as you've read in the title, I have a problem using Mapstruct with Kotlin and Maven.
(FYI: The solutions in this post didn't resolve the issue for me).
Following mapstruct-examples/mapstruct-kotlin, I've added the kapt plugin alongside the dependency to my project-roots <pluginManagement>:
<!-- Cut out non-kapt executions -->
<execution>
<id>kapt</id>
<goals>
<goal>kapt</goal>
</goals>
<configuration>
<sourceDirs>
<sourceDir>src/main/kotlin</sourceDir>
<sourceDir>src/main/java</sourceDir>
</sourceDirs>
<annotationProcessorPaths>
<annotationProcessorPath>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
<version>${org.mapstruct.version}</version> <!-- :1.5.5.Final -->
</annotationProcessorPath>
</annotationProcessorPaths>
</configuration>
</execution>
Then I use it in each sub module like so:
<!-- Cut out unnecessary stuff again -->
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
</plugin>
Just in case it helps clearing some questions, here's the Mapper:
@Mapper
interface CustomMapper {
fun toDTO(entity: Entity): DTO
fun toEntity(dto: DTO): Entity
}