开发者

How does tomcat make use of build.properties and build.xml?

I'm following a tutorial to set up a开发者_如何学编程 skeleton application for tomcat :

http://maestric.com/doc/java/spring/setup#build_files

But I don't understand how build.properties and build.xml actually works.

I'm using windows XP and copied the following even though the required directory doesn't exist:

appserver.home=/usr/share/tomcat5.5
appserver.lib=${appserver.home}/common/lib

Really confused now:(


Tomcat doesn't use the build.xml and the build.properties files, these are for Ant which is a tool to automate the build of the application. The script shown in this tutorial is pretty basic, it defines 2 targets to compile sources and to clean compiled classes. And you would use them like this:

ant build

or

ant clean

The appserver.lib property is used to build the class path required to compile sources. It is derived from the root of your Tomcat installation directory and is used to find the JAR for the Servlet API that you need to compile sources. If you decide to use this Ant script, you should update the appserver.home property to match your install. For example:

appserver.home=c:/apps/tomcat5.5
appserver.lib=${appserver.home}/common/lib

But to be honest, the whole setup is a bit messy (it's straightforward, but messy):

  1. you shouldn't bundle the servlet-api.jar in WEB-INF/lib as suggested
  2. I don't like to develop directly under Tomcat's webapp directory (but this is maybe subjective).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜