0

我要回到一个在休息前没有签到的项目。在应用插件“jpa”时,我的 Maven 构建似乎挂在测试编译中。

[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]

同一阶段kotlin-maven-plugin:1.4.0:compile需要 15 秒左右,但kotlin-maven-plugin:1.4.0:test-compile永远不会完成。我的 4 个 CPU 内核一直在交换,其中一个达到 100%,而其他三个在 1%-5% 左右徘徊,所以我认为这是一个正在运行的单线程代码部分。

$ $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"

这是来自pom.xml. ${kotlin.version}是 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>

当我将<version>此处显示的两个元素设置为1.3.72一切正常时,即使我将其他 Kotlin 依赖项保留在 1.4.0。但是当<version>这里显示的两个元素是 1.4.0 时,它会像描述的那样挂起。无论哪种方式,主编译都会正常完成。

4

0 回答 0