Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven tries to download ojdbc14.jar again - jar already present in local repository

When I run the command mvn eclipse:eclipse, the dependency jar ojdbc14.jar is getting downloaded without any issues. Then, when I run the command mvn clean install, maven tries to download the same jar again - but this time it fails saying that the jar is not found in the repository.

What I have noted is that, when running the command for the first time (mvn eclipse:eclipse), Maven looks into the Nexus repository of our company - and it finds the jar. When running the command mvn clean install, maven directly goes to the central repository without looking into Nexus - and hence it is not finding the jar.

1) Why is maven trying to download the jar when it is already present in the local machine?

2) Why is maven skipping the Nexus repository before going to the central repository?

like image 527
saravana_pc Avatar asked Dec 22 '25 03:12

saravana_pc


1 Answers

I suspect that you problem is related to you maven settings file. Does you settings file catch calls to all remote repositories for example like this:

<mirror>
  <!--This sends everything else to /public -->
  <id>nexus</id>
  <mirrorOf>*</mirrorOf>
  <url>http://yournexusrepoaddress</url>
</mirror>

If not, downloaded pom files could override where to look for external repositories. See this link for more information. I hope that this helps.

like image 143
Oystein Aadland Avatar answered Dec 24 '25 15:12

Oystein Aadland



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!