Build Strategy

I have a question for all the fellow developers When adding your own JAVA rules to fulfill your work requirements and building on the server what is the best strategy to opt for.

As mentioned on the website of Languagetool you clone the latest version and then add your respective rules to the project and then we can deploy it on our servers but I want to find a way to built and deploy on the server in a way where i get the latest version of language tool from their repo-add my own code to that and built and deploy it on our internal server so that there are no outdated versions of language tool and I don’t have to clone a new version every time separately.

If someone has already solved this or has an idea of how it can be done and can share it with me it would be very helpful.