Maven发布插件:运行特定的preparationGoals&;项目某些模块中的完成目标
对于我的多模块项目中的发布过程/准备,我希望在一组选定的模块(webapps)中运行其他目标。例如:Maven发布插件:运行特定的preparationGoals&;项目某些模块中的完成目标,maven,maven-release-plugin,multi-module,Maven,Maven Release Plugin,Multi Module,对于我的多模块项目中的发布过程/准备,我希望在一组选定的模块(webapps)中运行其他目标。例如: 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) webapp模块(应该)使用来运行一些定制的npm和grunt任务(
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)
webapp模块(应该)使用来运行一些定制的npm和grunt任务(基本上,模拟检查和修改版本:prepare在Java中为我们的JS部门所做的工作)
因此,当调用mvn release:prepare
时,我(认为我)需要一些preparationGoals和completionGoals来运行。在发布准备期间触发它们的任何其他机制都可以,但是,我不想/无法手动运行其他命令
我试过什么:
1:将preparationGoals和completionGoals添加到特定模块的构建
-部分,但是对发布插件的任何配置更改都需要对根POM进行
2:创建一个per(webapp-)模块,修改发布插件配置以添加准备和完成目标,但它的发布配置文件似乎只在发布:执行期间使用
<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>
<execution>
<id>update-static-resource-to-latest-stable</id>
<phase>none</phase>
<goals>
<goal>grunt</goal>
</goals>
<configuration>
<arguments>latestStable</arguments>
</configuration>
</execution>