Maven add jar without install

I have some problem with adding external jar in to maven project without install it. If I install JAR file other people who working on same project, have to install same JAR. them I want to avoid that issue.

First need to place jar file inside lib folder. After that using following POM entry we can use it as dependency.



 Here very important option is <scope>system</scope>. It's say dependency provide with system, no need to look at repository. More about System Dependency


Rather than using system dependencies, consider installing a corporate artifact repository like Artifactory or Nexus. To share artifacts with a team, everybody using a corporate repository like this helps a lot. As well, it becomes a destination for your team's artifacts (shared libraries, etc.). Finally, it can help manage proxy rules for the team by centrally managing the at the corporate repo. (There are more maven repositories than Central to proxy.)
Mathew Bukowicz said…
@Anthony: That was exactly what I was going to write. When using Maven, you should avoid adding custom jars through classpath. Maybe in your case it is better to use Ant or "constrain" yourself to a specific IDE?
Jeff MAURY said…
Very bad practice. I would not recommend this. System scope should be used with extreme care. Don't try to fight Maven
Chandana said…
@All, Thanks for giving me great advice and comments. As three of you mentioned, we can install install maven dependency like this
Mathew Bukowicz said…
@Chandana, this is also not recommended, because everyone on your team would have to install it manually in their local repository. The best you can do is, as Anthony said, install Artifactory or Nexus server and publish your jars there. Then, your teammates would have to point in their Maven configurations to that repository. When building application Maven will automatically resolve this dependency and download it from your Artifactory/Nexus server.

Popular posts from this blog

Building a RESTFul Service using Spring Boot

Yield Price Sri Lanka - Android Application

Secure Spring Boot REST API using Basic Authentication