作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试测试 maven-war-plugin 的覆盖功能。基本上我需要合并两个 war 项目。
所以我将 war 定义为依赖:
<dependency>
<groupId>my.group.id</groupId>
<artifactId>my-legacy-war-project</artifactId>
<version>${project.version}</version>
<type>war</type>
</dependency>
然后配置覆盖:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<overlays>
<overlay>
<groupId>my.group.id</groupId>
<artifactId>my-legacy-war-project</artifactId>
<targetPath>legacy</targetPath>
</overlay>
</overlays>
</configuration>
</plugin>
但是 Maven 无法构建这个项目,并提示这种依赖关系:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.3:exploded (default) on project my-project: overlay [ id my.group.id:my-legacy-war-project] is not a dependency of the project. -> [Help 1]
覆盖层应该与 Maven 3.0.5 一起使用吗?为什么构建会提示声明的依赖项?
最佳答案
不知道为什么,但在叠加层中使用 id
而不是 groupId
和 artifactId
有效:
<configuration>
<overlays>
<overlay>
<id>my-legacy-war-project</id>
<targetPath>legacy</targetPath>
</overlay>
</overlays>
</configuration>
关于java - Maven 3 : Overlay is not a dependency of the project,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22014671/
我是一名优秀的程序员,十分优秀!