I am quite sure I am doing something wrong as I only see very old entries about this topic and no one else seems to have this problem. The issue is that sometimes the maven enhancement plugin works, sometimes it does not. Worst type of problem, really, being non-deterministic.
Anyway, I have a mixed Java/Kotlin project. I took the
https://github.com/ebean-orm-examples/example-minimal project from GitHub and used that as a starting point. I updated the versions of the dependencies based on the information on this page:
http://ebean-orm.github.io/releases which referred me to
http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22io.ebean%22Kotlin classes are in the same folder as Java classes, in case that could somehow be a problem.
javap Customer.class reveals sometimes enhanced, sometimes not. Enhancement is supposed to happen in the compile goal automatically, is it not?
Anyone see any glaring problem?
Thanks in advance.
The properties:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<java.version>1.8</java.version>
<!--<ebean-maven-plugin.args>debug=2</ebean-maven-plugin.args>-->
<ebean.version>10.4.2</ebean.version>
<kotlin.version>1.1.3-2</kotlin.version>
<ebeanorm-enhancement.plugin.args>debug=0</ebeanorm-enhancement.plugin.args>
<querybean-maven-plugin.version>2.1.1</querybean-maven-plugin.version>
<avaje-ebeanorm-mavenenhancer.version>4.9.1</avaje-ebeanorm-mavenenhancer.version>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
</properties>The dependencies:
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.20</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-simple -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.25</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/io.ebean/ebean -->
<!-- https://mvnrepository.com/artifact/io.ebean/ebean -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean</artifactId>
<version>${ebean.version}</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId>
<version>10.4.1</version>
</dependency>
<!-- optionally add query beans -->
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-querybean</artifactId>
<version>10.3.1</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>kotlin-querybean-generator</artifactId>
<version>10.1.2</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>querybean-generator</artifactId>
<version>10.2.1</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>ebean-annotation</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>io.ebean</groupId>
<artifactId>persistence-api</artifactId>
<version>2.2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/junit/junit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
The plugins I have activated:
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin> <plugin>
<groupId>org.avaje.ebean</groupId>
<artifactId>ebean-maven-plugin</artifactId>
<version>8.2.1</version>
<executions>
<execution>
<id>main</id>
<phase>process-classes</phase>
<configuration>
<transformArgs>debug=1</transformArgs>
</configuration>
<goals>
<goal>enhance</goal>
</goals>
</execution>
</executions>
</plugin>