Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding dependencies in Maven Netbeans

I've created a Maven project and added the dependencies (jar files) that I need; however, netbeans says that it still cannot find it.

Specifically in my case, I added the jmf-2.1.1e.jar file into my dependencies folder. When I go back to my program it still gives me the compile error that it cannot find the javax.media package.

like image 405
Allen Avatar asked Jul 25 '11 16:07

Allen


People also ask

How do I add a dependency in Maven?

Right-click the utility project, and select Maven>Add Dependency. Type a dependency name in the Enter groupID… field (e.g., commons-logging) to search for a dependency. Select the dependency, and click OK.

How do I fix dependencies in NetBeans?

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.

What are dependencies in NetBeans?

The required dependencies (IDE artifacts, module artifacts) are specified in the pom. xml file of the project. If you expand the Libraries node you can see the libraries required for the NetBeans Platform application. Platform application branding resources.


2 Answers

Did you let Netbeans manage the dependency?

In your "Projects" listing, find and context+click on the "Dependencies" folder in the list. From the context menu, choose "Add Dependency".

screen shot of Projects listing with context menu of Dependencies folder

This approach works at least in NetBeans 7.4 and 8.0 beta.

like image 122
Basil Bourque Avatar answered Oct 24 '22 12:10

Basil Bourque


Make sure that your pom.xml has the following snippet that defines the dependency

  <dependencies>
    <dependency>
        <groupId>javax.media</groupId>
        <artifactId>jmf</artifactId>
        <version>2.1.1e</version>
    </dependency>
   </dependencies>
like image 44
Tim Sparg Avatar answered Oct 24 '22 12:10

Tim Sparg