<target name="replaceString" description="Replace host name and port String">
<copy todir="tmp/myTemporaryDirectory">
<filterset>
<filter token="REMOTE_HOST_NAME" value="${remote.host.name}"/>
<filter token="REMOTE_HOST_PORT" value="${remote.host.port}" />
</filterset>
<fileset dir="./directoryContainingFileWithStringsToBeReplaced">
<include name="myHost.jsp" />
<include name="backupHost.jsp" />
</fileset>
</copy>
</target>
In your files myHost.jsp and backupHost.jsp there will be the following String:
@REMOTE_HOST_NAME@ and @REMOTE_HOST_PORT@
for any occurence of them, something like:
./directoryContainingFileWithStringsToBeReplaced/file.jsp:
String urlString = "http://@REMOTE_HOST_NAME@:@REMOTE_HOST_PORT@/jsp/file.jsp?";Do not forget to use the directory tmp/myTemporaryDirectory, where your replacement have been executed!!
No hay comentarios:
Publicar un comentario