vaibhav
vaibhav

Reputation: 4103

NetBeans IDE maven project unable to solve dependencies

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.

Upvotes: 2

Views: 17401

Answers (3)

Ishmael Mavor Raines
Ishmael Mavor Raines

Reputation: 320

Right clicking on Dependencies under the Project tab allows to install .jar dependencies to a local repository e.g. on linux .jar will be installed to

/home/username/.m2/repository

where .m2 is a hidden maven folder. You can view folder contents by command

cd /home/username/.m2/repository
ls -a

Upvotes: 0

dobrivoje
dobrivoje

Reputation: 982

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.

Upvotes: 1

Paul Samsotha
Paul Samsotha

Reputation: 208994

"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.

enter image description here

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.

Upvotes: 3

Related Questions