0

I have downloaded ojdbc14 jar from the internet and copied it to the lib folder of my maven project. Is it necessary to add dependency in pom.xml as well. Currently working without adding.

  • 1
    I would suggest to go through with this link [best way of linking custom external JAR](https://stackoverflow.com/questions/5692256/maven-best-way-of-linking-custom-external-jar-to-my-project) – Anis Mulla Sep 25 '18 at 10:15
  • @AnisMulla Just need to know if it's possible to copy jar file directly to lib folder without adding dependency in pom.xml file – Tejas Tasgaonkar Sep 25 '18 at 10:29
  • Simply no. Only what is mentioned in pom will be considered. – khmarbaise Sep 25 '18 at 11:02

1 Answers1

2

You can use tricks to manually upload a jar into the lib folder, but it does not make sense. And it would work cause the build process will just look for that jar into the lib and if found everything will compile nicely. BUT....

Maven is a useful tool that helps you handle dependencies, internal, external, third parties, any kind, it's one of his benefits, don't need anymore to look around for jars, and put them manually into the lib dir, but why? You would override one of the basic behaviour of Maven.

Maven set lots of rules to give you the ability to manage them the way you want, you have options about how to handle every single dependency of your project, you can point to a local jar within a dependency, you can set the scope of the dependency, the type you can exclude some of the inherited transitives, and so on...

But this is the standard approach for standard situation

You should simply define the dependency, maven will downloaded from the configured repo or the default one, maven central, and retrieved from your local repo if there are no updates on that artifacts all the other time you will build that artifact.

If you have issues with licenses for ojdbc14 then the solution is configure the oracle repo where you can easily download it.

ivoruJavaBoy
  • 1,307
  • 2
  • 19
  • 39