Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netbeans: maven dependencies of type pom

I've spent a lot of time and my head is blowing up already so I'll be very thankful for any help.

I'm migrating Netbeans Platform application from ant to maven, and so I'm changing all the jars in my version control repo to maven dependencies. I've found needed artifact in main maven repo and I've added it as a dependency with a help of Netbeans, but it's of type POM and was placed in Non-classpath Dependencies and I have no idea how to use it as it wasn't added to classpath etc…

Can someone explain what are these POM dependencies and how to use them?

Thank you in advance!!

EDIT

here is dependency definition in pom.xml

<dependency>
    <groupId>com.kitfox.svg</groupId>
    <artifactId>svg-salamander</artifactId>
    <version>1.0</version>
    <type>pom</type>
</dependency>
like image 230
Uko Avatar asked Oct 12 '12 23:10

Uko


People also ask

What does type POM mean in Maven dependency?

A Project Object Model or POM is the fundamental unit of work in Maven. It is an XML file that contains information about the project and configuration details used by Maven to build the project.

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.

How do I add a Maven dependency in NetBeans?

Making the Module a Dependency of MavenPlatformWordApp To add the dependency to the POM, you can edit the POM directly in the editor or by opening the Add Dependency dialog box from the Projects window. Expand the app in the Projects window, right-click the Dependencies node, and choose Add Dependency.


1 Answers

Adding a pom dependency only pulls down transitive dependencies, that is jar dependencies defined as dependencies in the pom. The pom does not get added on the classpath for obvious reasons, but the transitive dependencies reachable from pom will be added to classpath.

What you ideally need to do is have dependencies of type jar Default dependency type is jar and you can simply define dependencies without any type element in the dependency section.

If you have located the jar files you need in Maven Cental, then you simply need to provide groupId artifactId and version for each one of those in dependencies section.

like image 145
Kalpak Gadre Avatar answered Oct 14 '22 22:10

Kalpak Gadre