Ant publishing Web project, Tomcat Management Interface Publishing War project

Source: Internet
Author: User
Tags create directory echo message

Today, the Java Web Project-ADJUSTSOLR is packaged as a war with the apache-ant-1.9.4 version and published to Tomcat (be aware that the JDK version of the development is consistent with the JDK version in Tomcat, otherwise unsupport VERSION51 error)

Code to paste the Build.xml file

<?xml version= "1.0" encoding= "UTF-8"?> <project name = "ADJUSTSOLR" default = "war" Basedir = "." > <property name= "catalina.home" value= "d:/tomcat6.5-jdk1.7"/> <property name = "Build.dir" value = "Build"/ > <property name = "Lib.dir" value = "Webcontent/web-inf/lib"/><property name= "Webroot.dir" value= " WebContent "/> <property name=" Classes.dir "value=" build/classes "/> <path id=" Project.classpath "> < Fileset dir= "${lib.dir}" includes= "***.jar"/> <!--Add Tomcat class path--<fileset dir= "${catalina.home}/ Lib "> <include name=" *.jar "/> </fileset> </path><pathconvert pathsep=" ${li   ne.separator}|  |--"property=" Echo.path.compile "refid=" Project.classpath "> </pathconvert> <!-- Create directory structure-<target name= "init" depends= "clear" description= "Create initialization directory Structure" > <mkdir dir= "${build.dir}"/ > <mkdir dir= "${classes.dir} "/> </target> <!--javac Compile task--><target name=" compile "depends=" init "description=" compile Java file for Java C File "> <javac srcdir=" src "destdir=" ${classes.dir} "Includeantruntime=" false "nowarn=" on "source=     "1.7" target= "1.7" deprecation= "true" debug= "true" encoding= "UTF-8" classpathref= "Project.classpath" > <compilerarg line= "-xlint:unchecked"/> </javac> </target><!--War Pack task--><target name= "W Ar "depends=" compile "description=" packaged as Adjustsolr.war file > <echo message= "Begin war ..."/> <war destfile = "${build.dir}/${ant.project.name}.war" webxml= "Webcontent/web-inf/web.xml" ><fileset dir= "${webRoot.dir}"/ ><lib dir= "${lib.dir}"/><classes dir= "${classes.dir}"/></war></target><!--Clean Task- -><target name = "clear" > <delete dir = "Build"/> </target > </project >
Place the war package under the build file under tomcat6.5-jdk1.7 or other Tomcat:

Local Access connection: http://localhost:8082/adjustSolr/solrSearch.jsp

Published through the server Tomcat management interface:



Ant publishing Web project, Tomcat Management Interface Publishing War project

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.