I am in a Java project that uses Maven. When I add a local dependency to the pom.xml
file, the app fails to run.
I add the submodule to the dependency list in the pom.xml
package, click run in eclipse and it gives me an error. When I remove the dependency from pom.xml
file it runs fine.
My question is mainly when I add a dependency to the pom.xml
file do I have to do it thru Eclipse in a way or is it fine to write it out? Also after adding the dependency do I need to run a mvn install
again?
CodePudding user response:
Eclipse Maven Plugin doesn't see your changes in the pom.xml file automatically. Depending on your changes to the pom.xml file, you need at least to do manually
Right Click on the Project -> Maven -> Update project
.
Sometimes it doesn't help, and you need to do mvn install
and after that Maven -> Update project
.