[英]Execute maven assembly plugin only on child POMs
I have a project with a parent POM and three child projects with.I want to execute the goal assembly:assembly only on one child POM.我有一个带有父 POM 的项目和三个带有的子项目。我想仅在一个子 POM 上执行目标程序集:程序集。 I already read the following post, but I didn't get it to work with the maven assembly plugin.我已经阅读了以下帖子,但我没有让它与 Maven 程序集插件一起使用。
Execute Maven plugin goal on child modules, but not on parent 在子模块上执行 Maven 插件目标,但不在父模块上执行
If I run如果我跑
mvn -DskipTests=true assembly:assembly
I get the following error:我收到以下错误:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:assembly (default-cli) on project inhouse: Error reading assemblies: No assembly descriptors found. [错误] 无法在项目内部执行目标 org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:assembly (default-cli):读取程序集时出错:未找到程序集描述符。 -> [Help 1] -> [帮助 1]
It seems that it always parses the plugin configuration and looks for the assembly descriptor, even then, if I do not put the plugin into the parent POM at all.似乎它总是解析插件配置并查找程序集描述符,即使如此,如果我根本不将插件放入父 POM 中。 Has anyone a solution for the assembly plugin?有人有组装插件的解决方案吗?
正确的选项是: <skipAssembly>true</skipAssembly>
以跳过父项目。
you can define in parent pom properties您可以在父 pom 属性中定义
<assembly.skipAssembly>true</assembly.skipAssembly>
and overwritte this property in your module pom properties并在您的模块 pom 属性中覆盖此属性
<assembly.skipAssembly>false</assembly.skipAssembly>
You can configure in the aggregation pom.xml
the assembly plugin to skip execution.您可以在聚合pom.xml
配置程序集插件以跳过执行。
In <build><plugins>
section在<build><plugins>
部分
<configuration><skip>true</skip></configuration>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.