eviltester / blogcomments

1 stars 0 forks source link

2017/10/maven-local-dependencies #16

Open utterances-bot opened 5 years ago

utterances-bot commented 5 years ago

Simple ways to add and work with a .jar file in your local maven setup - EvilTester.com

TL;DR Hack - add as a library in IntelliJ project. Tactic - add as system scope in maven. Tactic/Strategic - install locally to .m2. Strategic - use a repository management tool, publish to maven central

Sometimes you want to work with a jar file that isn’t hosted in maven central.

It might be a 3rd party jar, it might be one that you have written.

Regardless.

You have a lot of options for this. The approaches that I have used:

add .jar files as an IntelliJ project dependency install it locally to your .m2 repository add it to your project as a system scoped file use a repository management tool: like Nexus or Archiva publish the dependency to maven central

https://eviltester.com/2017/10/maven-local-dependencies.html

LittleLittleQ commented 5 years ago

Hi, I'd like to know after installing jar locally to .m2 repository initially, do we need to reinstall it while the jar is rebuilt in the later?

eviltester commented 5 years ago

Yes. If the jar is rebuilt and it is being pulled into a project from the maven repo then it would be need to be reinstalled back into the the local .m2 repository.