maven BytecodeVersion不支持Java 11

zhte4eai  于 11个月前  发布在  Maven
关注(0)|答案(1)|浏览(163)

我在POM中有这样的配置:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-enforcer-plugin</artifactId>
    <version>3.4.1</version> <!-- Trova l'ultima versione su http://maven.apache.org/plugins/maven-enforcer-plugin/ -->
    <executions>
        <execution>
            <id>enforce-bytecode-version</id>
            <goals>
                <goal>enforce</goal>
            </goals>
            <configuration>
                <rules>
                    <enforceBytecodeVersion>
                        <maxJdkVersion>11</maxJdkVersion>
                        <excludes>
                            <exclude>org.mindrot:jbcrypt</exclude>
                        </excludes>
                    </enforceBytecodeVersion>
                </rules>
                <fail>true</fail>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>extra-enforcer-rules</artifactId>
            <version>1.0-beta-5</version>
        </dependency>
    </dependencies>
</plugin>

字符串
它给了我错误
执行目标org.apache.maven.plugins:maven-enforcer-plugin:3.4.1:enforce failed:给定的JDK版本未知。应该类似于“1.7”-> [Help 1]
我还没有在网上找到任何设置Java 11的解决方案。

myzjeezk

myzjeezk1#

解决方案是更新依赖版本

<dependency>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>extra-enforcer-rules</artifactId>
    <version>1.7.0</version>
</dependency>

字符串

相关问题