DigitalExperienceManager-CommunityDistribution-7.3.1.0 启动时出现错误 'Cannot set maven executable to mvn, please check your configuration'

DigitalExperienceManager-CommunityDistribution-7.3.1.0 starts with error 'Cannot set maven executable to mvn, please check your configuration'

我在我的 MAC 上安装了 DigitalExperienceManager-CommunityDistribution-7.3.1.0-r59490.jar,运行 启动它的命令:

cd /Applications/DigitalExperienceManager-CommunityDistribution-7.3.1.0/
./start.sh

我在 catalina.out 中发现了这个错误:

2020-12-16 19:14:55,509: INFO [ProcessHelper] - [mvn, -version] 2020-12-16 19:14:55,517: ERROR [ModuleBuildHelper] - Cannot set maven executable to mvn, please check your configuration org.jahia.exceptions.JahiaRuntimeException: java.io.IOException: Cannot run program "mvn" (in directory "."): error=2, No such file or directory at org.jahia.utils.ProcessHelper.execute(ProcessHelper.java:203) at org.jahia.utils.ProcessHelper.execute(ProcessHelper.java:138) at org.jahia.services.templates.ModuleBuildHelper.checkMavenExecutable(ModuleBuildHelper.java:493) at org.jahia.services.templates.ModuleBuildHelper.afterPropertiesSet(ModuleBuildHelper.java:534) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1573)

at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.pluto.driver.PortalStartupListener.contextInitialized(PortalStartupListener.java:108) at org.jahia.bin.listeners.JahiaContextLoaderListener.contextInitialized(JahiaContextLoaderListener.java:235)

Caused by: java.io.IOException: Cannot run program "mvn" (in directory "."): error=2, No such file or directory at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) at java.lang.Runtime.exec(Runtime.java:620) at org.apache.commons.exec.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:61) at org.apache.commons.exec.DefaultExecutor.launch(DefaultExecutor.java:279) at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:336) at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166) at org.jahia.utils.ProcessHelper.execute(ProcessHelper.java:199) ... 80 more Caused by: java.io.IOException: error=2, No such file or directory at java.lang.UNIXProcess.forkAndExec(Native Method) at java.lang.UNIXProcess.(UNIXProcess.java:247) at java.lang.ProcessImpl.start(ProcessImpl.java:134) at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ... 86 more 2020-12-16 19:14:55,523: ERROR [ModuleBuildHelper] - Until maven executable is correctly set, the studio will not be available

但我确定我的机器上已经安装了 maven:

$ mvn -version Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f) Maven home: /Users/george/apache-maven-3.6.3 Java version: 1.8.0_191, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/jre Default locale: zh_CN, platform encoding: UTF-8 OS name: "mac os x", version: "10.15.5", arch: "x86_64", family: "mac"

我该怎么做才能解决这个问题?

你的道路上有专家吗?似乎 Jahia 在启动时找不到 maven。当它不在路径中时,您可以在 jahia.properties (\digital-factory-config\jahia\jahia.properties) 中指定 Maven 的完整路径:

#mvnPath = mvn

取消注释 属性 并指定 Maven 的正确路径,例如:

mvnPath = /usr/local/apache-maven/bin/mvn