Changeset 32338

14.08.2018 18:41:35 (13 months ago)

Removing newly introduced tomcat-init target. Instead, any ant command will fail directly the minute the protocol and port variables have not been set up correctly or consistently.

1 modified


  • main/trunk/greenstone3/build.xml

    r32337 r32338  
    129129  --> 
    130   <!--<if> 
    131     <bool><not><isset property="internal.tomcat.port"/></not></bool>--> 
    132130    <if> 
    133131      <bool> 
    147145    </not> 
    148146      </bool> 
    149       <echo>ERROR: Unable to set tomcat.port. 
     147      <fail>ERROR: Unable to set tomcat.port. 
    150148      In file server.protocol=${server.protocol} and requires at minimum that its 
    151149      matching tomcat.port.${server.protocol} property line be set and is assigned a valid port number. 
    152       (Ensure any other enabled tomcat port is valid too)</echo> 
    153       <!--<echo>Uncomment at least the tomcat.${server.protocol}.port line in</echo>--> 
    154       <!--<property name="internal.tomcat.port" value=""/>-->       
     150      (Ensure any other enabled tomcat port is valid too)</fail> 
    155151      <else> 
    156152    <condition property="internal.tomcat.port" value="${tomcat.port.https}" else="${tomcat.port.http}"> 
    160156      </else> 
    161157    </if> 
    162   <!--</if>--> 
    164159  <!-- Set autogenerated properties (properties we calculate here in build.xml) 
    10911086    <fail if="do.abort">Build aborted by user. Please change your properties settings and re-run the target</fail> 
    10921087  </target> 
    1094   <!-- Need to list this first in depends for any target that will be using internal.tomcat.port --> 
    1095   <target name="tomcat-init"> 
    1096     <if> 
    1097       <bool><not><isset property="internal.tomcat.port"/></not></bool> 
    1098       <fail>ERROR: no tomcat port, so tomcat operations won't proceed. 
    1099       tomcat.${server.protocol}.port is not set or not valid. 
    1100       Correct this in</fail> 
    1101     </if> 
    1102   </target> 
    11051089  <!-- this sets up some initial properties --> 
    14161400  </target> 
    1418   <target name="configure-web" depends="tomcat-init,init,perl-for-building" 
     1402  <target name="configure-web" depends="init,perl-for-building" 
    14191403    description="Configure only the web app config files"> 
    14201404    <!-- we want a unix path in the file --> 
    15861570  <target name="configure-tomcat" depends="init,configure-tomcat-local,configure-tomcat-external"/> 
    1588   <target name="configure-tomcat-local" depends="tomcat-init,init,perl-for-building" if="tomcat.islocal"> 
     1572  <target name="configure-tomcat-local" depends="init,perl-for-building" if="tomcat.islocal"> 
    15891573    <!-- re-setup the server.xml file --> 
    15901574    <copy file="${basedir}/resources/tomcat/server_tomcat${tomcat.version.major}" 
    16671651       on how to use this with eclipse 
    16681652    --> 
    1669   <target name="debug-start-tomcat" description="Startup Tomcat for debugger" depends="tomcat-init,init" if="tomcat.islocal"> 
     1653  <target name="debug-start-tomcat" description="Startup Tomcat for debugger" depends="init" if="tomcat.islocal"> 
    16701654    <property name="tomcat.classpath" refid="local.tomcat.classpath"/> 
    16711655    <property name="tomcat.path" refid="local.tomcat.path"/> 
    17341718  <!-- Another way: --> 
    1735   <target name="force-start-tomcat" description="Startup only Tomcat" depends="tomcat-init,init" if="tomcat.islocal"> 
     1719  <target name="force-start-tomcat" description="Startup only Tomcat" depends="init" if="tomcat.islocal"> 
    17371721    <property name="tomcat.classpath" refid="local.tomcat.classpath"/> 
    17881772  <!--ant task http:> 
    1789   <target name="reconfigure" description="Reconfigure the message router" depends="tomcat-init"> 
     1773  <target name="reconfigure" description="Reconfigure the message router"> 
    17901774    <waitfor maxwait="5" maxwaitunit="second"> 
    17911775      <http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c"/> 
    17951779  <!--Command-line args to Ant:> 
    1796   <target name="reconfigure-collection" description="Reconfigure the collection" depends="tomcat-init"> 
     1780  <target name="reconfigure-collection" description="Reconfigure the collection"> 
    17971781    <waitfor maxwait="5" maxwaitunit="second"> 
    17981782      <http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}${server.default.servlet}?a=s&amp;sa=c&amp;sc=${collection}"/> 
    18271811       might still be in use for some moments. We test the URL with the http condition since it's likelier to 
    18281812       fail sooner if the server has indeed been stopped. --> 
    1829   <target name="check-tomcat-running" depends="tomcat-init"> 
     1813  <target name="check-tomcat-running"> 
    18301814    <condition property="tomcat.isrunning"> 
    18311815      <!--<http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}${app.path}"/>--> 
    18551839       both stop and start, both of which need to do tomcat checks. Each property can be set only once during  
    18561840       an invocation with ant. So ant restart will need two properties to store each of the tomcat checks --> 
    1857   <target name="check-tomcat-started" depends="tomcat-init"> 
     1841  <target name="check-tomcat-started"> 
    18581842    <condition property="tomcat.isstarted"> 
    18591843      <http url="${server.protocol}://${tomcat.server}:${internal.tomcat.port}"/> 
    21472131  </target> 
    2149   <target name="soap-deploy-site" depends="tomcat-init,init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site" 
     2133  <target name="soap-deploy-site" depends="init,get-sitename,get-siteuri,get-webservices,create-deployment-files,deploy-site" 
    21502134    description="Deploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."/> 
    21602144  </target> 
    2162   <target name="soap-undeploy-site" depends="tomcat-init,get-undeploy-service-name" 
     2146  <target name="soap-undeploy-site" depends="get-undeploy-service-name" 
    21632147    description="Undeploy a SOAP web service for a local Greenstone site. Tomcat must be running for this to work."> 
    21642148    <filter token="servicesname" value="${axis.undeploy.servicename}"/> 
    21782162  <!-- this target used to deploy the default web service SOAPServer ( on the localsite server 
    21792163  with the default servicename of localsite--> 
    2180   <target name="deploy-localsite" depends="tomcat-init,init"  
     2164  <target name="deploy-localsite" depends="init"  
    21812165    description="Deploy the SOAP server for localsite. Will start and stop Tomcat."> 
    21822166    <antcall target="force-start-tomcat"/> 
    34893473  </target> 
    3491     <target name="run-collection-tests" depends="tomcat-init"> 
     3475    <target name="run-collection-tests"> 
    34923476        <if><bool><not><available file="${basedir}/ext/testing" type="dir"/></not></bool> 
    34933477            <fail>The testing extension is not available. This is required to perform the tests. It can be acquired from SVN by running the command "svn co testing" in the ext directory of your Greenstone 3 installation. </fail>