We have gradle multi module setup for our code base. One of the module is a library which we want to publish so that others can use it by pull it from code repository.
Many time, there will be no changes in the library module, but other modules will have changes which gets build and deployed in the CI/CD pipeline.
Since we use gradle command at the top project level, it run all necessary commands in the build step.
Do we have any way to publish the module only if there is change in the repo ?
Just ignore the publish step when there is not changes in the module.
I’ve got the same setup. Lots of multi-module repositories, and I definitely don’t want/need to process them all every time an independent project changes.
I’ve largely solved the problem with a custom CICD library (Jenkins shared library in my case) which essentially:
I don’t want to publish this one sub module.
Since the sub module is part of multi-module project, the top level build command has the dependency on the publish. Hence the publish command is getting executed.