作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 Maven RPM 插件映射:
<mapping>
<directory>/etc/myconfig</directory>
<configuration>true</configuration>
<sources>
<source>
<location>${project.build.directory}</location>
<includes>
<include>*.conf</include>
</includes>
</source>
</sources>
</mapping>
但是,根据打包过程的不同,/etc 中可能有零个 .conf 文件。发生这种情况时,RPM 插件会显示:
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.2:rpm (default) on project clients:
Unable to copy files for packaging: You must set at least one file. -> [Help 1]
有什么方法可以让映射部分满意地包含零个文件吗?
最佳答案
我能想到的最好的办法就是省略 <includes>
标签,它获取 <location>
中指定的所有内容.
The file or directory to include. If a directory is specified, all files and subdirectories are also included.
您需要尽可能具体地指定这些未指定包含模式的映射的路径。我添加了confs
到下面的位置以避免拉入 project.build.directory
中的其他所有内容。
即使没有选择任何文件,<directory>
仍将被创建。
<mapping>
<directory>/etc/myconfig</directory>
<configuration>true</configuration>
<sources>
<source>
<location>${project.build.directory}/confs</location>
</source>
</sources>
</mapping>
关于maven - Maven RPM 插件中的可选映射部分?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29276399/
我正在尝试用 Swift 编写这段 JavaScript 代码:k_combinations 到目前为止,我在 Swift 中有这个: import Foundation import Cocoa e
我是一名优秀的程序员,十分优秀!