java - how to use custom jar file with regular updates to be used as a dependency in maven pom file - Stack Overflow

admin2025-04-29  2

We have created a jar file that is stored locally and called as a maven dependency, which is working fine. But, whenever there is an update to the jar file, we have to inform everyone and download the latest jar from SharePoint.

Expectation: whenever there is a version update to a jar file, we will store it in a cloud location like github so that everyone can pull the latest jar file when they use maven install.

I have checked many articles in Stack Overflow and most of them did not work for me. your help is appreciated.

We have created a jar file that is stored locally and called as a maven dependency, which is working fine. But, whenever there is an update to the jar file, we have to inform everyone and download the latest jar from SharePoint.

Expectation: whenever there is a version update to a jar file, we will store it in a cloud location like github so that everyone can pull the latest jar file when they use maven install.

I have checked many articles in Stack Overflow and most of them did not work for me. your help is appreciated.

Share Improve this question edited Jan 8 at 19:29 President James K. Polk 42.1k30 gold badges110 silver badges146 bronze badges asked Jan 8 at 12:02 Bachu ChennakesavaRaoBachu ChennakesavaRao 291 silver badge5 bronze badges 2
  • Not entirely understood. There is the possibilitry to create an extra local repositiory. And -SNAPSHOT versions are reloaded/updated continuously. However if you want versoned jars, you might keep a global parent POM with <dependencyManagement> with a central version you can keep up-to-date, – Joop Eggen Commented Jan 8 at 12:14
  • You're doing it wrong. You should store all the source remotely so it can be pulled and built locally – g00se Commented Jan 8 at 13:25
Add a comment  | 

1 Answer 1

Reset to default 1
  1. Use a repository like GitHub Packages, Nexus Repository Manager, or JFrog Artifactory to store your jar file.
  2. Automate the process of uploading the jar file to the artifact repo whenever there is a version update using CI/CD tools like Jenkins
  3. Finally, share the repo details with team so that they can include the configuration in their Maven pom.xml files

This way your team can pull required/latest version from repo.

转载请注明原文地址:http://www.anycun.com/QandA/1745860541a91302.html