使用 maven 的 RPM 包 [英] RPM package using maven
问题描述
我正在尝试使用 maven 插件构建 RPM 包.
I am trying to build an RPM package using the maven plugin.
如果我添加了插件配置,RPM 包没有被制作,RPM 插件站点上的手册说包标签应该是 RPM 但这似乎导致构建失败,说这个目标是有效的.
If I add the plugin configuration the RPM package is not made, the manual on the RPM plugin site says the package tag should be RPM however this seems to cause the build to fail saying that this destination is it valid.
有人可以分享任何例子吗?
Does anyone have any examples they could share?
编辑错误是未知包装:rpm
EDIT The error is Unknown packaging: rpm
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<packaging>rpm</packaging>
<profile>
<id>local</id>
<build>
<resources>
<resource>
<directory>src/main/resources/properties/dev</directory>
</resource>
<resource>
<directory>src/main/resources/txt</directory>
</resource>
<resource>
<directory>src/main/resources/universal</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>rpm-maven-plugin</artifactId>
<version>2.1-alpha-3</version>
<extensions>true</extensions>
<executions>
<execution>
<id>generate-rpm</id>
<goals><goal>rpm</goal></goals>
<phase>prepare-package</phase>
</execution>
</executions>
<configuration>
<summary>...</summary>
<name>...</name>
<version>...</version>
<release>...</release>
<vendor>...</vendor>
<packager>...</packager>
<group>Application</group>
<mappings>
<mapping>
<directory>/tmp/testing</directory>
</mapping>
</mappings>
<!--<requires>filesystem, bash, grep</requires>-->
<description>
...
</description>
<prepareScript>RPMScripts/prep.bash</prepareScript>
<preinstallScript>RPMScripts/preInstall.bash</preinstallScript>
<install>RPMScripts/install.bash</install>
<postinstall>RPMScripts/postInstall.bash</postinstall>
<cleanScript>RPMScripts/clean.bash</cleanScript>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<failOnError>true</failOnError>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.8</version>
<executions>
<execution>
<phase>install</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
推荐答案
引用该行时出错:
<packaging>rpm</packaging>
问题在于您的打包实际上是一个插件构造,而不是内置的 maven 包类型.省略该行将解决错误.
At issue is the fact that your packaging is actually a plugin construct, not a built-in maven package type. Omitting the line will resolve the error.
这篇关于使用 maven 的 RPM 包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!