微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

maven post-remove 尝试删除映射文件

如何解决maven post-remove 尝试删除映射文件

我正在使用 maven 创建一个 rpm,我可以用它来安装我的应用程序。

在我的映射中,我指定了一个包含安装后步骤所需文件的目录:

            <mappings>
                <mapping>
                    <directory>${rpm.info.install_dir}</directory>
                    <filemode>700</filemode>
                    <sources>
                        <source>
                            <location>src/main/resources/install</location>
                        </source>
                    </sources>
                </mapping>
            </mappings>

在我的安装后步骤中,我使用了这些文件,并在步骤结束时删除了该目录。因此,在删除后步骤中,我收到多个错误,目录 ${rpm.info.install_dir} 中的所有文件都不存在:

Remove  1 Package

Installed size: 46 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Erasing    : my-app-1.0.0-SNAPSHOT.noarch                                                                                                                                                        1/1
warning: file /data/install/file1.conf: remove Failed: No such file or directory
warning: file /data/install/file2.conf: remove Failed: No such file or directory
warning: file /data/install/dir1/file1.service: remove Failed: No such file or directory

我猜 rpm 会尝试在删除后步骤中删除规范文件 (%files) 中提到的所有文件。有什么办法可以避免这个动作吗?我确实想在安装后步骤之后删除安装目录,而不是等到客户决定删除 rpm。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。