Wrong api version on Maven test

Hello folks,

I’ve been using Gradle with IntelliJ but switched back to Maven due to some memory usage issues. But i’m facing a problem that no matter what I set on pom.xml, the compiler always target Kotlin as API version 1.2, even specifying explicitly kotlin plugin 1.3.41.

Can some one help me to figureout what is missing? There is some kind of property to force API version?

Here is the effective_pom.xml (15.2 KB)

And there the maven output with -X option:

[DEBUG]   (f) testModuleName = user-service-test
[DEBUG]   (f) testOutput = /mnt/d/Projetos/SCIO/userservice/target/test-classes
[DEBUG]   (f) mojoExecution = org.jetbrains.kotlin:kotlin-maven-plugin:1.3.41:test-compile {execution: test-compile}
[DEBUG] -- end configuration --
[DEBUG] Kotlin version 1.3.41 (JRE 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
[DEBUG] Compiling Kotlin sources from [/mnt/d/Projetos/SCIO/userservice/src/test/kotlin]
[DEBUG] Classpath: /mnt/d/Projetos/SCIO/userservice/target/test-classes:/mnt/d/Projetos/SCIO/userservice/target/classes:/home/afonsolage/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.3.41/kotlin-stdlib-jdk8-1.3.41.jar:/home/afonsolage/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.3.41/kotlin-stdlib-1.3.41.jar:/home/afonsolage/.m2/repository/org/jetbrains/annotations/13.0/annotations-13.0.jar:/home/afonsolage/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.41/kotlin-stdlib-jdk7-1.3.41.jar:/home/afonsolage/.m2/repository/org/jetbrains/kotlinx/kotlinx-serialization-runtime/0.11.1/kotlinx-serialization-runtime-0.11.1.jar:/home/afonsolage/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.40/kotlin-stdlib-common-1.3.40.jar:/home/afonsolage/.m2/repository/io/ebean/ebean/11.40.1/ebean-11.40.1.jar:/home/afonsolage/.m2/repository/org/yaml/snakeyaml/1.21/snakeyaml-1.21.jar:/home/afonsolage/.m2/repository/io/ebean/persistence-api/2.2.2/persistence-api-2.2.2.jar:/home/afonsolage/.m2/repository/io/ebean/ebean-annotation/4.10/ebean-annotation-4.10.jar:/home/afonsolage/.m2/repository/io/ebean/ebean-types/1.3/ebean-types-1.3.jar:/home/afonsolage/.m2/repository/io/ebean/ebean-datasource/4.5.2/ebean-datasource-4.5.2.jar:/home/afonsolage/.m2/repository/io/ebean/ebean-datasource-api/4.5/ebean-datasource-api-4.5.jar:/home/afonsolage/.m2/repository/org/avaje/avaje-classpath-scanner/3.1.1/avaje-classpath-scanner-3.1.1.jar:/home/afonsolage/.m2/repository/org/avaje/avaje-classpath-scanner-api/2.2/avaje-classpath-scanner-api-2.2.jar:/home/afonsolage/.m2/repository/io/ebean/ebean-migration/11.16.2/ebean-migration-11.16.2.jar:/home/afonsolage/.m2/repository/org/antlr/antlr4-runtime/4.7.2/antlr4-runtime-4.7.2.jar:/home/afonsolage/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.8/jackson-core-2.9.8.jar:/home/afonsolage/.m2/repository/io/ebean/ebean-querybean/11.40.1/ebean-querybean-11.40.1.jar:/home/afonsolage/.m2/repository/com/rabbitmq/amqp-client/5.7.1/amqp-client-5.7.1.jar:/home/afonsolage/.m2/repository/org/postgresql/postgresql/42.2.6/postgresql-42.2.6.jar:/home/afonsolage/.m2/repository/org/slf4j/slf4j-api/1.7.26/slf4j-api-1.7.26.jar:/home/afonsolage/.m2/repository/org/avaje/composite/logback/1.1/logback-1.1.jar:/home/afonsolage/.m2/repository/org/slf4j/jul-to-slf4j/1.7.25/jul-to-slf4j-1.7.25.jar:/home/afonsolage/.m2/repository/org/slf4j/jcl-over-slf4j/1.7.25/jcl-over-slf4j-1.7.25.jar:/home/afonsolage/.m2/repository/org/slf4j/log4j-over-slf4j/1.7.25/log4j-over-slf4j-1.7.25.jar:/home/afonsolage/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar:/home/afonsolage/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar:/home/afonsolage/.m2/repository/io/github/microutils/kotlin-logging/1.6.26/kotlin-logging-1.6.26.jar:/home/afonsolage/.m2/repository/io/github/microutils/kotlin-logging-common/1.6.26/kotlin-logging-common-1.6.26.jar:/home/afonsolage/.m2/repository/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar:/home/afonsolage/.m2/repository/org/jetbrains/kotlin/kotlin-test-junit/1.3.41/kotlin-test-junit-1.3.41.jar:/home/afonsolage/.m2/repository/org/jetbrains/kotlin/kotlin-test-annotations-common/1.3.41/kotlin-test-annotations-common-1.3.41.jar:/home/afonsolage/.m2/repository/org/jetbrains/kotlin/kotlin-test/1.3.41/kotlin-test-1.3.41.jar:/home/afonsolage/.m2/repository/org/jetbrains/kotlin/kotlin-test-common/1.3.41/kotlin-test-common-1.3.41.jar:/home/afonsolage/.m2/repository/junit/junit/4.12/junit-4.12.jar:/home/afonsolage/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/home/afonsolage/.m2/repository/io/ebean/test/ebean-test-config/11.40.1/ebean-test-config-11.40.1.jar:/home/afonsolage/.m2/repository/io/ebean/test/ebean-test-docker/2.6.1/ebean-test-docker-2.6.1.jar:/home/afonsolage/.m2/repository/com/h2database/h2/1.4.196/h2-1.4.196.jar:/home/afonsolage/.m2/repository/org/avaje/composite/junit/1.1/junit-1.1.jar:/home/afonsolage/.m2/repository/org/assertj/assertj-core/3.10.0/assertj-core-3.10.0.jar:/home/afonsolage/.m2/repository/org/mockito/mockito-core/2.18.3/mockito-core-2.18.3.jar:/home/afonsolage/.m2/repository/net/bytebuddy/byte-buddy/1.8.5/byte-buddy-1.8.5.jar:/home/afonsolage/.m2/repository/net/bytebuddy/byte-buddy-agent/1.8.5/byte-buddy-agent-1.8.5.jar:/home/afonsolage/.m2/repository/org/objenesis/objenesis/2.6/objenesis-2.6.jar
[DEBUG] Classes directory is /mnt/d/Projetos/SCIO/userservice/target/test-classes
[DEBUG] Module name is user-service
[DEBUG] Invoking compiler org.jetbrains.kotlin.cli.jvm.K2JVMCompiler@78e7a484 with arguments:
[DEBUG] Companion=org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments$Companion@b61edb9
[DEBUG] PLUGIN_OPTION_FORMAT=plugin:<pluginId>:<optionName>=<value>
[DEBUG] WARN=warn
[DEBUG] ERROR=error
[DEBUG] ENABLE=enable
[DEBUG] DEFAULT=default
[DEBUG] Companion=org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments$Companion@5d3ff859
[DEBUG] Companion=org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments$Companion@32bb0072
[DEBUG] End of arguments
[DEBUG] Using Kotlin home directory <no_path>
[DEBUG] Scripting plugin will not be loaded: not all required jars are present in the classpath (missing files: [./kotlin-scripting-compiler.jar, ./kotlin-scripting-compiler-impl.jar, ./kotlin-scripting-common.jar, ./kotlin-scripting-jvm.jar])
[DEBUG] Configuring the compilation environment
[ERROR] /mnt/d/Projetos/SCIO/userservice/src/test/kotlin/com/scio/omni/service/usr/ControllerTest.kt: (82, 29) This declaration is only available since Kotlin 1.3 and cannot be used with the specified API version 1.2
[ERROR] /mnt/d/Projetos/SCIO/userservice/src/test/kotlin/com/scio/omni/service/usr/ControllerTest.kt: (102, 29) This declaration is only available since Kotlin 1.3 and cannot be used with the specified API version 1.2
[ERROR] /mnt/d/Projetos/SCIO/userservice/src/test/kotlin/com/scio/omni/service/usr/ControllerTest.kt: (196, 36) This declaration is only available since Kotlin 1.3 and cannot be used with the specified API version 1.2
[ERROR] /mnt/d/Projetos/SCIO/userservice/src/test/kotlin/com/scio/omni/service/usr/ControllerTest.kt: (305, 29) This declaration is only available since Kotlin 1.3 and cannot be used with the specified API version 1.2
[ERROR] /mnt/d/Projetos/SCIO/userservice/src/test/kotlin/com/scio/omni/service/usr/TestUtil.kt: (59, 22) This declaration is only available since Kotlin 1.3 and cannot be used with the specified API version 1.2
[ERROR] /mnt/d/Projetos/SCIO/userservice/src/test/kotlin/com/scio/omni/service/usr/TestUtil.kt: (61, 24) This declaration is only available since Kotlin 1.3 and cannot be used with the specified API version 1.2
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:15 min
[INFO] Finished at: 2019-07-11T12:48:07Z
[INFO] ------------------------------------------------------------------------

Thanks!

Try setting the apiVersion property to 1.3 explicitly, that should most likely fix it.