Blankman Blankman - 6 days ago 8
Java Question

Using IDEA with maven2, how to add a non-maven .jar?

I have a .jar that I want included in my IDEA web application project that is using maven2 (pom.xml).

How can I add a .jar to my project that isn't using maven?

Answer

You basically have three options:

  • Install the jar in your local repository using install:install-file (see Guide to installing 3rd party JARs). This is pretty straightforward and easy but this will make your POM non portable. This might be an option if you are alone and doesn't plan to distribute your pom.xml.

  • Deploy the jar in a corporate repository using deploy:deploy-file. This is of course the ideal and preferred scenario in a corporate environment.

  • If you're not using a corporate repository but are still working in team, setup a file based repository and share it through your source repository.

Comments