如何访问已过滤文件中的程序集 ID?
我有多个看起来像:
<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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想做类似的事情。我有一个想要在多个程序集之间共享的组件。我计划使用程序集的 ID 作为目录名称,例如
在尝试了
${assemble.id}
和${ assemblyId}
但没有成功后,我快速浏览了一下查看插件 2.3 版本的代码。我找到了插入其他属性(项目、过滤器、环境等)的代码,但它似乎没有考虑程序集中的属性。有几个似乎相关的 JIRA 问题:http://jira.codehaus.org/browse/ MASSEMBLY-445 和 http://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.
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.