As of version 1.6 (thanks to Sebastian Pappert), it is possible to use the Config Processor in Ant build files. See how below.
The provided Ant Task needs some JARs in its classpath to work properly. You can declare them like this:
<taskdef name="config-processor" classname="com.google.code.configprocessor.ant.ConfigProcessorTask"> <classpath> <pathelement location="lib/maven-config-processor-plugin.jar" /> <pathelement location="lib/xstream.jar" /> <pathelement location="lib/xercesImpl.jar" /> <pathelement location="lib/xpp3_min.jar" /> <pathelement location="lib/commons-lang.jar" /> <pathelement location="lib/plexus-container-default.jar" /> </classpath> </taskdef>
These JARs are included in the zip distribution of the ant task.
With the Config Processor task declaration in place, we can use it like the following:
<target name="test"> <config-processor specificproperties="qa.properties" outputdirectory="target"> <transformation input="my-config.properties" output="processed/my-config.properties" config="my-config-processing.xml" /> <transformation input="other-config.properties" output="processed/other-config.properties" config="other-config-processing.xml" /> </config-processor> </target>
It is possible to declare more than one transformation in a single task.
The Ant task parameters have the same names and meanings as the Maven plugin.