Reputation: 17850
For a plain "Java application" project, how can I add a dependency or library from Maven? If I right click on "Libraries" in the projects pane, it only allows me to add local libraries. But if my project is a Maven Java Application, then there's the "Dependencies" node in the projects pane, and from there I can right click and choose "Add dependency...".
I'm using NetBeans 8.0.
Upvotes: 6
Views: 5730
Reputation: 410
You need to build a Maven style project before NetBeans can use its built in Maven plugin - to help you with dependencies.
Install Maven per the instructions exactly. Then you can generate a new Maven style project on the command line with
mvn archetype:generate
and import the generated project into NetBeans.
Upvotes: -1
Reputation: 38132
You can either download the library manually e.g. from http://search.maven.org (don't forget the transitive dependencies as well!). Or if you're using Ant (the default project type in NetBeans): consider to use Ant Ivy to manage your dependencies.
Upvotes: 2