我有一个包含子模块的maven项目:
/pom.xml
/child1/pom.xml
/child2.pom.xml当我执行"maven包“时,它会创建一个/target/foo.jar。好的。
当我做一个"maven rpm:rpm“时,我的构建失败了,因为当它去构建一个childs时,它会说:
[ERROR] Failed to execute goal
org.codehaus.mojo:rpm-maven-plugin:2.1-alpha-3:attached-rpm (default-cli)
on project child1: Source location target/foo.jar does not exist我不想让孩子的项目转一圈。我只想让父母把它的神器转一下。
文档说:
If this goal is run on a project with modules,
it will run the "rpm:rpm" goal on each module, rather than packaging
the modules into a single RPM.有办法绕过这件事吗?我不能在执行"mvn包“时创建rpm,因为它不能在mac上工作,这是大多数人在这里开发的:只有在执行"mvn rpm: rpm”或类似命令时才能创建rpm。
以下是父pom:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<configuration>
<name>analytics-reporting</name>
<group>rpm</group>
<targetVendor>amazon</targetVendor>
<targetOS>Linux</targetOS>
<filemode>644</filemode>
<username>root</username>
<groupname>root</groupname>
<copyright>LGPL</copyright>
<version>${rpm.version}</version>
<release>${rpm.release}</release>
<mappings>
<mapping>
<directory>/opt/inin</directory>
<sources>
<source>
<location>target/analytics-reporting-engine.jar</location>
</source>
</sources>
</mapping>
</mappings>
</configuration>
</plugin>这是孩子:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>发布于 2021-11-26 10:37:29
这是有价值的。https://www.mojohaus.org/rpm-maven-plugin/rpm-mojo.html#disabled
<rpm.disabled>true</rpm.disabled>发布于 2014-06-24 16:12:21
在插件的执行过程中,需要指定不继承插件,如下所示:
<executions>
<execution>
<inherited>false</inherited>
<id>attach-rpm</id>
<goals>
<goal>attached-rpm</goal>
</goals>
</execution>
</executions>https://stackoverflow.com/questions/23162258
复制相似问题