NetBeans IDE maven project unable to solve dependencies

会有一股神秘感。 提交于 2019-12-23 04:06:09

问题


After using eclipse for ages I am porting myself to NetBeans IDE. I am opening my existing maven project and all seems ok, but when I am trying to build the project it is throwing error saying "Could not resolve dependencies for project" though the JAR files are present in my .m2 directory.

I am using a ubuntu 12.10 and netbeans version 7.3.1

Any suggestions on the same are highly appreciated.


回答1:


"Any suggestions on the same are highly appreciated."

This may not solve your current problem, but is a suggestion for the future, or even if you want to do it for your current projects.

First thing is you need to make sure your project was imported correctly as a maven project. As you can see in the image, all maven projects, have a little m in the top left of the project logo. The first project is a maven web app, the second a regular maven app, and the last a regular java app. If you see your projects as maven apps, then all you need to do is right-click on the Dependencies and select add dependeny. You can search your local repo from the dialog that opens. The once you select will get automatically inserted into you pom, and you will see teh jar in the Dependencies folder.

If you don't see the depencies folder, then your projects were not imported as maven projects.




回答2:


I had different situation.
My .m2 folder was a bit large, so I decided to delete it.
When I opened one Vaadin project I was working on which consists of regular modules, almost all dependencies was resolved. I'm saying almost because, one module which is dependent on the other independent maven library project could not resolve three dependencies at all!
After a while, I opened that independent library module and rebuilt it. As soon as I started, I noticed missing dependencies started to download and the problem was resolved immediately !
Hope this experience will help.



来源:https://stackoverflow.com/questions/21405878/netbeans-ide-maven-project-unable-to-solve-dependencies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!