<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.mortbay.jetty</groupId>
  <artifactId>project</artifactId>
  <packaging>pom</packaging>
  <name>Jetty Server Project</name>
  <version>6.1-SNAPSHOT</version>
  <url>http://jetty.mortbay.org</url>
  <issueManagement>
    <system>jira</system>
    <url>http://jira.codehaus.org/browse/Jetty</url>
  </issueManagement>
  <mailingLists>
    <mailingList>
      <name>Jetty Discuss List</name>
      <archive>http://lists.sourceforge.net/lists/listinfo/jetty-discuss</archive>
      <otherArchives>
        <otherArchive>http://www.nabble.com/Jetty-Discuss-f60.html</otherArchive>
      </otherArchives>
    </mailingList>
    <mailingList>
      <name>Jetty Support List</name>
      <archive>http://lists.sourceforge.net/lists/listinfo/jetty-support</archive>
      <otherArchives>
        <otherArchive>http://www.nabble.com/Jetty-Support-f61.html</otherArchive>
      </otherArchives>
    </mailingList>
    <mailingList>
      <name>Jetty Announce List</name>
      <archive>http://lists.sourceforge.net/lists/listinfo/jetty-announce</archive>
      <otherArchives>
        <otherArchive>http://www.nabble.com/Jetty---Announce-f2649.html</otherArchive>
      </otherArchives>
    </mailingList>
  </mailingLists>
  <developers>
    <developer>
      <id>gregw</id>
      <name>Greg Wilkins</name>
      <email>gregw@apache.org</email>
      <url>http://www.mortbay.com/mortbay/people/gregw</url>
      <organization>Mort Bay Consulting</organization>
      <organizationUrl>http://www.mortbay.com</organizationUrl>
    </developer>
    <developer>
      <id>janb</id>
      <name>Jan Bartel</name>
      <email>janb@apache.org</email>
      <url>http://www.mortbay.com/people/janb</url>
      <organization>Mort Bay Consulting</organization>
      <organizationUrl>http://www.mortbay.com</organizationUrl>
    </developer>
    <developer>
      <id>jules</id>
      <name>Jules Gosnell</name>
      <email>jules@apache.org</email>
      <organization />
    </developer>
    <developer>
      <id>jstrachan</id>
      <name>James Strachan</name>
      <email>jstrachan@apache.org</email>
      <organization>Logic Blaze</organization>
      <organizationUrl>http://www.logicblaze.com</organizationUrl>
    </developer>
    <developer>
      <id>sbordet</id>
      <name>Simone Bordet</name>
      <email>simone.bordet@simulalabs.com</email>
      <organization>Simula Labs</organization>
      <organizationUrl>http://www.simulalabs.com</organizationUrl>
    </developer>
    <developer>
      <id>tvernum</id>
      <name>Tim Vernum</name>
      <email>tim@adjective.org</email>
      <organization />
    </developer>
    <developer>
      <id>ngonzalez</id>
      <name>Nik Gonzalez</name>
      <email>ngonzalez@exist.com</email>
      <organization />
    </developer>
    <developer>
      <id>jfarcand</id>
      <name>Jeanfrancois Arcand</name>
      <email>jfarcand@apache.org</email>
      <organization>Sun Microsystems</organization>
      <organizationUrl>http://www.sun.com</organizationUrl>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache License Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0</url>
    </license>
  </licenses>
  <scm>
    <connection>scm:svn:https://svn.codehaus.org/jetty/jetty/trunk</connection>
    <developerConnection>scm:svn:https://svn.codehaus.org/jetty/jetty/trunk</developerConnection>
    <url>http://fisheye.codehaus.org/viewrep/jetty/</url>
  </scm>
  <organization>
    <name>Mort Bay Consulting</name>
    <url>http://www.mortbay.com</url>
  </organization>
  <build>
    <sourceDirectory>src/main/java</sourceDirectory>
    <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
    <testSourceDirectory>src/test/java</testSourceDirectory>
    <outputDirectory>target/classes</outputDirectory>
    <testOutputDirectory>target/test-classes</testOutputDirectory>
    <extensions>
      <extension>
        <groupId>org.apache.maven.wagon</groupId>
        <artifactId>wagon-ssh-external</artifactId>
        <version>1.0-alpha-6</version>
      </extension>
      <extension>
	<groupId>org.apache.maven.wagon</groupId>
	<artifactId>wagon-webdav</artifactId>
	<version>1.0-beta-1</version>
      </extension>
    </extensions>
    <defaultGoal>install</defaultGoal>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
      </resource>
    </resources>
    <testResources>
      <testResource>
        <directory>src/test/resources</directory>
      </testResource>
    </testResources>
    <directory>target</directory>
    <finalName>${artifactId}-${version}</finalName>
    <plugins>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.4</source>
          <target>1.4</target>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-release-plugin</artifactId>
        <configuration>
          <tagBase>https://svn.codehaus.org/jetty/jetty/tags</tagBase>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
        <version>2.1</version>
        <configuration>
          <archive>
            <manifestEntries>
              <mode>development</mode>
              <url>${pom.url}</url>
	      <implementation-version>${pom.version}</implementation-version>
	      <package>org.mortbay</package>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

      <plugin>
	<inherited>true</inherited>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-source-plugin</artifactId>
	<executions>
	  <execution>
	    <id>attach-sources</id>
	    <goals>
	      <goal>jar</goal>
	    </goals>
	  </execution>
	</executions>
      </plugin>

      <!-- plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clover-plugin</artifactId>
        <configuration>
	  <jdk>1.5</jdk>
        </configuration>
        <executions>
          <execution>
            <phase>pre-site</phase>
            <goals>
              <goal>instrument</goal>
              <goal>aggregate</goal>
            </goals>
          </execution>
        </executions>
      </plugin -->
      
      
      
      
      
      
      
      
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>rpm-maven-plugin</artifactId>
                <version>2.0-alpha-3-SNAPSHOT</version>
                <configuration>
                    <release>1</release>
                    <copyright>Apache License Version 2.0</copyright>
                    <distribution>Jetty 6</distribution>
                    <version>${project.version}</version>
                    <group>Application/Webserver</group>
                    <packager>WebtideDev</packager>
                    <name>jetty-webserver</name>
                    <!--<icon>src/main/resources/icon.gif</icon>-->
                    <prefix>/usr/local</prefix>
                    
                    <mappings>
                        <mapping>
                            <artifact>
                                <classifiers>
                                    <classifier>project</classifier>
                                </classifiers>
                            </artifact>
                            <directory>${rpm-install-root}</directory>
                            <sources>                                   
                                <source>
                                    <location>./</location>
                                    <excludes>
                                        <exclude>target</exclude>
                                        <exclude>target/**</exclude>
                                        <exclude>**/target</exclude>
                                        <exclude>**/target/**</exclude>
                                    </excludes>
                                </source>
                            </sources>
                         </mapping>
                    </mappings> 
                    
                    <preinstall>
                        echo Installing Jetty Web Server ...
                    </preinstall>
                    



                   <postinstall>
<![CDATA[


echo Configuring Jetty
echo Install Path: ${rpm-install-root}

cat > /etc/init.d/jetty << "EOF"
#!/bin/sh  

# chkconfig: 345 85 60
# description: Jetty Web Server.
# processname: jetty


### BEGIN INIT INFO
# Provides: jetty
# Required-Start: $local_fs $network $syslog
# Should-Start: nthd
# Required-Stop:
# Default-Start: 3 4 5
# Default-Stop: 0 1 2 6
# Short-Description: Jetty 6
# Description: Jetty Web Server
### END INIT INFO


#
# Startup script for jetty under *nix systems (it works under NT/cygwin too).
#
# Configuration files
#
# /etc/default/jetty
#   If it exists, this is read at the start of script. It may perform any 
#   sequence of shell commands, like setting relevant environment variables.
#
# $HOME/.jettyrc
#   If it exists, this is read at the start of script. It may perform any 
#   sequence of shell commands, like setting relevant environment variables.
#
# /etc/jetty.conf
#   If found, and no configurations were given on the command line,
#   the file will be used as this script's configuration. 
#   Each line in the file may contain:
#     - A comment denoted by the pound (#) sign as first non-blank character.
#     - The path to a regular file, which will be passed to jetty as a 
#       config.xml file.
#     - The path to a directory. Each *.xml file in the directory will be
#       passed to jetty as a config.xml file.
#
#   The files will be checked for existence before being passed to jetty.
#
# $JETTY_HOME/etc/jetty.xml
#   If found, used as this script's configuration file, but only if
#   /etc/jetty.conf was not present. See above.
#   
# Configuration variables
#
# JAVA_HOME  
#   Home of Java installation. 
#
# JAVA
#   Command to invoke Java. If not set, $JAVA_HOME/bin/java will be
#   used.
#
# JAVA_OPTIONS
#   Extra options to pass to the JVM
#
# JETTY_HOME
#   Where Jetty is installed. If not set, the script will try go
#   guess it by first looking at the invocation path for the script,
#   and then by looking in standard locations as $HOME/opt/jetty
#   and /opt/jetty. The java system property "jetty.home" will be
#   set to this value for use by configure.xml files, f.e.:
#
#    <Arg><SystemProperty name="jetty.home" default="."/>/webapps/jetty.war</Arg>
#
# JETTY_CONSOLE
#   Where Jetty console output should go. Defaults to first writeable of
#      /dev/console
#      /dev/tty
#
# JETTY_PORT
#   Override the default port for Jetty servers. If not set then the
#   default value in the xml configuration file will be used. The java
#   system property "jetty.port" will be set to this value for use in
#   configure.xml files. For example, the following idiom is widely
#   used in the demo config files to respect this property in Listener
#   configuration elements:
#
#    <Set name="Port"><SystemProperty name="jetty.port" default="8080"/></Set>
#
#   Note: that the config file could ignore this property simply by saying:
#
#    <Set name="Port">8080</Set>
#
# JETTY_RUN
#   Where the jetty.pid file should be stored. It defaults to the
#   first available of /var/run, /usr/var/run, and /tmp if not set.
#  
# JETTY_PID
#   The Jetty PID file, defaults to $JETTY_RUN/jetty.pid
#   
# JETTY_ARGS
#   The default arguments to pass to jetty.
#

. /etc/rc.d/init.d/functions


# this is set by rpm installer
source /etc/profile
JETTY_HOME=${rpm-install-root}
cd $JETTY_HOME







usage()
{
    echo "Usage: $0 {start|stop|run|restart|check|status|supervise} [ CONFIGS ... ] "
    exit 1
}

[ $# -gt 0 ] || usage

TMPJ=/tmp/j$$

##################################################
# Get the action & configs
##################################################

ACTION=$1
shift
ARGS="$*"
CONFIGS=""

##################################################
# Find directory function
##################################################
findDirectory()
{
    OP=$1
    shift
    for L in $* ; do
        [ $OP $L ] || continue 
        echo $L
        break
    done 
}


##################################################
# See if there's a default configuration file
##################################################
if [ -f /etc/default/jetty ] ; then 
  . /etc/default/jetty
fi

##################################################
# See if there's a user-specific configuration file
##################################################
if [ -f $HOME/.jettyrc ] ; then 
  . $HOME/.jettyrc
fi


##################################################
# Jetty's hallmark
##################################################
JETTY_INSTALL_TRACE_FILE="start.jar"


##################################################
# Try to determine JETTY_HOME if not set
##################################################
if [ -z "$JETTY_HOME" ] 
then
  JETTY_HOME_1=`dirname "$0"`
  JETTY_HOME_1=`dirname "$JETTY_HOME_1"`
  if [ -f "$JETTY_HOME_1/$JETTY_INSTALL_TRACE_FILE" ] ; 
  then 
     JETTY_HOME=$JETTY_HOME_1 
  fi
fi


##################################################
# if no JETTY_HOME, search likely locations.
##################################################
if [ "$JETTY_HOME" = "" ] ; then
  STANDARD_LOCATIONS="           \
        $HOME                    \
        $HOME/src                \
        $HOME/opt/             \
        /opt                     \
        /java                    \
        /usr/share               \
        /usr/share/java          \
        /usr/local               \
        /usr/local/share         \
        /usr/local/share/java    \
        /home                    \
        "
  JETTY_DIR_NAMES="              \
        Jetty                    \
        jetty                    \
        Jetty-*                  \
        jetty-*                  \
        "
        
  JETTY_HOME=
  for L in $STANDARD_LOCATIONS 
  do
     for N in $JETTY_DIR_NAMES 
     do
         if [ -d $L/$N ] && [ -f "$L/$N/$JETTY_INSTALL_TRACE_FILE" ] ; 
         then 
            JETTY_HOME="$L/$N"
            echo "Defaulting JETTY_HOME to $JETTY_HOME"
         fi
     done
     [ ! -z "$JETTY_HOME" ] && break
  done
fi

##################################################
# No JETTY_HOME yet? We're out of luck!
##################################################
if [ -z "$JETTY_HOME" ] ; then
    echo "** ERROR: JETTY_HOME not set, you need to set it or install in a standard location" 
    exit 1
fi

#####################################################
# Check that jetty is where we think it is
#####################################################
if [ ! -r $JETTY_HOME/$JETTY_INSTALL_TRACE_FILE ] 
then
   echo "** ERROR: Oops! Jetty doesn't appear to be installed in $JETTY_HOME"
   echo "** ERROR:  $JETTY_HOME/$JETTY_INSTALL_TRACE_FILE is not readable!"
   exit 1
fi


###########################################################
# Get the list of config.xml files from the command line.
###########################################################
if [ ! -z "$ARGS" ] 
then
  for A in $ARGS 
  do
    if [ -f $A ] 
    then
       CONF="$A" 
    elif [ -f $JETTY_HOME/etc/$A ] 
    then
       CONF="$JETTY_HOME/etc/$A" 
    elif [ -f $A.xml ] 
    then
       CONF="$A.xml" 
    elif [ -f $JETTY_HOME/etc/$A.xml ] 
    then
       CONF="$JETTY_HOME/etc/$A.xml" 
    else
       echo "** ERROR: Cannot find configuration '$A' specified in the command line." 
       exit 1
    fi
    if [ ! -r $CONF ] 
    then
       echo "** ERROR: Cannot read configuration '$A' specified in the command line." 
       exit 1
    fi
    CONFIGS="$CONFIGS $CONF"
  done
fi


##################################################
# Try to find this script's configuration file,
# but only if no configurations were given on the
# command line.
##################################################
if [ -z "$JETTY_CONF" ] 
then
  if [ -f /etc/jetty.conf ]
  then
     JETTY_CONF=/etc/jetty.conf
  elif [ -f "$JETTY_HOME/etc/jetty.conf" ]
  then
     JETTY_CONF="$JETTY_HOME/etc/jetty.conf"
  fi
fi

##################################################
# Read the configuration file if one exists
##################################################
CONFIG_LINES=
if [ -z "$CONFIGS" ] && [ -f "$JETTY_CONF" ] && [ -r "$JETTY_CONF" ] 
then
  CONFIG_LINES=`cat $JETTY_CONF | grep -v "^[:space:]*#" | tr "\n" " "` 
fi

##################################################
# Get the list of config.xml files from jetty.conf
##################################################
if [ ! -z "$CONFIG_LINES" ] 
then
  for CONF in $CONFIG_LINES 
  do
    if [ ! -r "$CONF" ] 
    then
      echo "** WARNING: Cannot read '$CONF' specified in '$JETTY_CONF'" 
    elif [ -f "$CONF" ] 
    then
      # assume it's a configure.xml file
      CONFIGS="$CONFIGS $CONF" 
    elif [ -d "$CONF" ] 
    then
      # assume it's a directory with configure.xml files
      # for example: /etc/jetty.d/
      # sort the files before adding them to the list of CONFIGS
      XML_FILES=`ls $CONF/*.xml | sort | tr "\n" " "` 
      for FILE in $XML_FILES 
      do
         if [ -r "$FILE" ] && [ -f "$FILE" ] 
         then
            CONFIGS="$CONFIGS $FILE" 
         else
           echo "** WARNING: Cannot read '$FILE' specified in '$JETTY_CONF'" 
         fi
      done
    else
      echo "** WARNING: Don''t know what to do with '$CONF' specified in '$JETTY_CONF'" 
    fi
  done
fi

#####################################################
# Run the standard server if there's nothing else to run
#####################################################
if [ -z "$CONFIGS" ] 
then
    CONFIGS="$JETTY_HOME/etc/jetty.xml"
fi


#####################################################
# Find a location for the pid file
#####################################################
if [  -z "$JETTY_RUN" ] 
then
  JETTY_RUN=`findDirectory -w /var/run /usr/var/run /tmp`
fi

#####################################################
# Find a PID for the pid file
#####################################################
if [  -z "$JETTY_PID" ] 
then
  JETTY_PID="$JETTY_RUN/jetty.pid"
fi

#####################################################
# Find a location for the jetty console
#####################################################
if [  -z "$JETTY_CONSOLE" ] 
then
  if [ -w /dev/console ]
  then
    JETTY_CONSOLE=/dev/console
  else
    JETTY_CONSOLE=/dev/tty
  fi
fi


##################################################
# Check for JAVA_HOME
##################################################
if [ -z "$JAVA_HOME" ]
then
    # If a java runtime is not defined, search the following
    # directories for a JVM and sort by version. Use the highest
    # version number.

    # Java search path
    JAVA_LOCATIONS="\
        /usr/bin \
        /usr/local/bin \
        /usr/local/java \
        /usr/local/jdk \
        /usr/local/jre \
        /opt/java \
        /opt/jdk \
        /opt/jre \
    " 
    JAVA_NAMES="java jre kaffe"
    for N in $JAVA_NAMES ; do
        for L in $JAVA_LOCATIONS ; do
            [ -d $L ] || continue 
            find $L -name "$N" ! -type d | grep -v threads | while read J ; do
                [ -x $J ] || continue
                VERSION=`eval $J -version 2>&1`       
                [ $? = 0 ] || continue
                VERSION=`expr "$VERSION" : '.*"\(1.[0-9\.]*\)"'`
                [ "$VERSION" = "" ] && continue
                expr $VERSION \< 1.2 >/dev/null && continue
                echo $VERSION:$J
            done
        done
    done | sort | tail -1 > $TMPJ
    JAVA=`cat $TMPJ | cut -d: -f2`
    JVERSION=`cat $TMPJ | cut -d: -f1`

    JAVA_HOME=`dirname $JAVA`
    while [ ! -z "$JAVA_HOME" -a "$JAVA_HOME" != "/" -a ! -f "$JAVA_HOME/lib/tools.jar" ] ; do
        JAVA_HOME=`dirname $JAVA_HOME`
    done
    [ "$JAVA_HOME" = "" ] && JAVA_HOME=

    echo "Found JAVA=$JAVA in JAVA_HOME=$JAVA_HOME"
fi


##################################################
# Determine which JVM of version >1.2
# Try to use JAVA_HOME
##################################################
if [ "$JAVA" = "" -a "$JAVA_HOME" != "" ]
then
  if [ ! -z "$JAVACMD" ] 
  then
     JAVA="$JAVACMD" 
  else
    [ -x $JAVA_HOME/bin/jre -a ! -d $JAVA_HOME/bin/jre ] && JAVA=$JAVA_HOME/bin/jre
    [ -x $JAVA_HOME/bin/java -a ! -d $JAVA_HOME/bin/java ] && JAVA=$JAVA_HOME/bin/java
  fi
fi

if [ "$JAVA" = "" ]
then
    echo "Cannot find a JRE or JDK. Please set JAVA_HOME to a >=1.2 JRE" 2>&2
    exit 1
fi

JAVA_VERSION=`expr "$($JAVA -version 2>&1 | head -1)" : '.*1\.\([0-9]\)'`

#####################################################
# See if JETTY_PORT is defined
#####################################################
if [ "$JETTY_PORT" != "" ] 
then
  JAVA_OPTIONS="$JAVA_OPTIONS -Djetty.port=$JETTY_PORT"
fi


#####################################################
# Are we running on Windows? Could be, with Cygwin/NT.
#####################################################
case "`uname`" in
CYGWIN*) PATH_SEPARATOR=";";;
*) PATH_SEPARATOR=":";;
esac


#####################################################
# Add jetty properties to Java VM options.
#####################################################
JAVA_OPTIONS="$JAVA_OPTIONS -Djetty.home=$JETTY_HOME "

#####################################################
# This is how the Jetty server will be started
#####################################################
RUN_CMD="$JAVA $JAVA_OPTIONS -jar $JETTY_HOME/start.jar $JETTY_ARGS $CONFIGS"

#####################################################
# Comment these out after you're happy with what 
# the script is doing.
#####################################################
#echo "JETTY_HOME     =  $JETTY_HOME"
#echo "JETTY_CONF     =  $JETTY_CONF"
#echo "JETTY_RUN      =  $JETTY_RUN"
#echo "JETTY_PID      =  $JETTY_PID"
#echo "JETTY_CONSOLE  =  $JETTY_CONSOLE"
#echo "JETTY_ARGS     =  $JETTY_ARGS"
#echo "CONFIGS        =  $CONFIGS"
#echo "JAVA_OPTIONS   =  $JAVA_OPTIONS"
#echo "JAVA           =  $JAVA"




##################################################
# Do the action
##################################################
case "$ACTION" in
  start)
        echo "Starting Jetty: "

        if [ -f $JETTY_PID ]
        then
            echo -n "Jetty Webserver is Already Running!!"
            failure $"Jetty Webserver is Already Running!!!"
            echo
            exit 1
        fi

        echo "STARTED Jetty `date`" >> $JETTY_CONSOLE

        nohup sh -c "exec $RUN_CMD >>$JETTY_CONSOLE 2>&1" >/dev/null &
        echo $! > $JETTY_PID
        echo "Jetty running pid="`cat $JETTY_PID`
        echo "STARTED `date`" >> $JETTY_CONSOLE
        echo -n "Jetty Webserver is Successfully Running!!!"
        success $"Jetty Webserver is Successfully Running!!!"
        echo
        exit 0
        ;;

  stop)
        PID=`cat $JETTY_PID 2>/dev/null`
        echo "Shutting down Jetty: $PID"
        kill $PID 2>/dev/null
        sleep 2
        kill -9 $PID 2>/dev/null
        rm -f $JETTY_PID
        echo "STOPPED `date`" >>$JETTY_CONSOLE
        echo -n "Jetty Webserver is Successfully Stopped!!!"
        success $"Jetty Webserver is Successfully Stopped!!!"
        echo
        exit 0
        ;;

  restart)
        $0 stop $*
        sleep 5
        $0 start $*
        echo -n "Jetty Webserver is Restarted Successfully!!!"
        success $"Jetty Webserver is Restarted Successfully!!!"
        echo
        exit 0
        ;;

  supervise)
       #
       # Under control of daemontools supervise monitor which
       # handles restarts and shutdowns via the svc program.
       #
         exec $RUN_CMD
         echo
         exit 0
         ;;

  run|demo)
        echo "Running Jetty: "

        if [ -f $JETTY_PID ]
        then
            echo "Already Running!!"
            echo -n "Jetty Webserver is Already Running!!!"
            failure $"Jetty Webserver is Already Running!!!"
            echo
            exit 1
        fi

        exec $RUN_CMD
        echo -n "Jetty Webserver has Successfully Run!!!"
        success $"Jetty Webserver has Successfully Run!!!"
        echo
        exit 0
        ;;

  check|status)
        echo "Checking arguments to Jetty: "
        echo "JETTY_HOME     =  $JETTY_HOME"
        echo "JETTY_CONF     =  $JETTY_CONF"
        echo "JETTY_RUN      =  $JETTY_RUN"
        echo "JETTY_PID      =  $JETTY_PID"
        echo "JETTY_CONSOLE  =  $JETTY_CONSOLE"
        echo "JETTY_PORT     =  $JETTY_PORT"
        echo "CONFIGS        =  $CONFIGS"
        echo "JAVA_OPTIONS   =  $JAVA_OPTIONS"
        echo "JAVA           =  $JAVA"
        echo "CLASSPATH      =  $CLASSPATH"
        echo "RUN_CMD        =  $RUN_CMD"
        echo
        
        if [ -f $JETTY_RUN/jetty.pid ]
        then
            echo "Jetty running pid="`cat $JETTY_RUN/jetty.pid`
            echo -n "Jetty Webserver is Running!!!"
            success $"Jetty Webserver is Running!!!"
            echo
            exit 0
        else
            echo -n "Jetty Webserver is not started!!!"
            failure $"Jetty Webserver is not started!!!"
            echo
        fi
        exit 1
        ;;

*)
        usage
	;;
esac

exit 0





                        
EOF

# make executable
chmod u+x /etc/init.d/jetty





# configure chkconfig install

if [ -x /usr/lib/lsb/install_initd ]; then
/usr/lib/lsb/install_initd /etc/init.d/jetty
elif [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --add jetty
else

ln -sf /etc/init.d/jetty /etc/rc.d/rc2.d/S90jetty
ln -sf /etc/init.d/jetty /etc/rc.d/rc3.d/S90jetty
ln -sf /etc/init.d/jetty /etc/rc.d/rc4.d/S90jetty
ln -sf /etc/init.d/jetty /etc/rc.d/rc5.d/S90jetty

ln -sf /etc/init.d/jetty /etc/rc.d/rc1.d/K10jetty
ln -sf /etc/init.d/jetty /etc/rc.d/rc6.d/K10jetty

fi

echo "Jetty Web Server is Successfully Installed!!!"
echo
service jetty start
echo


]]>
                    </postinstall>
                    <preremove>
<![CDATA[                    
                    
echo Removing Jetty Web Server ...

#chkconfig scripts removal
#only on uninstall, not on upgrades.
if [ $1 = 0 ]; then
/etc/init.d/jetty stop > /dev/null 2>&1
if [ -x /usr/lib/lsb/remove_initd ]; then
/usr/lib/lsb/install_initd /etc/init.d/jetty
elif [ -x /sbin/chkconfig ]; then
/sbin/chkconfig --del jetty
else
rm -f /etc/rc.d/rc?.d/???jetty
fi
fi

]]>
                    </preremove>

                    <postremove>
<![CDATA[

echo "Deleting /etc/init.d/jetty"
rm /etc/init.d/jetty
echo Jetty Web Server is Successfully Removed!!!


]]>
                    </postremove>
          
                </configuration>
            </plugin>

    </plugins>
  </build>
  <modules>
    <module>modules/servlet-api-2.5</module>
    <module>modules/util</module>
    <module>modules/jetty</module>
    <module>modules/jsp-api-2.1</module>
    <module>modules/jsp-2.1</module>
    <module>modules/jsp-api-2.0</module>
    <module>modules/jsp-2.0</module>
    <module>modules/management</module>
    <module>modules/start</module>
    <module>modules/maven-plugin</module>
    <module>modules/jspc-maven-plugin</module>
    <module>modules/naming</module>
    <module>modules/plus</module>
    <module>modules/html</module>
    <module>modules/annotations</module>
    <module>extras/servlet-tester</module>
    <module>extras/xbean</module>
    <module>extras/cometd</module>
    <module>extras/spring</module>
    <module>extras/grizzly</module>
    <module>extras/sslengine</module>
    <module>extras/ajp</module>
    <module>extras/setuid</module>
    <module>extras/win32service</module>
    <!-- <module>extras/client</module> -->
    <module>extras/gwt</module>
    <module>extras/threadpool</module>
    <module>examples/test-webapp</module>
    <module>examples/test-jaas-webapp</module>
    <module>examples/test-jndi-webapp</module>
    <module>examples/embedded</module>
    <module>examples/cometd-demo</module>
    <!-- <module>examples/spring-ebj3-demo</module> -->
    <module>extras/tests</module>
  </modules>

  <reporting>
    <outputDirectory>target/site</outputDirectory>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <aggregate>true</aggregate>
            <debug>true</debug>
            <stylesheetfile>${basedir}/project-website/project-site/src/resources/javadoc.css</stylesheetfile>
            <links>
              <link>http://java.sun.com/javaee/5/docs/api</link>
              <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
            </links>
          </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <configuration>
          <aggregate>true</aggregate>
       </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <reportSets>
          <reportSet>
            <reports>
              <report>project-team</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clover-plugin</artifactId>
        <configuration>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.maven</groupId>
        <artifactId>maven-plugin-tools-api</artifactId>
        <version>2.0</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit-version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl104-over-slf4j</artifactId>
        <version>${slf4j-version}</version>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-simple</artifactId>
        <version>${slf4j-version}</version>
      </dependency>
      <dependency>
        <groupId>mx4j</groupId>
        <artifactId>mx4j</artifactId>
        <version>${mx4j-version}</version>
      </dependency>
      <dependency>
        <groupId>mx4j</groupId>
        <artifactId>mx4j-tools</artifactId>
        <version>${mx4j-version}</version>
      </dependency>
      <dependency>
        <groupId>xerces</groupId>
        <artifactId>xercesImpl</artifactId>
        <version>${xerces-version}</version>
      </dependency>
      <dependency>
        <groupId>commons-el</groupId>
        <artifactId>commons-el</artifactId>
        <version>${commons-el-version}</version>
      </dependency>
      <dependency>
        <groupId>ant</groupId>
        <artifactId>ant</artifactId>
        <version>${ant-version}</version>
      </dependency>
      <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>${mail-version}</version>
      </dependency>
      <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>${activation-version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <distributionManagement>
    <repository>
      <id>codehaus.org</id>
      <name>Jetty Repository</name>
      <url>dav:https://dav.codehaus.org/repository/jetty/</url>
    </repository>
    <snapshotRepository>
      <id>codehaus.org</id>
      <name>Jetty Snapshot Repository</name>
      <url>dav:https://dav.codehaus.org/snapshots.repository/jetty/</url>
    </snapshotRepository>
    <site>
      <id>codehaus.org</id>
      <url>dav:https://dav.codehaus.org/jetty/</url>
    </site>
  </distributionManagement>
  <properties>
    <activation-version>1.1</activation-version>
    <ant-version>1.6.5</ant-version>
    <commons-el-version>1.0</commons-el-version>
    <jasper-version>5.5.15</jasper-version>
    <jta-spec-version>1.0.1B-rc4</jta-spec-version>
    <junit-version>3.8.1</junit-version>
    <mail-version>1.4</mail-version>
    <mx4j-version>3.0.1</mx4j-version>
    <slf4j-version>1.0.1</slf4j-version>
    <eclipse-compiler-version>3.1.1</eclipse-compiler-version>
    <rpm-install-root>/usr/local/jetty/jetty-${project.version}</rpm-install-root>
    <rpm-scripts>bin/rpm-scripts</rpm-scripts>
  </properties>
  
  <pluginRepositories>
      <pluginRepository>
        <id>Mojo Snapshots</id>
        <url>http://snapshots.repository.codehaus.org/</url>
        <snapshots>
          <enabled>true</enabled>
        </snapshots>
        <releases>
          <enabled>false</enabled>
        </releases>
      </pluginRepository>
  </pluginRepositories>
</project>

