I have a project I would like to build using multiple configurations. I have a constant that needs to be different between builds but I do not know how to change it based o
I would advise attempting to emulate Maven resource filtering and profile properties
..
@WebService(targetNamespace = "@WS_NAMESPACE@")
public class CustomerWebService {
..
<target name="filter-sources">
<copy todir="${build.dir}/src">
<fileset dir="src/templates" includes="**/*.java"/>
<filterset>
<filter token="WS_NAMESPACE" value="${ws.namespace}"/>
</filterset>
</copy>
</target>
<target name="compile" depends="filter-sources">
<javac destdir="${build.dir}/classes">
<src path="src/java"/>
<src path="${build.dir}/src"/>
<classpath>
..
..
</javac>
</target>
Notes:
Each configuration has a different property file
src/properties/dev.properties
src/properties/qa.properties
src/properties/prod.properties
..
<property name="profile" value="dev"/>
<property file="src/properties/${profile}.properties"/>
ant -Dprofile=qa ..