如何解决Maven-子pom会覆盖父项的插件属性
我可能在这里缺少一些概念性要点,但是我想在pluginManagement的父pom中定义一个插件(skip = true),然后在子pom中我想要定义一个配置文件以启用此插件并覆盖其中的一部分配置部分(<file>
)。
pom.xml
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>deploy-file</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<file>none</file>
<repositoryId>${project.distributionManagement.snapshotRepository.id}</repositoryId>
<url>${project.distributionManagement.snapshotRepository.url}</url>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<packaging>zip</packaging>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
module-a / pom.xml
<profiles>
<profile>
<id>deploy-module-zip</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
<executions>
<execution>
<id>deploy-file</id>
<phase>deploy</phase>
<goals>
<goal>deploy-file</goal>
</goals>
<configuration>
<file>module-a/target/module-a.zip</file>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
我遇到的错误是部署过程找不到名为“ none”的文件(在父级上定义的值,因为子级的<file>
“覆盖”无效)。
Step 4/4: Deploy snapshot (Maven) (6s)
[09:31:12][Step 4/4] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (deploy-file) on project module-parent: /sbclocal/localstorage/teamcity/agent_02/work/cff9a122f8eb31a3/none not found.
[09:31:14][Step 4/4] Process exited with code 1 (Step: Deploy snapshot (Maven))
[09:31:14][Step 4/4] Step Deploy snapshot (Maven) Failed
我在这里想念什么?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。