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?
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.
Easiest thing is to use maven:install-file
to install the jar in your local repository, as follows (stolen from the docs:
mvn install:install-file -Dfile=path-to-non-maven.jar \
-DgroupId=some-id \
-DartifactId=some-artifact \
-Dversion=some-version \
-Dpackaging=jar
Then add it to your POM like any other dependency. If it needs to be shared with many people, you may consider setting up a local instance of something like Nexus or Artifactory (we use Artifactory where I work and it works well).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With