GraphHopper.com | Forum | GitHub | Maps | Blog

Error: Unable to access jarfile action=import


#1

I tried to run the shell script following the directions mentioned in the README file.
But I am encountering the following error:
I am using Mac OS X 10.11, JDK 1.8 and Maven 3.3.9.
I am pretty new to Maven so I am having trouble in resolving dependency issues.

Surajs-MacBook-Pro:map-matching-master suraj$ ./map-matching.sh action=import datasource=./map-data/WashingtonDC.osm.pbf vehicle=bike
using /Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/bin/java
ls: matching-core/target/graphhopper-map-matching--dependencies.jar: No such file or directory
[INFO] Scanning for projects…
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building hmm-lib 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ hmm-lib —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/suraj/Downloads/map-matching-master/hmm-lib/src/main/resources
[INFO]
[INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ hmm-lib —
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] — maven-resources-plugin:2.6:testResources (default-testResources) @ hmm-lib —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/suraj/Downloads/map-matching-master/hmm-lib/src/test/resources
[INFO]
[INFO] — maven-compiler-plugin:3.1:testCompile (default-testCompile) @ hmm-lib —
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] — maven-surefire-plugin:2.19.1:test (default-test) @ hmm-lib —
[INFO] Tests are skipped.
[INFO]
[INFO] — maven-jar-plugin:2.6:jar (default-jar) @ hmm-lib —
[INFO]
[INFO] — maven-failsafe-plugin:2.19.1:integration-test (default) @ hmm-lib —
[INFO] Tests are skipped.
[INFO]
[INFO] — maven-failsafe-plugin:2.19.1:verify (default) @ hmm-lib —
[INFO] Tests are skipped.
[INFO]
[INFO] — maven-install-plugin:2.4:install (default-install) @ hmm-lib —
[INFO] Installing /Users/suraj/Downloads/map-matching-master/hmm-lib/target/hmm-lib-1.0.0-SNAPSHOT.jar to /Users/suraj/.m2/repository/com/graphhopper/external/hmm-lib/1.0.0-SNAPSHOT/hmm-lib-1.0.0-SNAPSHOT.jar
[INFO] Installing /Users/suraj/Downloads/map-matching-master/hmm-lib/pom.xml to /Users/suraj/.m2/repository/com/graphhopper/external/hmm-lib/1.0.0-SNAPSHOT/hmm-lib-1.0.0-SNAPSHOT.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.563 s
[INFO] Finished at: 2016-10-18T23:47:50-04:00
[INFO] Final Memory: 12M/155M
[INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects…
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building GraphHopper Map Matching 0.9-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.graphhopper:graphhopper-reader-osm:jar:0.9-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.404 s
[INFO] Finished at: 2016-10-18T23:47:51-04:00
[INFO] Final Memory: 6M/155M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project graphhopper-map-matching-core: Could not resolve dependencies for project com.graphhopper:graphhopper-map-matching-core:jar:0.9-SNAPSHOT: Failed to collect dependencies at com.graphhopper.external:hmm-lib:jar:1.0.0-SNAPSHOT: Failed to read artifact descriptor for com.graphhopper.external:hmm-lib:jar:1.0.0-SNAPSHOT: Could not find artifact com.graphhopper:graphhopper-map-matching-parent:pom:0.9-SNAPSHOT -> [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/DependencyResolutionException
ls: matching-core/target/graphhopper-map-matching-
-dependencies.jar: No such file or directory
Error: Unable to access jarfile action=import


Observing some considerable deviation
Error: Failed to execute goal on project graphhopper-map-matching-core: Could not resolve dependencies
#2

There was a problem in the build script. Please update your repo or e.g. checkout branch 0.8


#3

I tried checking out branch 0.8 but the error that I encountered now is as follows:

[WARNING] The POM for com.graphhopper:graphhopper-reader-osm:jar:0.8.2 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] GraphHopper Map Matching Parent Project … SUCCESS [ 0.555 s]
[INFO] hmm-lib … SUCCESS [ 0.829 s]
[INFO] GraphHopper Map Matching … FAILURE [ 0.071 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.604 s
[INFO] Finished at: 2016-10-19T15:13:44-04:00
[INFO] Final Memory: 12M/226M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project graphhopper-map-matching-core: Could not resolve dependencies for project com.graphhopper:graphhopper-map-matching-core:jar:0.8.2: Failure to find com.graphhopper:graphhopper-reader-osm:jar:0.8.2 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]

I tried using 0.7 version and it worked.
But the 0.8 version and master are no longer working.


#4

Should work now after proper release at maven central


#5

I faced a similar issue in building the map-matching core module as graphhopper-reader-osm and graphhopper-web libraries were missing. I fixed by building those libraries from graphhopper git and copied them in maven like locations. However, this trick works for, me but I’m sure this is not the ideal way to go. Am I missing something?


#6

There shouldn’t be such issues. Not with the latest master nor with 0.8. But as we soon plan to merge both projects (where you then also build GH core) I won’t investigate this further here.


#7

Hi abhirup,

thanks for the information, I also stumbled over the same error last Friday.
I used a VM with Win10 Enterprise 32bit , jdk1.8.0_121 and Babun 1.2.0.

Can you be a little more specific about what you have done to solve the error ? Maybe I find time for another try before karussell merge the projects.


#8

Sure. System config: Ubuntu 16.04, JDK 1.8.0_111. The error was due to missing jar files for graphhopper-reader-osm and graphhopper-web. I compiled these two jar files from the graphhopper project and copied to the location where maven stores the cached binaries.

Thanks Karussell. Would look forward to use the merged one.


#9

Just another comment here: I have the same problem with the master branch.

[ERROR] Failed to execute goal on project graphhopper-map-matching-core: Could not resolve dependencies for project com.graphhopper:graphhopper-map-matching-core:jar:0.9-SNAPSHOT: Could not find artifact com.graphhopper:graphhopper-reader-osm:jar:0.9-SNAPSHOT -> [Help 1]

but since the graphhopper project master seems to be at 0.8.2 (i.e. a graphhopper build just produced a graphhopper-reader-osm-0.8.2.jar in my .m2 cache) I really don’t know where com.graphhopper:graphhopper-reader-osm:jar:0.9-SNAPSHOT should be coming from?

I can wait for the merge of the 2 projects, though, no big deal.


Observing some considerable deviation
#10

You can locally build graphhopper and then the map matching should build. Still unsure why this fails as there are snapshots available


#11

I just had the same error today, from the master (Ubuntu 16.04, maven 3.3.9, jdk 1.8.0_131) :

[ERROR] Failed to execute goal on project graphhopper-map-matching-core: Could not resolve dependencies for project com.graphhopper:graphhopper-map-matching-core:jar:0.9-SNAPSHOT: Could not find artifact com.graphhopper:graphhopper-reader-osm:jar:0.9-SNAPSHOT -> [Help 1]

I’m a complete noob in maven, so I’m not sure (I tested different things), but apparently I managed to get it work like this:

I think there is a problem of repository somewhere, it seems to search the jar here: https://repo.maven.apache.org/maven2/com/graphhopper and not here: https://oss.sonatype.org/content/groups/public/com/graphhopper

As I don’t know the proper way of doing it, I just added the following lines in the matching-core/pom.xml (for exemple under “<name>GraphHopper Map Matching</name>”):

<repositories>
    <repository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/groups/public/</url>
    </repository>
  </repositories>

I know it’s dirty, but it seems to work, if it can help someone else waiting for the merge with the main graphhopper


#12

Thanks, maybe we should add this, currently we have this only for distributionManagement in the parent pom.xml


#13

@robin-loche this is indeed required if you did not switch to a stable branch like 0.8 or 0.9. When you switch to those branches it should not be necessary and you are on a safer side regarding bugs.


#14

Ok thanks, I confirm, a little “git checkout 0.8” (I don’t see any 0.9 branch) and everything is ok. I just wanted to test the very last version :slight_smile:
Oh and thank you for your work! :smiley:


#15

Thanks a lot. Had the same problem. Your reply just solved it :slight_smile:


#16

The build problems should disappear or let’s say reduced :slight_smile: with the latest commits in master branch and also in the recently released branch 0.10