Kotlin 1.4.0 jpa plugin (kotlin-maven-noarg) never finishes on test-compile, but works fine with Kotlin 1.3.72

628 views Asked by At

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: /home/gpeterso/.m2/repository/org/jetbrains/kotlin/kotlin-maven-noarg/1.4.0/kotlin-maven-noarg-1.4.0.jar
[DEBUG] Looking for plugin jpa
[DEBUG] Got plugin instancejpa of type org.jetbrains.kotlin.test.KotlinJpaMavenPluginExtension
[INFO] Applied plugin: 'jpa'
[DEBUG] Loaded Maven plugin org.jetbrains.kotlin.test.KotlinJpaMavenPluginExtension
[DEBUG] Options for plugin jpa: [preset: jpa]
[DEBUG] Plugin options are: plugin:org.jetbrains.kotlin.noarg:preset=jpa
[DEBUG] Invoking compiler org.jetbrains.kotlin.cli.jvm.K2JVMCompiler@8d2075a with arguments:
[DEBUG] Companion=org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments$Companion@2233cac0
[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@67fb5025
[DEBUG] Companion=org.jetbrains.kotlin.cli.common.arguments.CommonToolArguments$Companion@787e4357
[DEBUG] End of arguments
[DEBUG] Using Kotlin home directory <no_path>
[DEBUG] Configuring the compilation environment
[DEBUG] Loading modules: [java.se, jdk.accessibility, jdk.attach, jdk.compiler, jdk.dynalink, jdk.httpserver, jdk.jartool, jdk.javadoc, jdk.jconsole, jdk.jdi, jdk.jfr, jdk.jshell, jdk.jsobject, jdk.management, jdk.management.jfr, jdk.net, jdk.scripting.nashorn, jdk.sctp, jdk.security.auth, jdk.security.jgss, jdk.unsupported, jdk.unsupported.desktop, jdk.xml.dom, java.base, java.compiler, java.datatransfer, java.desktop, java.xml, java.instrument, java.logging, java.management, java.management.rmi, java.rmi, java.naming, java.net.http, java.prefs, java.scripting, java.security.jgss, java.security.sasl, java.sql, java.transaction.xa, java.sql.rowset, java.xml.crypto, jdk.internal.jvmstat, jdk.management.agent, jdk.jdwp.agent, jdk.internal.ed, jdk.internal.le, jdk.internal.opt]

The same phase in kotlin-maven-plugin:1.4.0:compile takes 15 seconds or so, but kotlin-maven-plugin:1.4.0:test-compile just never completes. My 4 CPU cores just keep swapping which one goes to 100% while the other three hover around 1%-5%, so I think it's a single-threaded section of code that's running.

$ $M2/mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /tools/apache-maven-3.6.3
Java version: 11.0.8, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-112-generic", arch: "amd64", family: "unix"

Here's the plugin config from pom.xml. ${kotlin.version} is 1.4.0.

<plugin>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-maven-plugin</artifactId>
    <version>${kotlin.version}</version>
    <executions>
        <execution>
            <id>compile</id>
            <phase>compile</phase>
            <goals>
                <goal>compile</goal>
            </goals>
        </execution>
        <execution>
            <id>test-compile</id>
            <phase>test-compile</phase>
            <goals>
                <goal>test-compile</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <jvmTarget>11</jvmTarget>
        <args>
            <arg>-Xjvm-default=enable</arg>
        </args>
        <compilerPlugins>
            <plugin>jpa</plugin>
        </compilerPlugins>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-maven-noarg</artifactId>
            <version>${kotlin.version}</version>
        </dependency>
    </dependencies>
</plugin>

When I set the two <version> elements shown here to 1.3.72 everything builds fine, even if I leave other Kotlin dependencies at 1.4.0. But when the two <version> elements shown here are 1.4.0, it hangs as described. The main compile completes normally either way.

0

There are 0 answers