jahia

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


I've installed DigitalExperienceManager-CommunityDistribution-7.3.1.0-r59490.jar on my MAC, and run the commands to start it:

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

I find this error in 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

But I'm sure maven is installed on my machine already:

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

What can I do to solve this problem?


Solution

  • Do you have maven in your path? Seems Jahia cannot find maven on startup. When it is not in path you can specify in jahia.properties (\digital-factory-config\jahia\jahia.properties) the full path to maven:

    #mvnPath = mvn
    

    Uncomment this property and specify the right path to maven like:

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