maven - 跳过根 pom 的插件执行
问题描述
你能告诉我如何跳过root pom的插件执行吗?这个 pom 只包含定义的模块:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<packaging>pom</packaging>
<groupId>com.company</groupId>
<artifactId>root</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>root</name>
<modules>
<module>bom-module</module>
<module>moduleA</module>
<module>moduleB</module>
</modules>
</project>
这是bom模块中的插件配置(moduleA和moduleB继承自bom):
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>${dockerfile-maven-plugin.version}</version>
<executions>
<execution>
<id>docker</id>
<goals>
<goal>build</goal>
<goal>push</goal>
</goals>
</execution>
</executions>
<configuration>
<repository>xxxxxx</repository>
<tag>${project.version}</tag>
<buildArgs>
<JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
</buildArgs>
<skip>true</skip>
</configuration>
</plugin>
当我想为所有使用此命令配置插件的模块执行插件时:mvn com.spotify:dockerfile-maven-plugin:build
我收到错误Missing Dockerfile in context directory: /home/denis/workspace/xxxx/root
,这意味着插件是通过根 pom 执行的。我不能像在 bom 模块中那样跳过它,因为没有插件配置。谢谢你。
解决方案
推荐阅读
- java - 部署 Spring Boot + Angular 应用程序时出现问题
- html - 如何将文本放在输入表单的前面?
- javascript - 如何根据对象中的id添加键和值
- r - plot.new 之前工作时尚未调用错误
- android - 如何延迟初始化/膨胀 NavigationView
- django - 使用 Ajax 登录后,Django CSRF 验证在表单验证上失败
- dask - 如何将 Dask 与自定义类一起使用
- excel - 从不同工作表中的单个列中查找字符串并返回地址
- python - 如何将双指针 ctype 转换为 numpy 数组?
- arrays - 在 JanusGraph 中存储字节数组需要什么数据类型?