[Yanel-commits] rev 42115 - public/yanel/trunk/tools/apache-tomcat

guillaume at wyona.com guillaume at wyona.com
Mon Mar 23 10:35:08 CET 2009


Author: guillaume
Date: 2009-03-23 10:35:08 +0100 (Mon, 23 Mar 2009)
New Revision: 42115

Added:
   public/yanel/trunk/tools/apache-tomcat/build.xml
Log:
Simple Ant target to change HTTP and SSL ports in Tomcat's server.xml configuration files
 (based on previously committed XSLT script).

Example of use: tools/apache-ant/bin/ant -f tools/apache-tomcat/build.xml configure-host -Dtomcat.home.dir=$PWD/local/apache-tomcat-5.5.20 -Dhost=localhost -Dhost.HTTP.port=8180 -Dhost.HTTPS.port=8543

Issue: 6888


Copied: public/yanel/trunk/tools/apache-tomcat/build.xml (from rev 42114, public/0_tools/eclipse-3.settings/build.xml)
===================================================================
--- public/yanel/trunk/tools/apache-tomcat/build.xml	                        (rev 0)
+++ public/yanel/trunk/tools/apache-tomcat/build.xml	2009-03-23 09:35:08 UTC (rev 42115)
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<project name="tomcat"
+>
+
+  <target name="configure-host">
+    <property name="server.file"
+     value="${tomcat.home.dir}/conf/server.xml"/>
+
+    <!-- we need an intermediary file because XSLT processors
+     do nothing or bork when using a file both as input and output: -->
+    <property name="server.new.file"
+     value="${tomcat.home.dir}/conf/server-with-ports-patched.xml"/>
+
+    <!-- generate the new server.xml file: -->
+    <xslt
+     in="${server.file}"
+     style="configure-Tomcat-server.xslt"
+     out="${server.new.file}"
+    >
+      <param name="host" expression="${host}"/>
+      <param name="ssl-port" expression="${host.HTTPS.port}"/>
+      <param name="http-port" expression="${host.HTTP.port}"/>
+    </xslt>
+
+    <!-- we need another intermediary file to swap the original file
+     and the new one, which also can be handy if something goes wrong: -->
+    <property name="server.old.file"
+     value="${tomcat.home.dir}/conf/server-before-ports-were-patched.xml"/>
+
+    <move file="${server.file}" tofile="${server.old.file}"/>
+    <move file="${server.new.file}" tofile="${server.file}"/>
+  </target>
+</project>


Property changes on: public/yanel/trunk/tools/apache-tomcat/build.xml
___________________________________________________________________
Name: svn:mergeinfo
   + 



More information about the Yanel-commits mailing list