Maven dependencies not being found
Answered
I have recently downloaded IntelliJ on my MacBook and whenever I create a new Maven project, the project is unable to detect the dependencies in the pom.xml. Before, I was using a windows 10 laptop and everything was working fine so just wondering if anyone could help me resolve this problem because it is becoming extremely frustrating.
Thank you!
Please sign in to leave a comment.
Please see this answer and check the logs to see what's causing the problem: http://stackoverflow.com/a/42427510/104891.
Thanks, this seems to be the error in the logs. Any idea what it means?
I doubt it's the error that prevents dependencies import. To investigate further we need more details (complete logs, sample project to reproduce, etc).
I know the maven repositories work absolutely fine because I have used them before on a windows laptop so maybe it is my settings:
https://gyazo.com/02bf4f846c2a037c36cbd7097c179ecd
https://gyazo.com/b5d1d3e05b023110973425e63e2971e5
And here is my complete log:
https://pastebin.com/EKtLrU0S
This doesn't seem to be a complete log, it has nothing related to Maven and doesn't even include IDE startup.
Try to delete .idea project directory and reimport, then provide the logs.
This should be the complete log when I open up the project:
https://pastebin.com/4tjfTrYV
The log has nothing related to Maven, no errors, etc. It's impossible to tell why dependencies are not resolved. Please provide a sample project.
Okay, I have created a sample class called Test. I am using the Spigot API. Within the class JavaPlugin appears in red and it says that it can't be resolved.
https://repo.destroystokyo.com/repository/maven-public/ repository doesn't provide any artifacts with org.spigotmc groupID:
Command line Maven build like `mvn package` will fail with the following:
The problem has nothing to do with IntelliJ IDEA.
https://www.spigotmc.org/wiki/bbcode.7328/archive has the different repository URL you should use. If SNAPSHOT dependency cannot be resolved, browse https://hub.spigotmc.org/nexus/#view-repositories;snapshots~browsestorage to find the exact version. The following should work:
Oh wow my bad, works perfectly now. Thank you very much! Any idea why the repository I was using is working on my windows laptop and not on my macbook?
Your Windows laptop probably has it cached in the local .m2 repository. It could be that this dependency was removed from the online repository, so you can no longer download it on another machine and the local cache on your other machine is empty.
Ah I understand now, I should have thought of that. Thanks for your help.