如何访问已过滤文件中的程序集 ID?

发布于 2024-10-29 02:13:26 字数 523 浏览 4 评论 0原文

我有多个看起来像:

<assembly>
<id>component-000</id>
<fileSet>
    <directory>src/main/assembly</directory>
    <outputDirectory>/${assembly.outputrootdirectory}</outputDirectory>
    <filtered>true</filtered>
</fileSet>
</assembly>

我还有一个文件,其中包含在所有组件中,我想在其中包含ID(在这种情况下为component-000)。

<代码>... 组件 ID:${id} ...

我尝试过 ${assembler.id}、${assemble.id} ${id} 等,所有这些都产生了各种失败。有什么想法吗?另外,如果有人知道如何潜在转储/打印可用属性?

I have multiple assemblies that looks like:

<assembly>
<id>component-000</id>
<fileSet>
    <directory>src/main/assembly</directory>
    <outputDirectory>/${assembly.outputrootdirectory}</outputDirectory>
    <filtered>true</filtered>
</fileSet>
</assembly>

As well I have a file that gets included into all assemblies within which i want to include the id (component-000 in this case).

...
component-id:${id}
...

I've tried ${assembler.id}, ${assembly.id} ${id} etc all of which have yielded various fail. Any thoughts? Also releated, if anyone knows how to potentially dump/print the available properties?

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

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

发布评论

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

评论(1

怼怹恏 2024-11-05 02:13:26

我想做类似的事情。我有一个想要在多个程序集之间共享的组件。我计划使用程序集的 ID 作为目录名称,例如

<fileset>
    <directory>${project.build.directory}/${assemblyId}</directory>
    ....
</fileset>

在尝试了 ${assemble.id}${ assemblyId} 但没有成功后,我快速浏览了一下查看插件 2.3 版本的代码。我找到了插入其他属性(项目、过滤器、环境等)的代码,但它似乎没有考虑程序集中的属性。有几个似乎相关的 JIRA 问题:http://jira.codehaus.org/browse/ MASSEMBLY-445http://jira.codehaus.org/browse/MASSEMBLY-436

对于我的用例,这意味着我需要复制我想要在每个程序集中共享的 块。或者,我可以将程序集插件配置为多次执行,每次执行加载不同的过滤器文件。我可能会选择前者,因为我没有太多要复制的配置。

I want to do something similar. I have a component I want to share between multiple assemblies. I planned to use the assembly's ID as a directory name, e.g.

<fileset>
    <directory>${project.build.directory}/${assemblyId}</directory>
    ....
</fileset>

After trying both ${assembly.id} and ${assemblyId} with no success, I took a quick look at the code for version 2.3 of the plugin. I found the code that interpolates other properties (project, filter, env etc.) but it doesn't seem to consider properties in the assembly. There are a couple of JIRA issues that seem related: http://jira.codehaus.org/browse/MASSEMBLY-445 and http://jira.codehaus.org/browse/MASSEMBLY-436.

For my use case, this means I need to duplicate the <fileset> block I wanted to share in each assembly. Or, I could configure the assembly plugin to have multiple executions, each one loading a different filter file. I'll probably choose the former since I don't have a lot of config to duplicate.

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