For the release process / preparation in my multi-module project I want to run additional goals in a selected set of modules (webapps). For example:
pom.xml (parent/root)
|-- common-module/pom.xml
|-- some-webapp/pom.xml
|-- some-other-module/pom.xml
|-- some-other-webapp/pom.xml
|-- (...more modules to follow)
The webapp-module(s) (should) use the maven-frontend-plugin to run some custom npm & grunt tasks (basically, mimic what checks & modifications release:prepare does in Java for our JS depdendencies).
<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>${version.release.plugin}</version>
<configuration>
<preparationGoals>frontend:grunt@update-static-resource-to-latest-stable frontend:npm@npm-update frontend:npm@npm-update</preparationGoals>
<completionGoals>frontend:grunt@update-static-resource-to-latest frontend:grunt@check-static-resources-version</completionGoals>
</configuration>
</plugin>
Example for one of the goals (phase none
so that it is not run anytime else):
<execution>
<id>update-static-resource-to-latest-stable</id>
<phase>none</phase>
<goals>
<goal>grunt</goal>
</goals>
<configuration>
<arguments>latestStable</arguments>
</configuration>
</execution>
So, I (thought that I) would need some preparationGoals & completionGoals to run when mvn release:prepare
is invoked. Any other mechanism of triggering them during release-prepare is fine, however, I do not want to / cannot run additional commands manually.
What have I tried:
1: Adding the preparationGoals & completionGoals into the build
-section of the specific module(s), but any config changes to the release-plugin need to be made to the root POM apparently.
2: Creating a release profile per (webapp-)module, modifying the release plugin config to add the preparation & completion goals, but it release profiles seem only the be used during release:perform
.