Ports: Deploying WAR files

Ernst de Haan znerd at FreeBSD.org
Mon Jul 21 01:26:55 PDT 2003


Folks,


Does anyone have any ideas on deploying WAR files from a port? Some 
applications nowadays consist of a single WAR file. Should we not find a 
standard way to deploy these applications in an existing servlet container?

We could do the following:

1) dedicate a single directory for WAR files, e.g.:

   /usr/local/share/java/webapps

In this directory we could stick all WAR files that need to be deployed 
automatically.

2) we could set a variable to point to that location, in bsd.java.mk:

   WAR_DIR=${LOCALBASE}/share/java/webapps

3) we could modify the servlet container ports (www/orion, www/tomcat41, 
etc) to use ${WAR_DIR} as their primary location for WAR files. Either with 
a configuration setting or with a symbolic link.

4) Then we could introduce a variable SERVLET_CONTAINER and set it to the 
servlet container port to install when one is needed. By default it would 
be set to TOMCAT, but it could also be overridden in /etc/make.conf, to be 
set to ORION, for example.

5) Finally, we could specify that ports that install a WAR file must set 
USE_SERVLET_CONTAINER to YES. Then they could use WAR_DIR in the port 
Makefile to put the WAR file in. The ports system will add the appropriate 
servlet container as a runtime dependency (to RUN_DEPENDS).


Biggest issue with this is probably that it changes the existing servlet 
container ports.

And thoughts on this?


Ernst


More information about the freebsd-java mailing list