我正在尝试使用 maven 插件构建一个 RPM 包。
如果我添加插件配置,则未制作 RPM 包,RPM 插件站点上的手册说包标签应该是 RPM,但这似乎会导致构建失败,说明这个目标是有效的。
有没有人可以分享任何例子?
编辑 错误是未知包装: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>