Maven 装配模式匹配

发布于 2024-11-02 15:17:08 字数 1061 浏览 6 评论 0 原文

我在处理文件集中的模式时遇到问题。 这个显式汇编有效:

   <fileSet>
        <directory>stp-arina-adapter-ny-dev-d1</directory>
        <!-- <directory>*d1/**</directory> -->
        <outputDirectory></outputDirectory>
        <includes>
            <include>target/*gz</include>
        </includes>
    </fileSet>

但我需要一个更通用的解决方案

    <!-- <directory>*stp-arina-adapter-ny-dev-d1</directory> -->
    <directory>*d1</directory>

使用通配符我希望意味着“以 d1 结尾的目录”,我得到

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to create assembly: Error creating assembly archive : You must set at least one file.

我已经尝试了目录和包含的多种组合,例如

<directory>.</directory>
<include>target/*.gz</include>

<include>**/*.gz</include>

并出现相同的错误。

I'm having trouble with patterns in a fileset.
This explicit assembly works:

   <fileSet>
        <directory>stp-arina-adapter-ny-dev-d1</directory>
        <!-- <directory>*d1/**</directory> -->
        <outputDirectory></outputDirectory>
        <includes>
            <include>target/*gz</include>
        </includes>
    </fileSet>

But I need a more general solution

    <!-- <directory>*stp-arina-adapter-ny-dev-d1</directory> -->
    <directory>*d1</directory>

Using a wildcard I was hoping meant "directory ending in d1", I get

[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to create assembly: Error creating assembly archive : You must set at least one file.

I've tried multiple combinations of directory and include, such as

<directory>.</directory>
<include>target/*.gz</include>

and

<include>**/*.gz</include>

with the same error.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怀中猫帐中妖 2024-11-09 15:17:08

文档

目录
设置绝对值
或模块的相对位置
目录。例如,“src/main/bin”
将选择该子目录
此依赖项所在的项目
已定义。

因此, 不能使用通配符。这些应该有效

<directory>${basedir}</directory>
<directory>${project.build.directory}</directory>
<directory>target</directory>

您可以使用 指定所需的通配符。

From the docs,

directory
Sets the absolute
or relative location from the module's
directory. For example, "src/main/bin"
would select this subdirectory of the
project in which this dependency is
defined.

So we cannot have wildcards for <directory>. These should be valid

<directory>${basedir}</directory>
<directory>${project.build.directory}</directory>
<directory>target</directory>

You could specify required wildcards using <includes>.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文