程序集描述符:是否仅拆包? [英] Assembly descriptor: Unpack-include exclusively?

查看:114
本文介绍了程序集描述符:是否仅拆包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在处理大型的多模块项目时,我发现了一个自定义的组装描述符文件.我不完全理解的是以下内容,尤其是includes部分.

While working through a large multi-module project I discovered a custom Assembly Descriptor file. What I don't fully understand is the following, especially the includes section.

<assembly [...]>
    [...]
    <dependencySets>
        <dependencySet>
            <scope>provided</scope>
            <unpack>true</unpack>
            <unpackOptions>
                <includes>
                    <include>defaults*.properties</include>
                </includes>
            </unpackOptions>
            <outputFileNameMapping>
                ${artifact.artifactId}
            </outputFileNameMapping>
            <includes>
                <include>${project.groupId}:[project]-settings</include>
            </includes>
        </dependencySet>
    </dependencySets>
    [...]
</assembly>

组装文档描述了include部分作为文件和/或目录模式,用于匹配在解压缩后要包含在归档中的项目".

The assembly documentation describes the include section as a "file and/or directory pattern for matching items to be included from an archive as it is unpacked".

includes dependencySet声明以下内容:

如果不存在,则表示所有有效值.

If none is present, then represents all valid values.

问题

include是否仅工作?因此,我能否期望仅 defaults*.properties被视为provided(根据此特定部分)?

Question

Does include work exclusively? Can I therefore expect only the defaults*.properties to be regarded as provided (according to this particular section)?

unpackOptions-includes如何干扰基本的includes(dependencySet的最后一部分)?

How do unpackOptions-includes interfer with the basic includes (last section of dependencySet)?

推荐答案

unpackOptions-includes如何干扰基本的includes(dependencySet的最后一部分)?

How do unpackOptions-includes interfer with the basic includes (last section of dependencySet)?

他们控制着两个截然不同的事物,并且不会相互干扰:

They control two very different things and do not interfere together:

  • unpackOptions 中包含控制哪些文件里面的神器将被拆开.在您的示例中,这意味着,在每个范围为provided的依赖项中,只有与模式defaults*.properties匹配的文件才会被解包并因此得到保存.
  • 包含在 dependencySet 中的控件被包括在这个集合中.在您的示例中,只有与${project.groupId}:[project]-settings相匹配的工件才会包含在该集合中.
  • Includes in unpackOptions control which files inside the artifact are to be unpacked. In your example, it means that, in every dependency that has the scope provided, only the files matching the pattern defaults*.properties will be unpacked and therefore kept.
  • Includes in dependencySet control which artifacts are to be included in this set. In your example, only the artifacts matching ${project.groupId}:[project]-settings will be included in this set.

最后,您拥有的程序集描述符将考虑名称与${project.groupId}:[project]-settings匹配的每个provided依赖项.在所有这些工件中,它将解压缩与模式defaults*.properties相匹配的所有文件.

Finally, the assembly descriptor you have will consider every provided dependency, whose name match ${project.groupId}:[project]-settings. In each of those artifacts, it will unpack all the files matching the pattern defaults*.properties.

include是否仅工作?

是的.默认情况下,所有内容都包括在内.如果您覆盖该配置,那么将包括在此标记中配置的内容.同样,默认情况下,不排除任何内容(如果您覆盖该配置,请注意,排除规则适用于先前包含的内容).

Yes. By default, everything is included. If you override that configuration, what will be included is what you configured in this tag. Similarly, by default, nothing is excluded (and if you override that configuration, note that the exclusions rules apply on what whas previously included).

这篇关于程序集描述符:是否仅拆包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆