• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Local jars in pom.xml file?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am new to maven i have just started using maven in my java project i know how to declare dependencies in pom.xml in order use it. I am using intelij idea IDE, my question is if i import local jar file into project do i still need to declare it in pom.xml file?
 
Bartender
Posts: 20849
125
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should avoid explicit inclusion of JAR files in Maven projects. Maven works best when it and only it manages JAR dependencies.

If this is a JAR that isn't part of the public Maven repositories, you should catalog it in your own local or corporate repository.

Here's a guide to how to do that for your local machine: https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html . Use this when the jar wasn't created with Maven.

JARs that you have produced using Maven on your local machine can be installed to its repository by simply using the maven "install" goal.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!