IDE (IntelliJ) download sources of GraphHopper

I am currently working on a project that uses graphhopper-web as a Maven dependency. If I try to look at the source code of a class from GraphHopper, IntelliJ opens the decompiled .class file. IntelliJ offers an option to download the sources, this works for pretty much all dependencies, but not for GraphHopper.

Is this a local issue with my setup? Or is this a general issue?

I wonder why, for example for if I use: 0.13.0-pre10, I can see that the sources are available on mvn central. Even when I download the sources and select them manually, IntelliJ seems unable to load them.

Strange. In my case it seems to work with Idea 2019.1.3 community.

How do you download these sources? (right click -> maven -> download sources or in the editor pane -> “download sources” button?)

Does it work for graphhopper-core classes and fails only for classes in graphhopper-web?

1 Like

Thanks for the feedback @karussell, it’s weird I use more or less the same setup and it doesn’t work for me.

I tried both, but had not luck.

It fails for both unfortunately.

I tried with community and ultimate, both 2019.1.3.

Can you try a different version like the more recent 0.13.0-pre12?

Same result for pre12 :frowning:

Can you try the map matching project? (set dependencies to 0.13.0-pre12 and see if it then downloads. Maybe there is some pom.xml setting broken in your set up but maybe we need to improve something. Unsure)

Another trial could be to remove all the graphhopper dependencies from your local maven repo

If IntelliJ makes problems with maven dependencies (like showing compiler errors when building via CLI works) I usually do some or all of these:

  1. mvn clean package -U -DskipTests
  2. delete maven artifacts from local .m2 folder
  3. Click 'Reimport All Maven Projects` (refresh icon) in the maven menu from the right side bar
  4. Build -> Rebuild Project
  5. File -> Invalidate Caches / Restart -> Invalidate and restart

If nothing works you could also try to:

  1. mvn versions:set -DnewVersion=0.13-test
  2. mvn clean source:jar install -DskipTests

This should change the version in all poms and build the jars with the new version including sources. Then import these in your project.

This stuff can be very annoying :frowning:

1 Like