如何在Seam中创建用于调试/开发的components.xml [英] How do you create components.xml for debug/development in Seam
问题描述
有人创建了components.xml
的两个版本,例如components-dev.properties
还是其他dev
或prod
版本?
Has anyone created two versions of components.xml
like the components-dev.properties
or the other dev
or prod
versions?
您是怎么做到的?
我们有一些用于开发的自定义组件,这些组件是在components.xml
中创建的,我想移至其自己的components-dev.xml
,但是我不怎么做.有任何想法吗?
We have some custom components that we are using for Development that is created in components.xml
that I would like to move to its own components-dev.xml
but I don't how to do this. Any ideas?
我想移动的代码通常是这样的:
The codes that I would like to move are generally like this:
<component name="fooBar" class="org.bar.FooBar" />
推荐答案
您可以有条件地安装这样的组件:
You can conditionally install a component like this:
<component name="fooBar" class="org.bar.FooBar" install="true" />
如果有很多组件需要有条件地安装,并且不想在生产时切换所有组件,则可以使用components.properties文件中的条目.例如:
If you have a lot of components that need to be conditionally installed and you don't want to switch all of them when moving to production, you can use an entry in the components.properties file. For example:
components.properties
components.properties
...
dev=true
...
components.xml
components.xml
<components>
...
<component name="fooBar" class="org.bar.FooBar" install="@dev@" />
...
</components>
现在,您只需要更改dev属性.
Now you just need to change the dev attribute.
这篇关于如何在Seam中创建用于调试/开发的components.xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!