Allen
Allen

Reputation: 141

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.

Upvotes: 14

Views: 53635

Answers (4)

Tim Sparg
Tim Sparg

Reputation: 3304

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>

Upvotes: 6

Basil Bourque
Basil Bourque

Reputation: 338326

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.

Upvotes: 17

Bala
Bala

Reputation: 1203

Maven automatically downloads the dependency once specified in the pom.xml. For this you would have to build your project with the dependency as specified by Tim Sparg.

Upvotes: 1

Michael-O
Michael-O

Reputation: 18430

The dependency is available in Maven Central. Add the pom snippet manually to the pom.xml and run Maven in the shell and let it download the dependency. This should resolve your issue.

Upvotes: 2

Related Questions