Project

General

Profile

« Previous | Next » 

Revision 1952

New build system that creates a war file and deploys it to tomcat. Also
updated the web.xml files so that a better servlet path is used. Now, by
default, the servlet path will be: /knb/metacat (as opposed to the
prior servlet path which was /knb/servlet/metacat and depended on the
"invoker" feature of tomcat3 that is not by default enabled in tomcat4. For
now the old servlet path is also defined in web.xml, but we should transition
to using the new path throughout.

Now, three new targets in build.xml:

war: build a war file for deploying metacat
install: create the war then copy it to the tomcat dir
upgrade: install war and then decompress it, possibly overwriting

View differences:

build.xml
140 140
      <property name="debugprefix"         value="${Name}:"/>
141 141
      <property name="release"             value="1.2.1"/>
142 142
      <property name="replication-path"    value="/${context}/servlet/replication"/>
143
      <property name="servlet-path"        value="/${context}/servlet/metacat"/>
143
      <property name="servlet-path"        value="/${context}/metacat"/>
144 144
      <property name="html-path"           value="/${context}"/>
145 145
      <property name="systemidserver"      value="http://${server}"/>
146 146
      <property name="style-common-relpath" 
......
252 252
      <property name="build.metacatnettest" value="${build.tests}/metacatnettest"/>
253 253
      <property name="build.data" value="${build.dir}/data"/>
254 254
      <property name="build.javadocs" value="${build.dir}/docs/api"/>
255
      <property name="build.war" value="${build.dir}/war"/>
255 256

  
256 257
      <property name="dist.dir" value="dist"/>
257 258
      <property name="ver.dir" value="${dist.dir}/${name}-${release}"/>
......
487 488
          src="${build.src}/upgrade-db-to-1.3.sql" />
488 489
   </target>
489 490

  
490
   <target name="installCommon" depends="jar,clientjar"
491
            description="* basic metacat install for web-server files *">
491
   <target name="install" depends="war" description="* Full Install *">
492 492
       <mkdir dir="${datafilepath}" />
493 493
       <mkdir dir="${inlinedatafilepath}" />
494 494
       <chmod dir="${datafilepath}" perm="ug+w" />
495 495
       <mkdir dir="${temp-dir}"/>
496 496
       <chmod dir="${temp-dir}" perm="ug+w" />
497
       <mkdir dir="${installdir}/WEB-INF/lib" />
498
       <copy file="${build.dir}/${name}.jar"
499
             tofile="${installdir}/WEB-INF/lib/${name}.jar" />
500
       <copy file="${build.dir}/${name}-client.jar"
501
             tofile="${installdir}/WEB-INF/lib/${name}-client.jar" />
502
       <copy todir="${installdir}/WEB-INF/lib" filtering="no">
497
       <copy file="${build.dir}/${context}.war" todir="${webapps}"/>
498
   </target>
499
   
500
   <target name="upgrade" depends="install" 
501
          description="* Upgrade an existing metacat installation with a new version *">
502
       <unwar src="${webapps}/${context}.war" dest="${webapps}/${context}" />
503
   </target>
504

  
505
   <target name="install-registry" depends="init" 
506
            description="Install Registry">
507
            
508
      <copy file="${srcdir}/perl/register-dataset.cgi"
509
            todir="${inst.cgi.dir}" filtering="yes"/>
510
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
511
  
512
      <mkdir dir="${temp-dir}" />
513
     <copy todir="${temp-dir}" filtering="yes">
514
       <fileset dir="${build.tmp}/${conversion-module}/lib/style">
515
         <include name="*.xsl"/>
516
         <include name="*.xml"/>
517
       </fileset>
518
     </copy>
519

  
520
      <echo message="Install Registry completed." />
521
   </target>
522

  
523
   <target name="war" depends="warPrepare,warMSSQL"
524
            description="Create a web archive (WAR) for servlet deployment">
525
       <war destfile="${build.dir}/${context}.war" 
526
            webxml="${build.war}/web.xml">
527
         <fileset dir="${war.context}"/>
528
         <lib dir="${war.lib}"/>
529
         <webinf dir="${war.webinf}"/>
530
       </war>
531
   </target>
532

  
533
   <target name="warPrepare" depends="jar,clientjar"
534
            description="Prepare files for creating a web archive (WAR)">
535

  
536
       <property name="war.lib" value="${build.war}/lib" />
537
       <property name="war.webinf" value="${build.war}/WEB-INF" />
538
       <property name="war.context" value="${build.war}/${context}" />
539
       <mkdir dir="${war.lib}" />
540
       <mkdir dir="${war.webinf}" />
541
       <mkdir dir="${war.context}" />
542

  
543
       <copy file="${build.dir}/${name}.jar" todir="${war.lib}" />
544
       <copy file="${build.dir}/${name}-client.jar" todir="${war.lib}" />
545
       <copy todir="${war.lib}" filtering="no">
503 546
         <fileset dir="lib">
504 547
           <include name="*.jar"/>
505 548
         </fileset>
......
507 550
           <include name="*.jar"/>
508 551
         </fileset>
509 552
       </copy>
510
       <copy file="${jdbc}" tofile="${installdir}/WEB-INF/lib/jdbc.jar" />
553
       <copy file="${jdbc}" tofile="${war.lib}/jdbc.jar" />
511 554
       <copy file="lib/web.xml.${tomcatversion}"
512
             tofile="${installdir}/WEB-INF/web.xml" />
513
       <copy file="lib/metacat.properties" todir="${installdir}/WEB-INF"
555
             tofile="${build.war}/web.xml" />
556
       <copy file="lib/metacat.properties" todir="${war.webinf}"
514 557
             filtering="yes" />
515
       <copy todir="${installdir}" filtering="no">
558
       <copy todir="${war.context}" filtering="no">
516 559
         <fileset dir="lib">
517 560
           <include name="**/*.jpg"/>
518 561
           <include name="**/*.png"/>
519 562
           <include name="**/*.gif"/>
520 563
         </fileset>
521 564
       </copy>
522
       <copy todir="${installdir}" filtering="yes">
565
       <copy todir="${war.context}" filtering="yes">
523 566
         <fileset dir="lib">
524 567
           <exclude name="*.jar"/>
525 568
           <exclude name="*.properties"/>
......
530 573
           <exclude name="**/*.gif"/>
531 574
         </fileset>
532 575
       </copy>
533
       <copy todir="${installdir}" filtering="no">
576
       <copy todir="${war.context}" filtering="no">
534 577
         <fileset dir="lib">
535 578
           <include name="**/*.jpg"/>
536 579
           <include name="**/*.png"/>
537 580
           <include name="**/*.gif"/>
538 581
         </fileset>
539 582
       </copy>
540
       <echo>
541
             ***********************************************************
542
              Remember to register the default DTDs by running the
543
              "${build.src}/loaddtd.sql script". This is most easily
544
              done by using the "ant dtdsql" which will run it for you.
545
             ***********************************************************
546
       </echo>
547 583
   </target>
548
   
549
   <target name="installMSSQL" if="MSSQL" depends="installCommon">
550
      <echo> Install MSSQL</echo>
551
      <copy file="${jdbc-add1}"
552
             tofile="${installdir}/WEB-INF/lib/msutil.jar" />
553
       <copy file="${jdbc-add2}"
554
             tofile="${installdir}/WEB-INF/lib/mssqlserver.jar" />
555
   </target>
556
   
557
    <target name="installother" if="other" depends="installCommon">
558
        <echo> Install Other Database</echo>
559
   </target>
560
   
561
   <target name="install" depends="installMSSQL,installother" 
562
            description="* Full Install *" />
563
   
564
   <target name="install-registry" depends="init" 
565
            description="Install Registry">
566
            
567
      <copy file="${srcdir}/perl/register-dataset.cgi"
568
            todir="${inst.cgi.dir}" filtering="yes"/>
569
      <chmod file="${inst.cgi.dir}/register-dataset.cgi" perm="ugo+x" />
570
  
571
      <mkdir dir="${temp-dir}" />
572
     <copy todir="${temp-dir}" filtering="yes">
573
       <fileset dir="${build.tmp}/${conversion-module}/lib/style">
574
         <include name="*.xsl"/>
575
         <include name="*.xml"/>
576
       </fileset>
577
     </copy>
578 584

  
579
      <echo message="Install Registry completed." />
585
   <target name="warMSSQL" if="MSSQL" depends="warPrepare">
586
      <copy file="${jdbc-add1}" tofile="${war.lib}/msutil.jar" />
587
       <copy file="${jdbc-add2}" tofile="${war.lib}/mssqlserver.jar" />
580 588
   </target>
581 589

  
582 590
   <target name="getBeta6ConversionStyles" depends="prepare"

Also available in: Unified diff