Graphhopper.sh does not resolve maven


#1

when executing the script on my windows-pc using cygwin I get an error that mvn is an invalid command.

I haven MAVEN_HOME set to C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.5\plugins\maven\lib\maven3.

This is my output:

## building graphhopper jar: web/target/graphhopper-web-0.13-SNAPSHOT.jar
## using maven at C:\Program Files\JetBrains\IntelliJ IDEA Community ./graphhopper.sh: line 156: C:\Program Files\JetBrains\IntelliJ IDEA
Community/bin/mvn: No such file or directory
## compilation of parent failed

The problems seems to be the many spaces within the path, which cause the following command from within the script to return only some parts:

MAVEN_HOME=$(mvn -v | grep "Maven home" | cut -d' ' -f3,4,5,6)

This of course just returns C:\Program Files\JetBrains\IntelliJ IDEA Community.

Should I create an issue for that or just stay wth it?


#2

If you are under windows I suggest using either IntelliJ directly (open project inside the IDE) or the jar that is downloadable here: https://github.com/graphhopper/graphhopper#get-started as we test it only often under Linux

Should I create an issue for that or just stay wth it?

Can you try changing it to:

MAVEN_HOME="$(mvn -v | grep 'Maven home' | cut -d' ' -f3,4,5,6)"

#3

Hi Peter,

thanks for the fast reply.

I suppose the problem is more related to cut -d ' ' -f3,4,5,6 which simply omits every character after the 4th space within the string return by mvn -v.

I already use IntelliJ and build directly from there. That´s why I don´t consider this a big issue. Just wanted to mention it.


#4

Yeah, this could be too. If you have a fix and could test this on Windows this would be very appreciated :slight_smile: