Maven RPM插件不会生成指定的脚本 [英] Maven RPM Plugin does not generate the scriptlets specified

查看:185
本文介绍了Maven RPM插件不会生成指定的脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过rpm-maven-plugin创建一个rpm软件包.

I am trying to create an rpm package with the help of the rpm-maven-plugin.

一切顺利,直到我尝试让它生成%pre脚本(或与此有关的任何脚本)

All goes well until I try to have it generate the %pre scriptlet (or any scriptlet for that matter)

pom.xml摘录为:

The pom.xml excerpt is:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>rpm-maven-plugin</artifactId>
    <version>2.0-beta-2</version>
    <executions>
        <execution>
            <goals>
                <goal>attached-rpm</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <copyright>Copyright 2010 XXX, Inc. All rights reserved</copyright>
        <vendor>XXX, Inc.</vendor>
        <group>Applications/System</group>
        <packager>${env.USER}</packager>
        <needarch>true</needarch>
        <prefix>/usr/xxx</prefix>
        <mappings></mappings>

        <preinstallScriptlet>
            <script>echo "installing now"</script>
        </preinstallScriptlet>
    </configuration>
</plugin>

...生成的Spec文件是:

... And the generated Spec file is:

Name: Server
Version: 1.0.0.0
Release: 01_1
Summary: Server Maven Webapp
License: Copyright 2010 XXX, Inc. All rights reserved
Vendor: XXX, Inc.
Group: Applications/System
Packager: yaneeve
Prefix: /usr/xxx
BuildRoot: ....../target/rpm/buildroot

%description
Server

%files

注意:mappings标记确实会产生相关的映射,但是为了清晰起见,此处已将其删除.无论哪种方式-都不会生成Sciptlet.

Note: the mappings tag does produce the relevant mappings but has been removed here for clarity purposes. Either way - the sciptlets do not get generated.

有输入吗?

谢谢

同时使用Maven 2和3构建-结果相同.

Built with both Maven 2 and 3 - result is the same.

推荐答案

似乎与插件版本有关...

It seems as if its a matter of plugin version...

支持脚本的必需版本不是2.0-beta-2,而是 2.1-alpha-1

Instead of 2.0-beta-2 the required version to support scriptlets is 2.1-alpha-1

这篇关于Maven RPM插件不会生成指定的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆