首页 > 解决方案 > 收到错误“构建此项目 Maven 3.6.3(或更高版本)是必需的。请安装它

问题描述

我正在尝试运行 Optaweb Vehicle Routing 应用程序 ( https://github.com/kiegroup/optaweb-vehicle-routing )。当我运行时./runlocally.sh,我得到以下输出:

VRP dir: /home/[myname]/.optaweb-vehicle-routing

Getting project version...
Project version: 7.42.0-SNAPSHOT
Jarfile ‘optaweb-vehicle-routing-standalone/target/optaweb-vehicle-routing-standalone-7.42.0-SNAPSHOT.jar’ does not exist. Run Maven build now? [y/N]: y
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] OptaWeb Vehicle Routing
[INFO] OptaWeb Vehicle Routing Backend
[INFO] OptaWeb Vehicle Routing Frontend
[INFO] OptaWeb Vehicle Routing Standalone
[INFO] OptaWeb Vehicle Routing Documentation
[INFO] OptaWeb Vehicle Routing Distribution
[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Building OptaWeb Vehicle Routing 7.42.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ optaweb-vehicle-routing ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-plugin-versions) @ optaweb-vehicle-routing ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (ban-blacklisted-dependencies) @ optaweb-vehicle-routing ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (no-duplicate-declared-dependencies) @ optaweb-vehicle-routing ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-java-version) @ optaweb-vehicle-routing ---
[INFO] 
[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (enforce-maven-version) @ optaweb-vehicle-routing ---
[WARNING] Rule 0: org.apache.maven.plugins.enforcer.RequireMavenVersion failed with message:
To build this project Maven 3.6.3 (or greater) is required. Please install it.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] OptaWeb Vehicle Routing ............................ FAILURE [  1.258 s]
[INFO] OptaWeb Vehicle Routing Backend .................... SKIPPED
[INFO] OptaWeb Vehicle Routing Frontend ................... SKIPPED
[INFO] OptaWeb Vehicle Routing Standalone ................. SKIPPED
[INFO] OptaWeb Vehicle Routing Documentation .............. SKIPPED
[INFO] OptaWeb Vehicle Routing Distribution ............... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.799 s
[INFO] Finished at: 2020-08-08T13:47:17-07:00
[INFO] Final Memory: 33M/262M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (enforce-maven-version) on project optaweb-vehicle-routing: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Maven build failed. Aborting the script.

但是,我知道 Maven 已安装,因为mvn -version返回:

Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /opt/maven
Java version: 1.8.0_265, vendor: Red Hat, Inc, runtime: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.265.b01-1.fc32.x86_64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.7.11-200.fc32.x86_64", arch: "amd64", family: "unix"

我该如何摆脱这个错误?

我的操作系统是 Fedora 32,我通过dnf. 我的 JAVA_HOME 环境变量是空的,如果这与任何事情有关。

标签: javamavenbuildfedora

解决方案


推荐阅读