Maven-assemble-plugin:将多个目录的多个文件添加到一个输出目录
任何人都知道如何使用 Maven 程序集插件将多个目录的多个文件添加到一个输出目录而无需子目录。
想象一下以下结构:
prjdir
|-dir1
|-target
|-file1
|-dir2
|-target
|-file2
...
|-dirN
|-target
|-fileN
我可以使用 fileSet 来添加文件,即:
<fileSet>
<directory>../prjdir</directory>
<outputDirectory>myoutput</outputDirectory>
<includes>
<include>*/target/file*</include>
</includes>
</fileSet>
然后创建 myoutput 目录,如下所示:
myoutput
|-dir1
|-target
|-file1
|-dir2
|-target
|-file2
...
|-dirN
|-target
|-fileN
但是如果我只想要 myoutput 上的文件而不需要源的目录结构,我该怎么办...
myoutput
|-file1
|-file2
...
|-fileN
这这只是一个简化的例子,这意味着我需要以通用的方式来做。
无法使用
并且也无法显式列出每个文件,因为它们是在事先不知道名称的情况下动态生成的...
提前感谢您的支持.. m_n
干杯
Anyone an idea of how to add multiple files of multiple directories to one output directory without sub-directories using the maven assembly plugin.
Imagine following structure:
prjdir
|-dir1
|-target
|-file1
|-dir2
|-target
|-file2
...
|-dirN
|-target
|-fileN
I can use a fileSet to add the files ie.:
<fileSet>
<directory>../prjdir</directory>
<outputDirectory>myoutput</outputDirectory>
<includes>
<include>*/target/file*</include>
</includes>
</fileSet>
Which then creates the myoutput directory like:
myoutput
|-dir1
|-target
|-file1
|-dir2
|-target
|-file2
...
|-dirN
|-target
|-fileN
But what the hell I should do if I want only the files on myoutput without the directory structure of the source...
myoutput
|-file1
|-file2
...
|-fileN
This is only an simplified example, which means I need to do it a generic way.
Can't use <files><file>
and also can't list every file explicitly, as they are generated dynamically without knowing the name beforehand ...
Thanks in advance for you support ...
Cheers m_n
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论