Question

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" />
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top