Skip to content
Advertisement

Build war files for services when modules are modified

I have a monorepo with the following structure:

app
|lib
| -moduleA
| |-pom.xml
| -moduleB
| |-pom.xml
|services
| |-foo
|  |-pom.xml
| |bar
|  |-pom.xml
| |gamma
|  |-pom.xml

My end goal here is to deploy the application’s war files to aws via GitHub actions. I am able to deploy individual services whenever there are changes in them, with the command mvn clean install -Dmaven.clean.failOnError=false -f services/foo/pom.xml.

However, I am not sure how to update the services whenever a module it depends on is modified. For eg., foo and gamma depend on moduleA. Whenever moduleA is modified, I would like to build war files only for foo and gamma and exclude bar since there are no changes for it. Pretty new to java, any ideas how to achieve this? TIA

Advertisement

Answer

Was able to find a flag that updates the dependencies of the module

--also-make-dependents
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement