Installing custom jar in Netbeans (Maven)

If you are developing in Netbeans with Maven build and want to include some custom jar files as dependency eg. Oracle

1) In Netbeans Maven project right-click on the “Dependencies” folder in the Projects view. Open “Add dependency” dialog
2) Make up some groupId, artifactId and version and fill them, OK.
3) Dependency will be added to the pom.xml and will appear under “Libraries” node of maven project
4) Expand the Library node. Right-click Library you want to install (will have exclamation mark) and “manually install artifact”, fill the path to the jar. Jar should be installed to local Maven repo with coordinates entered in
step 2)

 

Also, note that when you execute these steps, Netbeans will issue the following mvn command behind the scenes:
mvn -DartifactId={artifact id} -DgroupId={group id} -Dversion={version} -Dpackaging=jar -Dfile={path to jar} -DgeneratePom=false install:install- file

Advertisements

One thought on “Installing custom jar in Netbeans (Maven)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s