IntelliJ, Maven and External Libraries - problems with dependencies

22 Views Asked by At

At work, we have multiple projects that we have to clone and then work on them. We now switched to new laptops, and we have to make the setups again. The problem is, that after cloning and running "mvn package", the project doesn't run. Some dependencies are missing. But on the other laptop they are not missing, they are under External Libraries.

I theorize that this happens because they already are there from other projects in .m2 folder and this is why the maven command works. I don't understand why this problem happens. One solution that I thought about is to clone the project, resolve all errors, manage to run locally, then delete the dependencies from m2, clone the next project, resolve all errors and so on. I think this is very time consuming.

I did not find anything useful on the internet, only that it can be because of IntelliJ. Did someone tun into this problem? How did you solve it?

I expected the setup to work with no problems since this is why pom.xml exists.

1

There are 1 best solutions below

1
Marit On

Please make sure to import your dependencies. When making changes to your pom.xml a Maven icon with arrows may appear. Click it to reload your Maven dependencies. Alternatively there is a Reload button (2 arrows in a circle) in your maven tool window (in the top right hand corner of IntelliJ IDEA). For more information (and to see what the icons look like), see the docs-