I have a Java Maven project with some dependencies defined in the POM.xml file. These dependencies often have newer versions every month, so I would like to deploy a JAR file that automatically checks the latest versions of those dependencies in each startup (without re-building the Java Maven project).
Is it possible to achieve that with Maven?
I know that the Versions Maven Plugin is useful to download the latest versions of dependencies, but only when "re-building" the project (not in a deployed JAR). I also know that I can use expressions like:
<version>[1.8,]</version>
But, again, these dependencies are only downloaded after building the project. I want to update dependencies automatically every time the user launches the application.
UPDATE:
The dependency I want to automatically be updated is "selenium-chrome-driver". My application uses Chrome Driver to launch the Google Chrome browser.
The problem is that Chrome Driver is updated every few months, and the older versions become "outdated". As a result, after a few months, the deployed JAR tries to launch the browser with an older version of Chrome Driver and it doesn't work. For that reason, I need to automatically update this dependency. Otherwise, I would have to deploy a new JAR every X months.
I had same problem for years, there is a library to do this, https://github.com/bonigarcia/webdrivermanager , but I didn't try it myself
Currently am using this script (ubuntu)