mvn test在我的项目上运行时,出现 JDK 版本错误。
这是输出:
[INFO] Scanning for projects...
[INFO]
[INFO] -----------------------< net.rorynolan:Detrendr >-----------------------
[INFO] Building Detrendr 0.0.0.9003-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-rules) @ Detrendr ---
[INFO] Adding ignorable dependency: null:jcodings:null
[INFO] Adding ignore: org/jcodings/*
[INFO] Adding ignorable dependency: null:jnr-constants:null
[INFO] Adding ignore: com/kenai/constantine/*
...
[INFO] Adding ignorable dependency: com.sun:tools:null
[INFO] Adding ignore: *
[INFO] Restricted to JDK 1.6 yet org.junit.platform:junit-platform-commons:jar:1.3.1:test contains org/junit/platform/commons/JUnitException.class targeted to JDK 1.8
[INFO] Restricted to JDK 1.6 yet org.junit.jupiter:junit-jupiter-api:jar:5.3.1:test contains org/junit/jupiter/api/AssertArrayEquals.class targeted to JDK 1.8
[INFO] Restricted to JDK 1.6 yet org.junit.jupiter:junit-jupiter-engine:jar:5.3.1:test contains org/junit/jupiter/engine/Constants.class targeted to JDK 1.8
[INFO] Restricted to JDK 1.6 yet org.junit.platform:junit-platform-engine:jar:1.3.1:test contains org/junit/platform/engine/TestDescriptor.class targeted to JDK 1.8
[WARNING] Rule 5: org.apache.maven.plugins.enforcer.EnforceBytecodeVersion failed with message:
Found Banned Dependency: org.junit.platform:junit-platform-commons:jar:1.3.1
Found Banned Dependency: org.junit.jupiter:junit-jupiter-api:jar:5.3.1
Found Banned Dependency: org.junit.jupiter:junit-jupiter-engine:jar:5.3.1
Found Banned Dependency: org.junit.platform:junit-platform-engine:jar:1.3.1
Use 'mvn dependency:tree' to locate the source of the banned dependencies.
[INFO] ------------------------------------------------------------------------
...
但这就是我所拥有的。我尝试将 maven 执行器插件明确添加到我自己的插件中,pom.xml但无济于事。
潇湘沐
相关分类