0

我正在尝试从 maven 插件构建 rpm,但出现以下错误:无法签署 RPM:RPM 签署执行返回:'127' POM 文件看起来不错,因为它能够生成战争文件我如何签署 rpm?

附上日志供参考:

[INFO] Building target platforms: noarch-redhat-linux
[INFO] Building for target noarch-redhat-linux
[INFO] Processing files: point-my_web_client-3-2.0.2.noarch
[INFO] Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/my_project/server/my_module/my_web_client/target/rpm/point-my_web_client/buildroot
[INFO] Wrote: /home/my_project/server/my_module/my_web_client/target/rpm/point-my_web_client/RPMS/noarch/point-my_web_client-3-2.0.2.noarch.rpm
[INFO] Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.IMhciz
[WARNING] + umask 022
[WARNING] + cd /home/my_project/server/my_module/my_web_client/target/rpm/point-my_web_client/BUILD
[WARNING] + /bin/rm -rf /home/my_project/server/my_module/my_web_client/target/rpm/point-my_web_client/buildroot
[WARNING] + exit 0
[DEBUG] About to execute '/bin/sh -c cd /home/my_project/server/my_module/my_web_client/target/rpm/point-my_web_client/RPMS/noarch && expect -'
[WARNING] /bin/sh: expect: command not found
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 45.453 s
[INFO] Finished at: 2016-07-31T18:26:32+05:30
[INFO] Final Memory: 42M/176M
[INFO] ------------------------------------------------------------------------

[ERROR] Failed to execute goal org.codehaus.mojo:**rpm-maven-plugin:2.0.1:rpm** (default-cli) on project my_web_client:
 Unable to sign RPM: RPM sign execution returned: '127' executing '/bin/sh -c cd /home/my_project/server/my_module/my_web_client/target/rpm/point-my_web_client/RPMS/noarch && expect -' -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.0.1:rpm (default-cli) on project my_web_client: Unable to sign RPM
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to sign RPM
        at org.codehaus.mojo.rpm.RPMHelper.buildPackage(RPMHelper.java:170)
        at org.codehaus.mojo.rpm.AbstractRPMMojo.execute(AbstractRPMMojo.java:736)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        ... 20 more

**Caused by: java.lang.IllegalStateException: RPM sign execution returned: '127'** executing '/bin/sh -c cd /home/my_project/server/my_module/my_web_client/target/rpm/point-my_web_client/RPMS/noarch && expect -'

        at org.codehaus.mojo.rpm.RPMSigner.sign(RPMSigner.java:109)
        at org.codehaus.mojo.rpm.RPMHelper.buildPackage(RPMHelper.java:166)
        ... 23 more
4

1 回答 1

1

问题似乎在于:

[WARNING] /bin/sh: expect: command not found

127是为“找不到命令”返回的代码

我会说尝试安装expect命令,或将其添加到您的路径中。

于 2017-02-28T13:03:15.240 回答