tags:

views:

18

answers:

1

Hi.

Has anyone created two versions of components.xml like the components-dev.properties or the other dev or prod versions?

How did you do this?

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" />
+2  A: 

You can conditionally install a component like this:

<component name="fooBar" class="org.bar.FooBar" install="true" />

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

...
dev=true
...

components.xml

<components>
...
<component name="fooBar" class="org.bar.FooBar" install="@dev@" />
...
</components>

Now you just need to change the dev attribute.

germanescobar
I don't know why I didn't think of that. Great tip! Thanks
Shervin