diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-06 14:08:06 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-06 14:08:06 +0000 |
commit | aeadc1f9129274949daaa57738c7c4550bdfbc7b (patch) | |
tree | 08dadf5ef7474fc41d1d48f74648f1ba8b55f34d /sonar-application/src | |
download | sonarqube-aeadc1f9129274949daaa57738c7c4550bdfbc7b.tar.gz sonarqube-aeadc1f9129274949daaa57738c7c4550bdfbc7b.zip |
SONAR-236 remove deprecated code from checkstyle plugin + display default value of rule parameters in Q profile console
Diffstat (limited to 'sonar-application/src')
108 files changed, 19964 insertions, 0 deletions
diff --git a/sonar-application/src/main/assembly/COPYING b/sonar-application/src/main/assembly/COPYING new file mode 100644 index 00000000000..fc8a5de7edf --- /dev/null +++ b/sonar-application/src/main/assembly/COPYING @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/sonar-application/src/main/assembly/bin/aix-ppc-32/lib/libwrapper.a b/sonar-application/src/main/assembly/bin/aix-ppc-32/lib/libwrapper.a Binary files differnew file mode 100755 index 00000000000..0920cc678fe --- /dev/null +++ b/sonar-application/src/main/assembly/bin/aix-ppc-32/lib/libwrapper.a diff --git a/sonar-application/src/main/assembly/bin/aix-ppc-32/sonar.sh b/sonar-application/src/main/assembly/bin/aix-ppc-32/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/aix-ppc-32/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/aix-ppc-32/wrapper b/sonar-application/src/main/assembly/bin/aix-ppc-32/wrapper Binary files differnew file mode 100755 index 00000000000..6ef895d0a6d --- /dev/null +++ b/sonar-application/src/main/assembly/bin/aix-ppc-32/wrapper diff --git a/sonar-application/src/main/assembly/bin/aix-ppc-64/lib/libwrapper.a b/sonar-application/src/main/assembly/bin/aix-ppc-64/lib/libwrapper.a Binary files differnew file mode 100755 index 00000000000..0560aed5981 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/aix-ppc-64/lib/libwrapper.a diff --git a/sonar-application/src/main/assembly/bin/aix-ppc-64/sonar.sh b/sonar-application/src/main/assembly/bin/aix-ppc-64/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/aix-ppc-64/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/aix-ppc-64/wrapper b/sonar-application/src/main/assembly/bin/aix-ppc-64/wrapper Binary files differnew file mode 100755 index 00000000000..4b48ae73d00 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/aix-ppc-64/wrapper diff --git a/sonar-application/src/main/assembly/bin/hpux-ia-32/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/hpux-ia-32/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..4f2875bd755 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-ia-32/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/hpux-ia-32/sonar.sh b/sonar-application/src/main/assembly/bin/hpux-ia-32/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-ia-32/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/hpux-ia-32/wrapper b/sonar-application/src/main/assembly/bin/hpux-ia-32/wrapper Binary files differnew file mode 100755 index 00000000000..bfac8dcfe96 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-ia-32/wrapper diff --git a/sonar-application/src/main/assembly/bin/hpux-ia-64/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/hpux-ia-64/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..265f82080d2 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-ia-64/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/hpux-ia-64/sonar.sh b/sonar-application/src/main/assembly/bin/hpux-ia-64/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-ia-64/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/hpux-ia-64/wrapper b/sonar-application/src/main/assembly/bin/hpux-ia-64/wrapper Binary files differnew file mode 100755 index 00000000000..6c1e8ea1be7 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-ia-64/wrapper diff --git a/sonar-application/src/main/assembly/bin/hpux-parisc-32/lib/libwrapper.sl b/sonar-application/src/main/assembly/bin/hpux-parisc-32/lib/libwrapper.sl Binary files differnew file mode 100755 index 00000000000..032b1e14356 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-parisc-32/lib/libwrapper.sl diff --git a/sonar-application/src/main/assembly/bin/hpux-parisc-32/sonar.sh b/sonar-application/src/main/assembly/bin/hpux-parisc-32/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-parisc-32/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/hpux-parisc-32/wrapper b/sonar-application/src/main/assembly/bin/hpux-parisc-32/wrapper Binary files differnew file mode 100755 index 00000000000..3a636aa7618 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-parisc-32/wrapper diff --git a/sonar-application/src/main/assembly/bin/hpux-parisc-64/lib/libwrapper.sl b/sonar-application/src/main/assembly/bin/hpux-parisc-64/lib/libwrapper.sl Binary files differnew file mode 100755 index 00000000000..282beb7b341 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-parisc-64/lib/libwrapper.sl diff --git a/sonar-application/src/main/assembly/bin/hpux-parisc-64/sonar.sh b/sonar-application/src/main/assembly/bin/hpux-parisc-64/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-parisc-64/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/hpux-parisc-64/wrapper b/sonar-application/src/main/assembly/bin/hpux-parisc-64/wrapper Binary files differnew file mode 100755 index 00000000000..cf2303a38ae --- /dev/null +++ b/sonar-application/src/main/assembly/bin/hpux-parisc-64/wrapper diff --git a/sonar-application/src/main/assembly/bin/linux-ia-64/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/linux-ia-64/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..6e93a86afc5 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-ia-64/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/linux-ia-64/sonar.sh b/sonar-application/src/main/assembly/bin/linux-ia-64/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-ia-64/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/linux-ia-64/wrapper b/sonar-application/src/main/assembly/bin/linux-ia-64/wrapper Binary files differnew file mode 100755 index 00000000000..de04cdf284c --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-ia-64/wrapper diff --git a/sonar-application/src/main/assembly/bin/linux-ppc-32/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/linux-ppc-32/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..2369ad566f5 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-ppc-32/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/linux-ppc-32/sonar.sh b/sonar-application/src/main/assembly/bin/linux-ppc-32/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-ppc-32/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/linux-ppc-32/wrapper b/sonar-application/src/main/assembly/bin/linux-ppc-32/wrapper Binary files differnew file mode 100755 index 00000000000..a01253613e2 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-ppc-32/wrapper diff --git a/sonar-application/src/main/assembly/bin/linux-ppc-64/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/linux-ppc-64/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..9889b13647d --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-ppc-64/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/linux-ppc-64/sonar.sh b/sonar-application/src/main/assembly/bin/linux-ppc-64/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-ppc-64/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/linux-ppc-64/wrapper b/sonar-application/src/main/assembly/bin/linux-ppc-64/wrapper Binary files differnew file mode 100755 index 00000000000..a53f2a5ac23 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-ppc-64/wrapper diff --git a/sonar-application/src/main/assembly/bin/linux-x86-32/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/linux-x86-32/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..e22b132ea9a --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-x86-32/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/linux-x86-32/sonar.sh b/sonar-application/src/main/assembly/bin/linux-x86-32/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-x86-32/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/linux-x86-32/wrapper b/sonar-application/src/main/assembly/bin/linux-x86-32/wrapper Binary files differnew file mode 100755 index 00000000000..831c5e80d2d --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-x86-32/wrapper diff --git a/sonar-application/src/main/assembly/bin/linux-x86-64/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/linux-x86-64/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..542488a6c8b --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-x86-64/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh b/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-x86-64/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/linux-x86-64/wrapper b/sonar-application/src/main/assembly/bin/linux-x86-64/wrapper Binary files differnew file mode 100755 index 00000000000..307c56e8682 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/linux-x86-64/wrapper diff --git a/sonar-application/src/main/assembly/bin/macosx-universal-32/lib/libwrapper.jnilib b/sonar-application/src/main/assembly/bin/macosx-universal-32/lib/libwrapper.jnilib Binary files differnew file mode 100755 index 00000000000..49fede05a68 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/macosx-universal-32/lib/libwrapper.jnilib diff --git a/sonar-application/src/main/assembly/bin/macosx-universal-32/sonar.sh b/sonar-application/src/main/assembly/bin/macosx-universal-32/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/macosx-universal-32/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/macosx-universal-32/wrapper b/sonar-application/src/main/assembly/bin/macosx-universal-32/wrapper Binary files differnew file mode 100755 index 00000000000..a55f8b59cc5 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/macosx-universal-32/wrapper diff --git a/sonar-application/src/main/assembly/bin/macosx-universal-64/lib/libwrapper.jnilib b/sonar-application/src/main/assembly/bin/macosx-universal-64/lib/libwrapper.jnilib Binary files differnew file mode 100755 index 00000000000..9e8ce338507 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/macosx-universal-64/lib/libwrapper.jnilib diff --git a/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh b/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/macosx-universal-64/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/macosx-universal-64/wrapper b/sonar-application/src/main/assembly/bin/macosx-universal-64/wrapper Binary files differnew file mode 100755 index 00000000000..4bab794c40a --- /dev/null +++ b/sonar-application/src/main/assembly/bin/macosx-universal-64/wrapper diff --git a/sonar-application/src/main/assembly/bin/solaris-sparc-32/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/solaris-sparc-32/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..b77d3e1e18d --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-sparc-32/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/solaris-sparc-32/sonar.sh b/sonar-application/src/main/assembly/bin/solaris-sparc-32/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-sparc-32/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/solaris-sparc-32/wrapper b/sonar-application/src/main/assembly/bin/solaris-sparc-32/wrapper Binary files differnew file mode 100755 index 00000000000..2559f21c94b --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-sparc-32/wrapper diff --git a/sonar-application/src/main/assembly/bin/solaris-sparc-64/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/solaris-sparc-64/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..27eff384262 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-sparc-64/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/solaris-sparc-64/sonar.sh b/sonar-application/src/main/assembly/bin/solaris-sparc-64/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-sparc-64/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/solaris-sparc-64/wrapper b/sonar-application/src/main/assembly/bin/solaris-sparc-64/wrapper Binary files differnew file mode 100755 index 00000000000..8489d5c8874 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-sparc-64/wrapper diff --git a/sonar-application/src/main/assembly/bin/solaris-x86-32/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/solaris-x86-32/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..34de9091640 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-x86-32/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/solaris-x86-32/sonar.sh b/sonar-application/src/main/assembly/bin/solaris-x86-32/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-x86-32/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/solaris-x86-32/wrapper b/sonar-application/src/main/assembly/bin/solaris-x86-32/wrapper Binary files differnew file mode 100755 index 00000000000..080572c6325 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-x86-32/wrapper diff --git a/sonar-application/src/main/assembly/bin/solaris-x86-64/lib/libwrapper.so b/sonar-application/src/main/assembly/bin/solaris-x86-64/lib/libwrapper.so Binary files differnew file mode 100755 index 00000000000..80c22aafe7e --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-x86-64/lib/libwrapper.so diff --git a/sonar-application/src/main/assembly/bin/solaris-x86-64/sonar.sh b/sonar-application/src/main/assembly/bin/solaris-x86-64/sonar.sh new file mode 100755 index 00000000000..1db51aba0d0 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-x86-64/sonar.sh @@ -0,0 +1,703 @@ +#! /bin/sh + +# +# Copyright (c) 1999, 2008 Tanuki Software, Inc. +# http://www.tanukisoftware.com +# All rights reserved. +# +# This software is the confidential and proprietary information +# of Tanuki Software. ("Confidential Information"). You shall +# not disclose such Confidential Information and shall use it +# only in accordance with the terms of the license agreement you +# entered into with Tanuki Software. +# +# Java Service Wrapper sh script. Suitable for starting and stopping +# wrapped Java applications on UNIX platforms. +# + +#----------------------------------------------------------------------------- +# These settings can be modified to fit the needs of your application +# Optimized for use with version 3.3.0 of the Wrapper. + +# Application +APP_NAME="sonar" +APP_LONG_NAME="sonar" + +# Wrapper +WRAPPER_CMD="./wrapper" +WRAPPER_CONF="../../conf/wrapper.conf" + +# Priority at which to run the wrapper. See "man nice" for valid priorities. +# nice is only used if a priority is specified. +PRIORITY= + +# Location of the pid file. +PIDDIR="." + +# If uncommented, causes the Wrapper to be shutdown using an anchor file. +# When launched with the 'start' command, it will also ignore all INT and +# TERM signals. +#IGNORE_SIGNALS=true + +# Wrapper will start the JVM asynchronously. Your application may have some +# initialization tasks and it may be desirable to wait a few seconds +# before returning. For example, to delay the invocation of following +# startup scripts. Setting WAIT_AFTER_STARTUP to a positive number will +# cause the start command to delay for the indicated period of time +# (in seconds). +# +WAIT_AFTER_STARTUP=0 + +# If set, the status, start_msg and stop_msg commands will print out detailed +# state information on the Wrapper and Java processes. +#DETAIL_STATUS=true + +# If specified, the Wrapper will be run as the specified user. +# IMPORTANT - Make sure that the user has the required privileges to write +# the PID file and wrapper.log files. Failure to be able to write the log +# file will cause the Wrapper to exit without any way to write out an error +# message. +# NOTE - This will set the user which is used to run the Wrapper as well as +# the JVM and is not useful in situations where a privileged resource or +# port needs to be allocated prior to the user being changed. +#RUN_AS_USER= + +# The following two lines are used by the chkconfig command. Change as is +# appropriate for your application. They should remain commented. +# chkconfig: 2345 20 80 +# description: "Sonar Server" + +# Initialization block for the install_initd and remove_initd scripts used by +# SUSE linux distributions. +### BEGIN INIT INFO +# Provides: @app.name@ +# Required-Start: $local_fs $network $syslog +# Should-Start: +# Required-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: @app.long.name@ +# Description: @app.description@ +### END INIT INFO + +# Do not modify anything beyond this point +#----------------------------------------------------------------------------- + +# Get the fully qualified path to the script +case $0 in + /*) + SCRIPT="$0" + ;; + *) + PWD=`pwd` + SCRIPT="$PWD/$0" + ;; +esac + +# Resolve the true real path without any sym links. +CHANGED=true +while [ "X$CHANGED" != "X" ] +do + # Change spaces to ":" so the tokens can be parsed. + SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'` + # Get the real path to this script, resolving any symbolic links + TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'` + REALPATH= + for C in $TOKENS; do + # Change any ":" in the token back to a space. + C=`echo $C | sed -e 's;:; ;g'` + REALPATH="$REALPATH/$C" + # If REALPATH is a sym link, resolve it. Loop for nested links. + while [ -h "$REALPATH" ] ; do + LS="`ls -ld "$REALPATH"`" + LINK="`expr "$LS" : '.*-> \(.*\)$'`" + if expr "$LINK" : '/.*' > /dev/null; then + # LINK is absolute. + REALPATH="$LINK" + else + # LINK is relative. + REALPATH="`dirname "$REALPATH"`""/$LINK" + fi + done + done + + if [ "$REALPATH" = "$SCRIPT" ] + then + CHANGED="" + else + SCRIPT="$REALPATH" + fi +done + +# Change the current directory to the location of the script +cd "`dirname "$REALPATH"`" +REALDIR=`pwd` + +# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if +# the working directory is later changed. +FIRST_CHAR=`echo $PIDDIR | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + PIDDIR=$REALDIR/$PIDDIR +fi +# Same test for WRAPPER_CMD +FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CMD=$REALDIR/$WRAPPER_CMD +fi +# Same test for WRAPPER_CONF +FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1` +if [ "$FIRST_CHAR" != "/" ] +then + WRAPPER_CONF=$REALDIR/$WRAPPER_CONF +fi + +# Process ID +ANCHORFILE="$PIDDIR/$APP_NAME.anchor" +STATUSFILE="$PIDDIR/$APP_NAME.status" +JAVASTATUSFILE="$PIDDIR/$APP_NAME.java.status" +PIDFILE="$PIDDIR/$APP_NAME.pid" +LOCKDIR="/var/lock/subsys" +LOCKFILE="$LOCKDIR/$APP_NAME" +pid="" + +# Resolve the location of the 'ps' command +PSEXE="/usr/bin/ps" +if [ ! -x "$PSEXE" ] +then + PSEXE="/bin/ps" + if [ ! -x "$PSEXE" ] + then + echo "Unable to locate 'ps'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi +fi + +# Resolve the os +DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]` +case "$DIST_OS" in + 'sunos') + DIST_OS="solaris" + ;; + 'hp-ux' | 'hp-ux64') + # HP-UX needs the XPG4 version of ps (for -o args) + DIST_OS="hpux" + UNIX95="" + export UNIX95 + ;; + 'darwin') + DIST_OS="macosx" + ;; + 'unix_sv') + DIST_OS="unixware" + ;; +esac + +# Resolve the architecture +if [ "$DIST_OS" = "macosx" ] +then + DIST_ARCH="universal" +else + DIST_ARCH= + DIST_ARCH=`uname -p 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + if [ "X$DIST_ARCH" = "X" ] + then + DIST_ARCH="unknown" + fi + if [ "$DIST_ARCH" = "unknown" ] + then + DIST_ARCH=`uname -m 2>/dev/null | tr [:upper:] [:lower:] | tr -d [:blank:]` + fi + case "$DIST_ARCH" in + 'amd64' | 'athlon' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64') + DIST_ARCH="x86" + ;; + 'ia32' | 'ia64' | 'ia64n' | 'ia64w') + DIST_ARCH="ia" + ;; + 'ip27') + DIST_ARCH="mips" + ;; + 'power' | 'powerpc' | 'power_pc' | 'ppc64') + DIST_ARCH="ppc" + ;; + 'pa_risc' | 'pa-risc') + DIST_ARCH="parisc" + ;; + 'sun4u' | 'sparcv9') + DIST_ARCH="sparc" + ;; + '9000/800') + DIST_ARCH="parisc" + ;; + esac +fi + +# OSX always places Java in the same location so we can reliably set JAVA_HOME +if [ "$DIST_OS" = "macosx" ] +then + if [ -z "$JAVA_HOME" ]; then + JAVA_HOME="/Library/Java/Home"; export JAVA_HOME + fi +fi + +outputFile() { + if [ -f "$1" ] + then + echo " $1 (Found but not executable.)"; + else + echo " $1" + fi +} + +# Decide on the wrapper binary to use. +# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit +# platforms, if the 64-bit binary exists then the distribution most +# likely wants to use long names. Otherwise, look for the default. +WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" +if [ -x "$WRAPPER_TEST_CMD" ] +then + WRAPPER_CMD="$WRAPPER_TEST_CMD" +else + WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + if [ -x "$WRAPPER_TEST_CMD" ] + then + WRAPPER_CMD="$WRAPPER_TEST_CMD" + else + if [ ! -x "$WRAPPER_CMD" ] + then + echo "Unable to locate any of the following binaries:" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32" + outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64" + outputFile "$WRAPPER_CMD" + exit 1 + fi + fi +fi + +# Build the nice clause +if [ "X$PRIORITY" = "X" ] +then + CMDNICE="" +else + CMDNICE="nice -$PRIORITY" +fi + +# Build the anchor file clause. +if [ "X$IGNORE_SIGNALS" = "X" ] +then + ANCHORPROP= + IGNOREPROP= +else + ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\" + IGNOREPROP=wrapper.ignore_signals=TRUE +fi + +# Build the status file clause. +if [ "X$DETAIL_STATUS" = "X" ] +then + STATUSPROP= +else + STATUSPROP="wrapper.statusfile=\"$STATUSFILE\" wrapper.java.statusfile=\"$JAVASTATUSFILE\"" +fi + +# Build the lock file clause. Only create a lock file if the lock directory exists on this platform. +LOCKPROP= +if [ -d $LOCKDIR ] +then + if [ -w $LOCKDIR ] + then + LOCKPROP=wrapper.lockfile=\"$LOCKFILE\" + fi +fi + +checkUser() { + # $1 touchLock flag + # $2 command + + # Check the configured user. If necessary rerun this script as the desired user. + if [ "X$RUN_AS_USER" != "X" ] + then + # Resolve the location of the 'id' command + IDEXE="/usr/xpg4/bin/id" + if [ ! -x "$IDEXE" ] + then + IDEXE="/usr/bin/id" + if [ ! -x "$IDEXE" ] + then + echo "Unable to locate 'id'." + echo "Please report this message along with the location of the command on your system." + exit 1 + fi + fi + + if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ] + then + # Already running as the configured user. Avoid password prompts by not calling su. + RUN_AS_USER="" + fi + fi + if [ "X$RUN_AS_USER" != "X" ] + then + # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be + # able to create the lock file. The Wrapper will be able to update this file once it + # is created but will not be able to delete it on shutdown. If $2 is defined then + # the lock file should be created for the current command + if [ "X$LOCKPROP" != "X" ] + then + if [ "X$1" != "X" ] + then + # Resolve the primary group + RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1` + if [ "X$RUN_AS_GROUP" = "X" ] + then + RUN_AS_GROUP=$RUN_AS_USER + fi + touch $LOCKFILE + chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE + fi + fi + + # Still want to change users, recurse. This means that the user will only be + # prompted for a password once. Variables shifted by 1 + # + # Use "runuser" if this exists. runuser should be used on RedHat in preference to su. + # + if test -f "/sbin/runuser" + then + /sbin/runuser - $RUN_AS_USER -c "\"$REALPATH\" $2" + else + su - $RUN_AS_USER -c "\"$REALPATH\" $2" + fi + + # Now that we are the original user again, we may need to clean up the lock file. + if [ "X$LOCKPROP" != "X" ] + then + getpid + if [ "X$pid" = "X" ] + then + # Wrapper is not running so make sure the lock file is deleted. + if [ -f "$LOCKFILE" ] + then + rm "$LOCKFILE" + fi + fi + fi + + exit 0 + fi +} + +getpid() { + pid="" + if [ -f "$PIDFILE" ] + then + if [ -r "$PIDFILE" ] + then + pid=`cat "$PIDFILE"` + if [ "X$pid" != "X" ] + then + # It is possible that 'a' process with the pid exists but that it is not the + # correct process. This can happen in a number of cases, but the most + # common is during system startup after an unclean shutdown. + # The ps statement below looks for the specific wrapper command running as + # the pid. If it is not found then the pid file is considered to be stale. + case "$DIST_OS" in + 'macosx') + pidtest=`$PSEXE -ww -p $pid -o command | grep "$WRAPPER_CMD" | tail -1` + ;; + *) + pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1` + ;; + esac + + if [ "X$pidtest" = "X" ] + then + # This is a stale pid file. + rm -f "$PIDFILE" + echo "Removed stale pid file: $PIDFILE" + pid="" + fi + fi + else + echo "Cannot read $PIDFILE." + exit 1 + fi + fi +} + +getstatus() { + STATUS= + if [ -f "$STATUSFILE" ] + then + if [ -r "$STATUSFILE" ] + then + STATUS=`cat "$STATUSFILE"` + fi + fi + if [ "X$STATUS" = "X" ] + then + STATUS="Unknown" + fi + + JAVASTATUS= + if [ -f "$JAVASTATUSFILE" ] + then + if [ -r "$JAVASTATUSFILE" ] + then + JAVASTATUS=`cat "$JAVASTATUSFILE"` + fi + fi + if [ "X$JAVASTATUS" = "X" ] + then + JAVASTATUS="Unknown" + fi +} + +testpid() { + pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1` + if [ "X$pid" = "X" ] + then + # Process is gone so remove the pid file. + rm -f "$PIDFILE" + pid="" + fi +} + +console() { + echo "Running $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" $ANCHORPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi +} + +start() { + echo -n "Starting $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + # The string passed to eval must handles spaces in paths correctly. + COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=\"$APP_NAME\" wrapper.pidfile=\"$PIDFILE\" wrapper.name=\"$APP_NAME\" wrapper.displayname=\"$APP_LONG_NAME\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $STATUSPROP $LOCKPROP" + eval $COMMAND_LINE + else + echo "$APP_LONG_NAME is already running." + exit 1 + fi + + # Sleep for a few seconds to allow for intialization if required + # then test to make sure we're still running. + # + i=0 + while [ $i -lt $WAIT_AFTER_STARTUP ] + do + sleep 1 + echo -n "." + i=`expr $i + 1` + done + if [ $WAIT_AFTER_STARTUP -gt 0 ] + then + getpid + if [ "X$pid" = "X" ] + then + echo " WARNING: $APP_LONG_NAME may have failed to start." + exit 1 + else + echo " running ($pid)." + fi + else + echo "" + fi +} + +stopit() { + echo "Stopping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + if [ "X$IGNORE_SIGNALS" = "X" ] + then + # Running so try to stop it. + kill $pid + if [ $? -ne 0 ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + else + rm -f "$ANCHORFILE" + if [ -f "$ANCHORFILE" ] + then + # An explanation for the failure should have been given + echo "Unable to stop $APP_LONG_NAME." + exit 1 + fi + fi + + # We can not predict how long it will take for the wrapper to + # actually stop as it depends on settings in wrapper.conf. + # Loop until it does. + savepid=$pid + CNT=0 + TOTCNT=0 + while [ "X$pid" != "X" ] + do + # Show a waiting message every 5 seconds. + if [ "$CNT" -lt "5" ] + then + CNT=`expr $CNT + 1` + else + echo "Waiting for $APP_LONG_NAME to exit..." + CNT=0 + fi + TOTCNT=`expr $TOTCNT + 1` + + sleep 1 + + testpid + done + + pid=$savepid + testpid + if [ "X$pid" != "X" ] + then + echo "Failed to stop $APP_LONG_NAME." + exit 1 + else + echo "Stopped $APP_LONG_NAME." + fi + fi +} + +status() { + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME is not running." + exit 1 + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "$APP_LONG_NAME is running (PID:$pid)." + else + getstatus + echo "$APP_LONG_NAME is running (PID:$pid, Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + exit 0 + fi +} + +dump() { + echo "Dumping $APP_LONG_NAME..." + getpid + if [ "X$pid" = "X" ] + then + echo "$APP_LONG_NAME was not running." + else + kill -3 $pid + + if [ $? -ne 0 ] + then + echo "Failed to dump $APP_LONG_NAME." + exit 1 + else + echo "Dumped $APP_LONG_NAME." + fi + fi +} + +# Used by HP-UX init scripts. +startmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Starting $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Starting $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +# Used by HP-UX init scripts. +stopmsg() { + getpid + if [ "X$pid" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Stopped)" + else + if [ "X$DETAIL_STATUS" = "X" ] + then + echo "Stopping $APP_LONG_NAME... (Wrapper:Running)" + else + getstatus + echo "Stopping $APP_LONG_NAME... (Wrapper:$STATUS, Java:$JAVASTATUS)" + fi + fi +} + +case "$1" in + + 'console') + checkUser touchlock $1 + console + ;; + + 'start') + checkUser touchlock $1 + start + ;; + + 'stop') + checkUser "" $1 + stopit + ;; + + 'restart') + checkUser touchlock $1 + stopit + start + ;; + + 'status') + checkUser "" $1 + status + ;; + + 'dump') + checkUser "" $1 + dump + ;; + + 'start_msg') + checkUser "" $1 + startmsg + ;; + + 'stop_msg') + checkUser "" $1 + stopmsg + ;; + + *) + echo "Usage: $0 { console | start | stop | restart | status | dump }" + exit 1 + ;; +esac + +exit 0 diff --git a/sonar-application/src/main/assembly/bin/solaris-x86-64/wrapper b/sonar-application/src/main/assembly/bin/solaris-x86-64/wrapper Binary files differnew file mode 100755 index 00000000000..d205143d4de --- /dev/null +++ b/sonar-application/src/main/assembly/bin/solaris-x86-64/wrapper diff --git a/sonar-application/src/main/assembly/bin/windows-x86-32/InstallNTService.bat b/sonar-application/src/main/assembly/bin/windows-x86-32/InstallNTService.bat new file mode 100755 index 00000000000..0fafd9762a8 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/windows-x86-32/InstallNTService.bat @@ -0,0 +1,59 @@ +@echo off
+setlocal
+
+rem Copyright (c) 1999, 2008 Tanuki Software, Inc.
+rem http://www.tanukisoftware.com
+rem All rights reserved.
+rem
+rem This software is the confidential and proprietary information
+rem of Tanuki Software. ("Confidential Information"). You shall
+rem not disclose such Confidential Information and shall use it
+rem only in accordance with the terms of the license agreement you
+rem entered into with Tanuki Software.
+rem
+rem Java Service Wrapper general NT service install script.
+rem Optimized for use with version 3.3.0 of the Wrapper.
+rem
+
+if "%OS%"=="Windows_NT" goto nt
+echo This script only works with NT-based versions of Windows.
+goto :eof
+
+:nt
+rem
+rem Find the application home.
+rem
+rem %~dp0 is location of current script under NT
+set _REALPATH=%~dp0
+
+rem Decide on the wrapper binary.
+set _WRAPPER_BASE=wrapper
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
+if exist "%_WRAPPER_EXE%" goto conf
+echo Unable to locate a Wrapper executable using any of the following names:
+echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
+echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
+echo %_REALPATH%%_WRAPPER_BASE%.exe
+pause
+goto :eof
+
+rem
+rem Find the wrapper.conf
+rem
+:conf
+set _WRAPPER_CONF="%~f1"
+if not %_WRAPPER_CONF%=="" goto startup
+set _WRAPPER_CONF="%_REALPATH%..\..\conf\wrapper.conf"
+
+rem
+rem Install the Wrapper as an NT service.
+rem
+:startup
+"%_WRAPPER_EXE%" -i %_WRAPPER_CONF%
+if not errorlevel 1 goto :eof
+pause
+
diff --git a/sonar-application/src/main/assembly/bin/windows-x86-32/StartNTService.bat b/sonar-application/src/main/assembly/bin/windows-x86-32/StartNTService.bat new file mode 100755 index 00000000000..2899cf12c10 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/windows-x86-32/StartNTService.bat @@ -0,0 +1,59 @@ +@echo off
+setlocal
+
+rem Copyright (c) 1999, 2008 Tanuki Software, Inc.
+rem http://www.tanukisoftware.com
+rem All rights reserved.
+rem
+rem This software is the confidential and proprietary information
+rem of Tanuki Software. ("Confidential Information"). You shall
+rem not disclose such Confidential Information and shall use it
+rem only in accordance with the terms of the license agreement you
+rem entered into with Tanuki Software.
+rem
+rem Java Service Wrapper general NT service start script.
+rem Optimized for use with version 3.3.0 of the Wrapper.
+rem
+
+if "%OS%"=="Windows_NT" goto nt
+echo This script only works with NT-based versions of Windows.
+goto :eof
+
+:nt
+rem
+rem Find the application home.
+rem
+rem %~dp0 is location of current script under NT
+set _REALPATH=%~dp0
+
+rem Decide on the wrapper binary.
+set _WRAPPER_BASE=wrapper
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
+if exist "%_WRAPPER_EXE%" goto conf
+echo Unable to locate a Wrapper executable using any of the following names:
+echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
+echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
+echo %_REALPATH%%_WRAPPER_BASE%.exe
+pause
+goto :eof
+
+rem
+rem Find the wrapper.conf
+rem
+:conf
+set _WRAPPER_CONF="%~f1"
+if not %_WRAPPER_CONF%=="" goto startup
+set _WRAPPER_CONF="%_REALPATH%..\..\conf\wrapper.conf"
+
+rem
+rem Start the Wrapper NT service.
+rem
+:startup
+"%_WRAPPER_EXE%" -t %_WRAPPER_CONF%
+if not errorlevel 1 goto :eof
+pause
+
diff --git a/sonar-application/src/main/assembly/bin/windows-x86-32/StartSonar.bat b/sonar-application/src/main/assembly/bin/windows-x86-32/StartSonar.bat new file mode 100755 index 00000000000..cf3ee969c9a --- /dev/null +++ b/sonar-application/src/main/assembly/bin/windows-x86-32/StartSonar.bat @@ -0,0 +1,64 @@ +@echo off
+setlocal
+
+rem Copyright (c) 1999, 2008 Tanuki Software, Inc.
+rem http://www.tanukisoftware.com
+rem All rights reserved.
+rem
+rem This software is the confidential and proprietary information
+rem of Tanuki Software. ("Confidential Information"). You shall
+rem not disclose such Confidential Information and shall use it
+rem only in accordance with the terms of the license agreement you
+rem entered into with Tanuki Software.
+rem
+rem Java Service Wrapper general startup script.
+rem Optimized for use with version 3.3.0 of the Wrapper.
+rem
+
+rem
+rem Resolve the real path of the wrapper.exe
+rem For non NT systems, the _REALPATH and _WRAPPER_CONF values
+rem can be hard-coded below and the following test removed.
+rem
+if "%OS%"=="Windows_NT" goto nt
+echo This script only works with NT-based versions of Windows.
+goto :eof
+
+:nt
+rem
+rem Find the application home.
+rem
+rem %~dp0 is location of current script under NT
+set _REALPATH=%~dp0
+
+rem Decide on the wrapper binary.
+set _WRAPPER_BASE=wrapper
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
+if exist "%_WRAPPER_EXE%" goto conf
+echo Unable to locate a Wrapper executable using any of the following names:
+echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
+echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
+echo %_REALPATH%%_WRAPPER_BASE%.exe
+pause
+goto :eof
+
+rem
+rem Find the wrapper.conf
+rem
+:conf
+set _WRAPPER_CONF="%~f1"
+if not %_WRAPPER_CONF%=="" goto startup
+set _WRAPPER_CONF="%_REALPATH%..\..\conf\wrapper.conf"
+
+rem
+rem Start the Wrapper
+rem
+:startup
+"%_WRAPPER_EXE%" -c %_WRAPPER_CONF%
+if not errorlevel 1 goto :eof
+pause
+
diff --git a/sonar-application/src/main/assembly/bin/windows-x86-32/StopNTService.bat b/sonar-application/src/main/assembly/bin/windows-x86-32/StopNTService.bat new file mode 100755 index 00000000000..7899a150c6d --- /dev/null +++ b/sonar-application/src/main/assembly/bin/windows-x86-32/StopNTService.bat @@ -0,0 +1,59 @@ +@echo off
+setlocal
+
+rem Copyright (c) 1999, 2008 Tanuki Software, Inc.
+rem http://www.tanukisoftware.com
+rem All rights reserved.
+rem
+rem This software is the confidential and proprietary information
+rem of Tanuki Software. ("Confidential Information"). You shall
+rem not disclose such Confidential Information and shall use it
+rem only in accordance with the terms of the license agreement you
+rem entered into with Tanuki Software.
+rem
+rem Java Service Wrapper general NT service stop script.
+rem Optimized for use with version 3.3.0 of the Wrapper.
+rem
+
+if "%OS%"=="Windows_NT" goto nt
+echo This script only works with NT-based versions of Windows.
+goto :eof
+
+:nt
+rem
+rem Find the application home.
+rem
+rem %~dp0 is location of current script under NT
+set _REALPATH=%~dp0
+
+rem Decide on the wrapper binary.
+set _WRAPPER_BASE=wrapper
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
+if exist "%_WRAPPER_EXE%" goto conf
+echo Unable to locate a Wrapper executable using any of the following names:
+echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
+echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
+echo %_REALPATH%%_WRAPPER_BASE%.exe
+pause
+goto :eof
+
+rem
+rem Find the wrapper.conf
+rem
+:conf
+set _WRAPPER_CONF="%~f1"
+if not %_WRAPPER_CONF%=="" goto startup
+set _WRAPPER_CONF="%_REALPATH%..\..\conf\wrapper.conf"
+
+rem
+rem Stop the Wrapper NT service.
+rem
+:startup
+"%_WRAPPER_EXE%" -p %_WRAPPER_CONF%
+if not errorlevel 1 goto :eof
+pause
+
diff --git a/sonar-application/src/main/assembly/bin/windows-x86-32/UninstallNTService.bat b/sonar-application/src/main/assembly/bin/windows-x86-32/UninstallNTService.bat new file mode 100755 index 00000000000..e4d82763e98 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/windows-x86-32/UninstallNTService.bat @@ -0,0 +1,59 @@ +@echo off
+setlocal
+
+rem Copyright (c) 1999, 2008 Tanuki Software, Inc.
+rem http://www.tanukisoftware.com
+rem All rights reserved.
+rem
+rem This software is the confidential and proprietary information
+rem of Tanuki Software. ("Confidential Information"). You shall
+rem not disclose such Confidential Information and shall use it
+rem only in accordance with the terms of the license agreement you
+rem entered into with Tanuki Software.
+rem
+rem Java Service Wrapper general NT service uninstall script.
+rem Optimized for use with version 3.3.0 of the Wrapper.
+rem
+
+if "%OS%"=="Windows_NT" goto nt
+echo This script only works with NT-based versions of Windows.
+goto :eof
+
+:nt
+rem
+rem Find the application home.
+rem
+rem %~dp0 is location of current script under NT
+set _REALPATH=%~dp0
+
+rem Decide on the wrapper binary.
+set _WRAPPER_BASE=wrapper
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_REALPATH%%_WRAPPER_BASE%.exe
+if exist "%_WRAPPER_EXE%" goto conf
+echo Unable to locate a Wrapper executable using any of the following names:
+echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
+echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
+echo %_REALPATH%%_WRAPPER_BASE%.exe
+pause
+goto :eof
+
+rem
+rem Find the wrapper.conf
+rem
+:conf
+set _WRAPPER_CONF="%~f1"
+if not %_WRAPPER_CONF%=="" goto startup
+set _WRAPPER_CONF="%_REALPATH%..\..\conf\wrapper.conf"
+
+rem
+rem Uninstall the Wrapper as an NT service.
+rem
+:startup
+"%_WRAPPER_EXE%" -r %_WRAPPER_CONF%
+if not errorlevel 1 goto :eof
+pause
+
diff --git a/sonar-application/src/main/assembly/bin/windows-x86-32/lib/wrapper.dll b/sonar-application/src/main/assembly/bin/windows-x86-32/lib/wrapper.dll Binary files differnew file mode 100644 index 00000000000..c2ec8365a55 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/windows-x86-32/lib/wrapper.dll diff --git a/sonar-application/src/main/assembly/bin/windows-x86-32/wrapper.exe b/sonar-application/src/main/assembly/bin/windows-x86-32/wrapper.exe Binary files differnew file mode 100644 index 00000000000..be825573f68 --- /dev/null +++ b/sonar-application/src/main/assembly/bin/windows-x86-32/wrapper.exe diff --git a/sonar-application/src/main/assembly/conf/derby.properties b/sonar-application/src/main/assembly/conf/derby.properties new file mode 100644 index 00000000000..7975ccd2272 --- /dev/null +++ b/sonar-application/src/main/assembly/conf/derby.properties @@ -0,0 +1 @@ +#put your derby properties here to overide the default config
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/conf/logback.xml b/sonar-application/src/main/assembly/conf/logback.xml new file mode 100644 index 00000000000..551ae9806b5 --- /dev/null +++ b/sonar-application/src/main/assembly/conf/logback.xml @@ -0,0 +1,106 @@ +<?xml version="1.0" encoding="UTF-8" ?> + +<configuration debug="false"> + + <!-- appender used when deploying Sonar WAR on a JEE server --> + <appender name="SONAR_WAR" class="ch.qos.logback.core.ConsoleAppender"> + <!-- avoid to log 404 file not found messages from the rails file servlet --> + <filter class="ch.qos.logback.core.filter.EvaluatorFilter"> + <evaluator name="mavenRepoFileNotFound"> + <expression>message.startsWith("files: File not found: /maven")</expression> + </evaluator> + <OnMismatch>NEUTRAL</OnMismatch> + <OnMatch>DENY</OnMatch> + </filter> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern> + %d{yyyy.MM.dd HH:mm:ss} %-5level %logger{20} %X %msg%n + </pattern> + </layout> + </appender> + + <!-- appender used when using sonar with the provided jetty web container --> + <appender name="SONAR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <File>../../logs/sonar.log</File> + <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <param name="FileNamePattern" value="../../logs/sonar.%i.log"/> + <param name="MinIndex" value="1"/> + <param name="MaxIndex" value="3"/> + </rollingPolicy> + <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <param name="MaxFileSize" value="5MB"/> + </triggeringPolicy> + <filter class="ch.qos.logback.core.filter.EvaluatorFilter"> + <evaluator name="mavenRepoFileNotFound"> + <expression>message.startsWith("files: File not found: /maven")</expression> + </evaluator> + <OnMismatch>NEUTRAL</OnMismatch> + <OnMatch>DENY</OnMatch> + </filter> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern> + %d{yyyy.MM.dd HH:mm:ss} %-5level %logger{20} %X %msg%n + </pattern> + </layout> + </appender> + + <!-- appender used to profile Sonar Web Server --> + <appender name="PROFILING_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> + <File>../../logs/profiling.log</File> + <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> + <param name="FileNamePattern" value="../../logs/profiling.%i.log"/> + <param name="MinIndex" value="1"/> + <param name="MaxIndex" value="3"/> + </rollingPolicy> + <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> + <param name="MaxFileSize" value="5MB"/> + </triggeringPolicy> + <layout class="ch.qos.logback.classic.PatternLayout"> + <pattern> + %d{yyyy.MM.dd HH:mm:ss} %-5level %logger{20} %X %msg%n + </pattern> + </layout> + </appender> + + <!-- + Profiling of JRuby on Rails requests . Uncomment in order to log HTTP and SQL requests. + Execute the following command to get the HTTP requests with execution time > 10s : + grep 'rails Completed in [0-9]\{5,\}ms' < profiling.log + --> + <!-- + <logger name="rails" additivity="false"> + <level value="DEBUG"/> + <appender-ref ref="PROFILING_FILE"/> + </logger> + --> + + + <logger name="org.hibernate.cache.ReadWriteCache"> + <!-- removing "An item was expired by the cache while it was locked (increase your cache timeout)" msg --> + <level value="ERROR"/> + </logger> + <logger name="org.hibernate.cache.EhCacheProvider"> + <!-- removing "org.hibernate.cache.EhCacheProvider - Could not find configuration)" message --> + <level value="ERROR"/> + </logger> + + <!-- set INFO to activate Hibernate SQL logs. NOT RECOMMENDED --> + <logger name="org.hibernate.SQL"> + <level value="ERROR"/> + </logger> + + <!-- set INFO to activate Hibernate SQL statistics. NOT RECOMMENDED --> + <logger name="org.sonar.DBSTATISTICS"> + <level value="ERROR"/> + </logger> + + <logger name="org.sonar.INFO"> + <level value="INFO"/> + </logger> + + <root> + <level value="WARN"/> + <appender-ref ref="SONAR_FILE"/> + </root> + +</configuration>
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/conf/sonar.properties b/sonar-application/src/main/assembly/conf/sonar.properties new file mode 100644 index 00000000000..8b6d04019c0 --- /dev/null +++ b/sonar-application/src/main/assembly/conf/sonar.properties @@ -0,0 +1,104 @@ +#-------------------------------------------------------- +# To use an environment variable, use the following syntax : ${env:NAME_OF_ENV_VARIABLE} +# For example : +# sonar.jdbc.url: ${env:SONAR_JDBC_URL} +# +# +# See also the file conf/wrapper.conf for JVM advanced settings +#--------------------------------------------------------- + + +#--------------------------------------------------------- +# WEB SETTINGS - STANDALONE MODE ONLY +# These settings are ignored when the war file is deployed to a JEE server. +#--------------------------------------------------------- +# Listen host/port and context path (for example / or /sonar). Default values are 0.0.0.0:9000/. +#sonar.web.host: 0.0.0.0 +#sonar.web.port: 9000 +#sonar.web.context: / + +# Log HTTP requests. Deactivated by default. +#sonar.web.jettyRequestLogs: ../../logs/jetty-yyyy_mm_dd.request.log + +# Apache mod_jk connector. Supported only in standalone mode. +# Uncomment to activate AJP13 connector. +#sonar.ajp13.port: 8009 + + +#--------------------------------------------------------- +# DATABASE +# +# IMPORTANT : the embedded database Derby is used by default. +# It is recommended for tests only. Please use an other database +# for production environment (MySQL, Oracle, Postgresql, +# SQLServer) +# +#--------------------------------------------------------- + +#----- Embedded database Derby +# Note : it does accept connections from remote hosts, so the +# sonar server and the maven plugin must be executed on the same host. + +# Comment the 3 following lines to deactivate the default embedded database +sonar.jdbc.url: jdbc:derby://localhost:1527/sonar;create=true +sonar.jdbc.driverClassName: org.apache.derby.jdbc.ClientDriver +sonar.jdbc.validationQuery: values(1) +# directory containing Derby database files. By default it's the /data directory in the sonar installation. +#sonar.embeddedDatabase.dataDir: +# derby embedded database server listening port, defaults to 1527 +#sonar.derby.drda.portNumber: 1527 + +#----- MySQL 5.x/6.x +# Comment the embedded database and uncomment the following lines to use MySQL +#sonar.jdbc.url: jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8 +#sonar.jdbc.driverClassName: com.mysql.jdbc.Driver +#sonar.jdbc.validationQuery: select 1 + + +#----- Oracle 10g/11g +# Comment the embedded database and uncomment the following lines to use Oracle +#sonar.jdbc.url: jdbc:oracle:thin:@localhost/XE +#sonar.jdbc.driverClassName: oracle.jdbc.driver.OracleDriver +#sonar.jdbc.validationQuery: select 1 from dual + +# Activate if more than one Sonar Oracle schemas on the data server (for example different versions installed). +# In that case, use the same property during maven analysis (-Dsonar.hibernate.default_schema=xxx) +#sonar.hibernate.default_schema: sonar + +#----- PostgreSQL 8.x +# uncomment the 3 following lines to use PostgreSQL +#sonar.jdbc.url: jdbc:postgresql://localhost/sonar +#sonar.jdbc.driverClassName: org.postgresql.Driver +#sonar.jdbc.validationQuery: select 1 + + +#----- Microsoft SQLServer +# The Jtds open source driver is available in extensions/jdbc-driver/mssql. More details on http://jtds.sourceforge. +#sonar.jdbc.url: jdbc:jtds:sqlserver://localhost;databaseName=SONAR;SelectMethod=Cursor +#sonar.jdbc.driverClassName: net.sourceforge.jtds.jdbc.Driver +#sonar.jdbc.validationQuery: select 1 + + +#----- Global database settings +sonar.jdbc.username: sonar +sonar.jdbc.password: sonar +sonar.jdbc.maxActive: 10 +sonar.jdbc.maxIdle: 5 +sonar.jdbc.minIdle: 2 +sonar.jdbc.maxWait: 5000 +sonar.jdbc.minEvictableIdleTimeMillis: 600000 +sonar.jdbc.timeBetweenEvictionRunsMillis: 30000 + +# Transaction isolation level. Default driver setting is used by default. +# Values : 1 (TRANSACTION_READ_UNCOMMITED), 2 (TRANSACTION_READ_COMMITTED), 4 (TRANSACTION_REPEATABLE_READ), 8 (TRANSACTION_SERIALIZABLE) +#sonar.jdbc.defaultTransactionIsolation: 2 + + +# When packaged in a WAR, JDBC datasource can be configured into the application server then registered to JNDI. +# In such a case Sonar uses this datasource to connect to database, else if binds itself its own datasource. +# Note : Jonas does not accept to bind subcontexts, so name should be something like 'jdbc-sonar', without slashes. +#sonar.jdbc.jndiName: jdbc/sonar + +# If you don't use the default JDBC drivers, as listed above, then you have to explicitly set the dialect to use. +# Values are : mysql, derby, oracle, postgresql +#sonar.jdbc.dialect= diff --git a/sonar-application/src/main/assembly/conf/wrapper.conf b/sonar-application/src/main/assembly/conf/wrapper.conf new file mode 100644 index 00000000000..c7bab885485 --- /dev/null +++ b/sonar-application/src/main/assembly/conf/wrapper.conf @@ -0,0 +1,128 @@ +# Java Additional Parameters
+wrapper.java.additional.1=-Djava.awt.headless=true
+wrapper.java.additional.2=-XX:MaxPermSize=128m
+
+# RECOMMENDED : uncomment if Java Virtual Machine is a JDK but not a JRE. To know which JVM you use, execute
+# 'java -version'. JDK displays 'Server VM'.
+# wrapper.java.additional.3=-server
+
+# Initial Java Heap Size (in MB)
+wrapper.java.initmemory=256
+
+# Maximum Java Heap Size (in MB)
+wrapper.java.maxmemory=512
+
+#********************************************************************
+# Wrapper Java Properties
+#********************************************************************
+# JVM
+# Can be an absolute path, for example:
+#wrapper.java.command=/path/to/my/jdk/bin/java
+wrapper.java.command=java
+
+# Java Main class. This class must implement the WrapperListener interface
+# or guarantee that the WrapperManager class is initialized. Helper
+# classes are provided to do this for you. See the Integration section
+# of the documentation for details.
+wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
+
+# Java Classpath (include wrapper.jar) Add class path elements as
+# needed starting from 1
+wrapper.java.classpath.1=../../lib/*.jar
+wrapper.java.classpath.2=../../
+wrapper.java.classpath.3=../../extensions/jdbc-driver/derby/*.jar
+wrapper.java.classpath.4=../../extensions/jdbc-driver/mysql/*.jar
+wrapper.java.classpath.5=../../extensions/jdbc-driver/oracle/*.jar
+wrapper.java.classpath.6=../../extensions/jdbc-driver/postgresql/*.jar
+wrapper.java.classpath.7=../../extensions/jdbc-driver/mssql/*.jar
+
+# Java Library Path (location of Wrapper.DLL or libwrapper.so)
+wrapper.java.library.path.1=./lib
+
+# Application parameters. Add parameters as needed starting from 1
+wrapper.app.parameter.1=org.sonar.application.StartServer
+
+#********************************************************************
+# Profiling and debbuging - for development only
+# If wrapper.java.additional.3=-server is not commented, parameter ids should start from 4 instead of 3.
+#********************************************************************
+# Java remote debugging
+#wrapper.java.additional.3=-agentlib:jdwp=transport=dt_socket,server=y,address=8000
+
+# JProfiler 5
+#wrapper.java.additional.3=-Xint
+#wrapper.java.additional.4=-agentlib:jprofilerti=port=8849
+#wrapper.java.additional.5=-Xbootclasspath/a:/Applications/jprofiler5/bin/agent.jar
+
+# JMX remote monitoring on Sun JVM (warning, security is disabled)
+#wrapper.java.additional.3=-Dcom.sun.management.jmxremote
+#wrapper.java.additional.4=-Dcom.sun.management.jmxremote.port=9005
+#wrapper.java.additional.5=-Dcom.sun.management.jmxremote.authenticate=false
+#wrapper.java.additional.6=-Dcom.sun.management.jmxremote.ssl=false
+
+#********************************************************************
+# Wrapper Logging Properties
+#********************************************************************
+# Format of output for the console. (See docs for formats)
+wrapper.console.format=PM
+
+# Log Level for console output. (See docs for log levels)
+wrapper.console.loglevel=NONE
+
+# Log file to use for wrapper output logging.
+wrapper.logfile=../../logs/sonar.log
+
+# Format of output for the log file. (See docs for formats)
+wrapper.logfile.format=LPTM
+
+# Log Level for log file output. (See docs for log levels)
+wrapper.logfile.loglevel=INFO
+
+# Maximum size that the log file will be allowed to grow to before
+# the log is rolled. Size is specified in bytes. The default value
+# of 0, disables log rolling. May abbreviate with the 'k' (kb) or
+# 'm' (mb) suffix. For example: 10m = 10 megabytes.
+#wrapper.logfile.maxsize=0
+
+# Maximum number of rolled log files which will be allowed before old
+# files are deleted. The default value of 0 implies no limit.
+#wrapper.logfile.maxfiles=0
+
+# Log Level for sys/event log output. (See docs for log levels)
+wrapper.syslog.loglevel=NONE
+
+#********************************************************************
+# Wrapper Windows Properties
+#********************************************************************
+# Title to use when running as a console
+wrapper.console.title=Sonar
+
+#********************************************************************
+# Wrapper Windows NT/2000/XP Service Properties
+#********************************************************************
+# WARNING - Do not modify any of these properties when an application
+# using this configuration file has been installed as a service.
+# Please uninstall the service before modifying this section. The
+# service can then be reinstalled.
+
+# Name of the service
+wrapper.ntservice.name=Sonar
+
+# Display name of the service
+wrapper.ntservice.displayname=Sonar
+
+# Description of the service
+wrapper.ntservice.description=Sonar
+
+# Service dependencies. Add dependencies as needed starting from 1
+wrapper.ntservice.dependency.1=
+
+# Mode in which the service is installed. AUTO_START or DEMAND_START
+wrapper.ntservice.starttype=AUTO_START
+
+# Allow the service to interact with the desktop.
+wrapper.ntservice.interactive=false
+
+#********************************************************************
+# restart the process if CPU is heavily loaded during 240 seconds.
+wrapper.ping.timeout=240
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/data/README.txt b/sonar-application/src/main/assembly/data/README.txt new file mode 100644 index 00000000000..33f6f17c338 --- /dev/null +++ b/sonar-application/src/main/assembly/data/README.txt @@ -0,0 +1 @@ +This directory contains data of embedded database (Apache Derby). It's recommended for tests and demos only.
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/extensions/plugins/README.txt b/sonar-application/src/main/assembly/extensions/plugins/README.txt new file mode 100644 index 00000000000..f15b6836387 --- /dev/null +++ b/sonar-application/src/main/assembly/extensions/plugins/README.txt @@ -0,0 +1,3 @@ +Plugins can be downloaded from : +- http://sonar-plugins.codehaus.org +- http://www.sonarsource.com/plugins
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/extensions/rules/checkstyle/README.txt b/sonar-application/src/main/assembly/extensions/rules/checkstyle/README.txt new file mode 100644 index 00000000000..e13af03fc0d --- /dev/null +++ b/sonar-application/src/main/assembly/extensions/rules/checkstyle/README.txt @@ -0,0 +1 @@ +Checkstyle extensions. See http://docs.codehaus.org/display/SONAR/Extend+coding+rules
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/extensions/rules/pmd/README.txt b/sonar-application/src/main/assembly/extensions/rules/pmd/README.txt new file mode 100644 index 00000000000..91aa43380e6 --- /dev/null +++ b/sonar-application/src/main/assembly/extensions/rules/pmd/README.txt @@ -0,0 +1 @@ +PMD extensions. See http://docs.codehaus.org/display/SONAR/Extend+coding+rules
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/extras/database/mysql/create_database.sql b/sonar-application/src/main/assembly/extras/database/mysql/create_database.sql new file mode 100644 index 00000000000..5e7533f2ee1 --- /dev/null +++ b/sonar-application/src/main/assembly/extras/database/mysql/create_database.sql @@ -0,0 +1,12 @@ +# +# Create Sonar database and user. +# +# Command: mysql -u root -p < create_database.sql +# + +CREATE DATABASE sonar CHARACTER SET utf8 COLLATE utf8_general_ci; + +CREATE USER 'sonar' IDENTIFIED BY 'sonar'; +GRANT ALL ON sonar.* TO 'sonar'@'%' IDENTIFIED BY 'sonar'; +GRANT ALL ON sonar.* TO 'sonar'@'localhost' IDENTIFIED BY 'sonar'; +FLUSH PRIVILEGES;
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/extras/database/mysql/drop_database.sql b/sonar-application/src/main/assembly/extras/database/mysql/drop_database.sql new file mode 100644 index 00000000000..254f3d00822 --- /dev/null +++ b/sonar-application/src/main/assembly/extras/database/mysql/drop_database.sql @@ -0,0 +1,9 @@ +# +# Drop Sonar database and user. +# +# Command: mysql -u root -p < drop_database.sql +# + +DROP DATABASE IF EXISTS sonar; +DROP USER 'sonar'@'localhost'; +DROP USER 'sonar'@'%'; diff --git a/sonar-application/src/main/assembly/extras/database/mysql/fix_nullable_measure_values.sql b/sonar-application/src/main/assembly/extras/database/mysql/fix_nullable_measure_values.sql new file mode 100644 index 00000000000..f348af54b75 --- /dev/null +++ b/sonar-application/src/main/assembly/extras/database/mysql/fix_nullable_measure_values.sql @@ -0,0 +1,5 @@ +# this script must be executed when the column PROJECT_MEASURES.VALUE is NOT NULL. +# It occurs sometimes when database schema has been created before Sonar 1.8 + +ALTER TABLE sonar.project_measures MODIFY COLUMN value DECIMAL(30,20) DEFAULT NULL; +
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/lib/wrapper.jar b/sonar-application/src/main/assembly/lib/wrapper.jar Binary files differnew file mode 100644 index 00000000000..a61f6b54173 --- /dev/null +++ b/sonar-application/src/main/assembly/lib/wrapper.jar diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/INSTALL b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/INSTALL new file mode 100644 index 00000000000..83c11675a44 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/INSTALL @@ -0,0 +1,2 @@ +For installation instructions see the manual in the docs subdirectory +or online at <http://ant.apache.org/manual/index.html>. diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/KEYS b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/KEYS new file mode 100644 index 00000000000..b4d3bd28bba --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/KEYS @@ -0,0 +1,782 @@ +This file contains the PGP keys of various developers. + +Users: pgp < KEYS + gpg --import KEYS +Developers: + pgp -kxa <your name> and append it to this file. + (pgpk -ll <your name> && pgpk -xa <your name>) >> this file. + (gpg --list-sigs <your name> + && gpg --armor --export <your name>) >> this file. + +Type Bits/KeyID Date User ID +pub 1024/FEECAAED 1998/11/11 Stefan Bodewig <bodewig@bost.de> + Stefan Bodewig <bodewig@apache.org> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: 2.6.3i + +mQCNAzZJoiMAAAEEAMzhUxTOC20Nprp6K4nLTiARt+EXii/dovNWWcfzZcYXi/lX +r3zpUTTZxlKQpd4RaHjFmGgoOraZE4jCRFARVcFJgYmGUKpcWJZO7YKL36WUizTM ++dyB2ycOtzlty1W5VmRL3FGqo67pKA9F/QHg3NSu9hY1W9xPPK7Kq3f+7KrtAAUR +tCBTdGVmYW4gQm9kZXdpZyA8Ym9kZXdpZ0Bib3N0LmRlPokAlQIFEDZSrGXHcgyK +jiW9zQEBshEEAMlG4qVjKp4/agdJG56M6izx9oaKecFLXHQJrFUy3w2PvZHFYtXc +osXKorX6bPrE8uB57MxbY2WapKeVRodlG0+j39vAf501duK8q2rktfWt9Cl4JjJ4 +DbWhSWfV1ci62u2gCxwYQe22F9Wh+vhOR5NK9RTbSKhupdlFsnrk/i7xiQCVAwUQ +NkmiI67Kq3f+7KrtAQGdxQQAlcFOzSv7G6M4uGbgvw7IGgrhx7rawtIyv9hLXgVC +7ua9xaZV8G0Fl9gh8RnbdcZ4R/aT+KIiAFaslfZ3t6hlC4MTbnAJqvdS/NO98ZkJ +YvnzZSKHflAbd5gyE7IVxBC9/xRlF/Wls5sYNwb6RjoRCaOjxN/y3WCLa3Va101v +zNy0I1N0ZWZhbiBCb2Rld2lnIDxib2Rld2lnQGFwYWNoZS5vcmc+iQCVAwUQOxIo +BK7Kq3f+7KrtAQGn6gP/SBACdHakA4H//otpyESSrk4PmyOaYF0Kyok43Gee2mT+ +m9+jZ3jLcC0oav6iH+otL/lhk9t/JDM8LjD2kAkdWWoIvvuPyCx97gOzojIo0Ve2 +1wuxJTF/VIjwyOtE8FzE7p4tkc6EubVpeZkV9Pq9HFRBCUcyKJDLnF4tbstScLU= +=OBLe +-----END PGP PUBLIC KEY BLOCK----- + + +pub 1024D/51898504 2001-05-29 Conor MacNeill <conor@cortexebusiness.com.au> +sig 3 51898504 2001-05-29 Conor MacNeill <conor@cortexebusiness.com.au> +sig 5F6B8B72 2002-01-11 Stefan Bodewig <bodewig@apache.org> +uid Conor MacNeill <conor@apache.org> +sig 3 51898504 2001-05-29 Conor MacNeill <conor@cortexebusiness.com.au> +sig 5F6B8B72 2002-01-11 Stefan Bodewig <bodewig@apache.org> +sub 1024g/D1ECBA5D 2001-05-29 +sig 51898504 2001-05-29 Conor MacNeill <conor@cortexebusiness.com.au> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.0 (GNU/Linux) + +mQGiBDsTqygRBACiZckNdclTlQFonLaIKBFGhMy0KKByw0x8XA4iwdbCXuF6xNIc +HIFHajJ74AHchQ4d8xtomBy6b8yvFgWVeaZensvn69BlLeqGdyeJRzfPt6TgRnzZ +2eWhb0HXdG3JwxL/2BabDhHfs4YJOrgB/vhRFQku6oCMRiBPtJj2werD6wCg0/zp +jacYTw6+CR+sVvneCNyySFED/R3j10c4RnR8djgv1jKT8CKPuHYraupI9INEe+I6 +7qWjtJ02GzvMO6TElAtUsf4aysu45GgwkwEBnuG6mYb3Pq0V2c5tJc2A3Tj3DrdR +i3HUNwurbus76I0sPyyENPu12QPeC6mvWLEsxVJ9o0hRKFayGvYUmrwWK9UFLjvp +p9cXBACDHgLn7MAVLqUdYhRrUj/M+GOUpvBikEgoJJrEUmb5X4+++dffMh5HBIO4 +5LA11qEKuM2xnKqOilP7NLYXz1Fe0ocqv0jsHB4SprFTTai7ma31uwuRQvCQXVv1 +yJ5CLqYda64h/UA2kmmR2dfopmvDogYEMz/HU5voozxe7BEI7bQhQ29ub3IgTWFj +TmVpbGwgPGNvbm9yQGFwYWNoZS5vcmc+iFcEExECABcFAjsTqygFCwcKAwQDFQMC +AxYCAQIXgAAKCRCBBGRPUYmFBDgIAKCZztXqKhK6kXOnoGy7opCNmWU0lwCgsPDa +4m+ruW3ch0rfbqtR75S52R+IRgQQEQIABgUCPD6eTgAKCRCiEVrhX2uLcqCcAKCr +1Wylqju9YjBi5Twej9ze69JFBQCeOaMgo6yjnkcV3PnVInLlaMwPr5q0LUNvbm9y +IE1hY05laWxsIDxjb25vckBjb3J0ZXhlYnVzaW5lc3MuY29tLmF1PohXBBMRAgAX +BQI7E6xMBQsHCgMEAxUDAgMWAgECF4AACgkQgQRkT1GJhQTY0ACgmZmKheHzjPJs +5hybpyvnvEiPYqYAn2+ryxdtz8XyOMExGRmHNlhG7svsiEYEEBECAAYFAjw+nlUA +CgkQohFa4V9ri3JYYACg1WN+NCptfKVP1mbrIa+0ajztsiIAnAn+m70iwRRFZCxr +jcULoY5SjyTLuQENBDsTqy0QBACfsCxJ6iCtgX8zjlVtMsMfDqu72x5sYatWKn8c +u+4Oj5mi0x6azZIhwCa+K3ihLVOyG1mCRnzztGTIxWYRhq3TESIVOfgm+NgLGrmA +XUTFyCT+21TExLCpuVZKmUHsWXLxDtfQ1diPeQpiQ8+Fvb/4jLGFjFIrQ2VjtFQn +kumkSwADBgP9H0bF4hdMuVEcSJ9imxSoJshcOOA3Vd2+YiCTZhBygWM49wY5jNos +/DArIjNCE53IlOu/UtHB2jqkSqjF0soGYsUjeCWouiTP9hLuMKPjnqj9ryJPTDKz +nTCZ4TuB5CtzrKTlWLmPCPpFsGqe4KjMeKg/mqGqjPKl97xgStK9N9GIRgQYEQIA +BgUCOxOrLQAKCRCBBGRPUYmFBMM6AJsF3FFyZGEmbt9aGG1W/u0oI9mcLgCfQyJ+ +aalbspazea4J9zgi59SSwOM= +=cBdR +-----END PGP PUBLIC KEY BLOCK----- + +pub 1024R/697ECEDD 2000-04-06 Henri Gomez <hgomez@slib.fr> +sig 697ECEDD 2000-04-06 Henri Gomez <hgomez@slib.fr> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.0 (GNU/Linux) + +mQCNAzjsydwAAAEEAMpwFU/ci3/wR3ryCGp9Exr+Rx/hTQ7hWAJcVw8ejlBXlT4T +yITlRUs0HGfRWxME2J55PuXXsIEPZzjfozNtvOyq8WlLlJ7iaiyWxVRoPJ25sSEj +C9etm6wjj4E66ZgzuElZkm1m69uEsCHPPNuz1oQ/g1O+SmIVxIYirlxpfs7dAAUR +tBxIZW5yaSBHb21leiA8aGdvbWV6QHNsaWIuZnI+iQCVAwUQOOzJ3IYirlxpfs7d +AQFQyQQAj0D9G0hEL7SQGaSCkkoXwvamQw42N8+tNm+jfWHWdE4HAiVlhJmI2GyD +sdcXVAcR8R7ILIRB5AY7a3bF+qMk0r+vO6oR878RKKn9AvtaAIOnrh6tr0tiPwf5 +XDUMySxIWJEF3SmJAy9Lq3bAl5GMzZCFHiS0NW2gtWgmr/u1RuM= +=6l+I +-----END PGP PUBLIC KEY BLOCK----- + +pub 1024R/397DCAD5 2002-07-03 Henri Gomez <hgomez@users.sourceforge.net> +sig 397DCAD5 2002-07-03 Henri Gomez <hgomez@users.sourceforge.net> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.0 (GNU/Linux) + +mQCNAz0i0UUAAAEEALXePN6IHne0W96YRMnR+4EXB6402QY5f8ZLcnSUZUH55Fb1 +qcZGBc3WRKlPiUvwBD+eVYgCpNSXF/H+oV1mawxNJN5XwqBEpfYmY8MRIPcqa61h +bJc3LBSm1qNf05G5Cwxeed+OgVm0r1HBy6DAgDHAqNlkC8DZ/BVgqMA5fcrVAAUR +tCpIZW5yaSBHb21leiA8aGdvbWV6QHVzZXJzLnNvdXJjZWZvcmdlLm5ldD6JAJUD +BRA9ItFFFWCowDl9ytUBASNyA/458T84LUVhqq6Y9fPBAfcFMWY2kehuDWsQEXkO +46XoK+AnFZCkKuyDLqPHchVUO5pK/gZYsDK/xJkfh3u4FTDTsecb9wFmIeyayVIN +SI8o6l8EZzDX/PGwqEwzxHrbQkIgIktNn5ApIoazvdBpbkQfNj1vr2wWoMYPLAWM +8xzecA== +=UmZ8 +-----END PGP PUBLIC KEY BLOCK----- + +pub 1024D/307A10A5 2002-07-18 Henri Gomez <hgomez@users.sourceforge.net> +sig 3 307A10A5 2002-07-18 Henri Gomez <hgomez@users.sourceforge.net> +sub 2048g/862B8F70 2002-07-18 +sig 307A10A5 2002-07-18 Henri Gomez <hgomez@users.sourceforge.net> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.0 (GNU/Linux) + +mQGiBD02vbERBAC1v8fR6gjERpaz4UMfdy0hRVWCPSbOdF+Swm/IenjVzErco6zb +MTa13umUNrDPBy/tTWiCCZrOnqi7fgDzWqPEqrXJjKAFVLEWE6MmKylPPEPG1/bm +idkNGERSAZduvhKv777PzvEJJ/8eGe3wy/O8NbgIjCPtr4UklwCZS8cFuwCg8oMO +UdT8qZRtzdxdAyu1m5fUb+MD/3IKJYWXsdtb6iBphCU4f/BoyjVC9EZJ1ywLuiVM +siKbuaDUaXU9nWcbNKv+fx8uZ1NaadpfLokqqhnWcpnSiqw8HNR7SwsF1D33rkXK +O4FSuVss/tIoqGdWFcJyPkP4yP5shxqR335narVw2vDa0+BiWkALbA2qVsSIdZDB +LeFZA/47AMBS0U2BRk2rQT8LmMuFl7mR+wNBM4n7FUGdxsGn3TcYd4pXTNrEQPrV +YNdooKlikgGk4hgFnIFX09Spmimqgq0goFue81rttVdZZ4uep8dTghY6gwmvcOxX +jATbhWStBhdu9B35kzfHc+1QihD5Z94u4uyWIVBIzikcdiY8LbQqSGVucmkgR29t +ZXogPGhnb21lekB1c2Vycy5zb3VyY2Vmb3JnZS5uZXQ+iFcEExECABcFAj02vbEF +CwcKAwQDFQMCAxYCAQIXgAAKCRAZMdaEMHoQpYijAKCCP68ndU/kTXR9XAKLvibC +3S8+1QCfUFQYte3Jo+MHKaWjsu9JGptRzo+5Ag0EPTa93RAIAKlsRJ5gOGTFsmaR +W9k6MIh4c/MCy7J7HUxT5xTdHROa+3zUh+FAE/JaOx9ZtZtH863DFHA8cP4L+tpi +PjBT6g2E94dwGcuH/OiSSCT4JSBukbGbOuLLdmFXqUl8+4gsL90Xal67FtNLwyLG +1n7geLir0byD+OT7VLA5w+6G0NOpJEveV/FIa2qLgdRZ8vz73ybgMh18hBUrUmro +jncp0rln2VU7VCH1C2aClKm7kK4mGAjIFIzKbguK+kM3b8NDHmXKpT6syyCtIM3h +prkV1TUCAFqLI32aSdlTN79lpeA2zDga9k4/4X/RDHsFpRN2neRFGTNUtuUgYpQQ +E5zWBmMAAwUH/RiGxyeBsad923IwE1+GAjxFl2tqF9xWk0J6yTnSK4nfhYAE9evV +jwDEok9jRl4ILCcXx6YN/d/lWNuSbARKHz/3hLiTouPpwd3SSJ8is2x9PgpJz5JX +cD0y1SkbPLvs3jH3ZmdcxZpuAmJeI/typqFKK5pWP44oXIH+XH/8nWDtmLEBkgKQ +/ATQWenMTmZ6MIJ6aWKWGkO9QS6iYRz3PPPGQ1O8W02CeprM2wBtlb8J1Z3RxNhM +rZcg/1Qi3V3D1HI4zw6tAFmDeBb8J4PaBQzqlhzx2EBTbfwNPhV8AlPvpxHEeGGn +v+O1yhZr33SnyZdINNoNDn+owVMdmkobe9GIRgQYEQIABgUCPTa93QAKCRAZMdaE +MHoQpRsTAJ4qst3MhLm48fBAEnzuzi/BIKr+AgCfYaCB/AvPoncQbHc8BcNGRimR +P9A= +=hQhz +-----END PGP PUBLIC KEY BLOCK----- + +pub 1024D/EDF62C35 2002-04-10 Magesh Umasankar <umagesh@apache.org> +sig 3 EDF62C35 2002-04-10 Magesh Umasankar <umagesh@apache.org> +sig 3 5F6B8B72 2003-03-07 Stefan Bodewig <bodewig@apache.org> +sub 1024g/B5FFC53F 2002-04-10 +sig EDF62C35 2002-04-10 Magesh Umasankar <umagesh@apache.org> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.0 (GNU/Linux) + +mQGiBDy0ebgRBADuKIKD8PuJ4wKEV1h2AprwJjxCRx8vn48XNwfLZuvhw8cpArtK +rZwhoGPPUPEEXgtTNerlKq4VwpAwcnvRz7oC/7aWkUbcR2sAyhfe2scohwPgw7Xv ++isWC0NDPdrxvXG/PUOG/cnELunr51ymybBqBxUd2gMhYIxPo67D+YPYLwCgwcZp +yc/6kJa116ESWHrti342GD8D/1srpnRs9CiS1DQF1uZ1wW4vzj4VD61tKsjdWD8D +V573R22iMDLSj4oMB536WxUH7snz8XsAKm/peqJ6G9m0smtmWA1ago5yzQj70WqF +xzWBhHn2I/YfAQ8pb2s9q1lClj8elnCxT65L27ydBAZteejb2VqjtQ6iGy86PUT2 +wRUvBADZmoV1eIZJEM5NnxBv1EtvRYZtIQEzZ8dO2A1LOS7qlVr8IypljNPLGhzX +VHNvVsjC9QMUSWeBsDedvQHQ3hJpIMnTI32XE1V4gX06gfVTZdhf2fLTtwnsHZp0 +oumqshGDVRhNJJdDYLikxWOxOfkNveKEqJFvtuBR+ZqqluQKebQlTWFnZXNoIFVt +YXNhbmthciA8dW1hZ2VzaEBhcGFjaGUub3JnPohXBBMRAgAXBQI8tHm4BQsHCgME +AxUDAgMWAgECF4AACgkQ76Pnee32LDWSRwCfeASWXvpdt7bSFPMtszU/7uPEktsA +n23mYUN5WKJA1ZreW+0CcZ2ESnOviEYEExECAAYFAj5ogYgACgkQohFa4V9ri3IW +YACgsxGig0PL0M86rJsA/IpXjBdg3ysAoJzsoUZ/7s2BxDfzF/FRTVIzS+TMuQEN +BDy0eb8QBACBVb9YDJRp9Irzmq71Jf9FIPw+4g/cWpF3t/Eb7eSzMcOvTAXyNIWz +aaOjHre7lFctHfq8ls/6gR7uqajiAnfQcfTcu7pp+F5KsU0Embt83SFzZ3aoJwET +mB/LqUyrrGDiue3lU+flJO7UmcsRvtk0+BDkyCeB9HgfdpXbBLCyuwADBQP+PNxX +4e1tg3ZJo/xNEnD2Re3HjmQRrr0RYJLUGjgQrAEONSgowx3IW8/JssmNJVjnYm0q +jSKsb8rergCFJhPNZ8Dd/k00pKcrq+IN6j7WTYLqPce87zrGAZUtmDwDSp5mxy5E +xWJJxsgBPk4YBQLzJt21A3BgK/i24Sze2VLbaZuIRgQYEQIABgUCPLR5vwAKCRDv +o+d57fYsNa8xAJ4mLfonZbd64+YY9rfvhIh3Vsl3AACeLPPKtma2K6XCfhTBEDnj +hzSr4vo= +=lBfF +-----END PGP PUBLIC KEY BLOCK----- +pub 1024D/265B4C63 2003-08-18 Antoine Levy-Lambert (Apache Ant Committer) <antoine@apache.org> +sig 3 265B4C63 2003-12-06 Antoine Levy-Lambert (Apache Ant Committer) <antoine@apache.org> +sig 3 5F6B8B72 2003-12-12 Stefan Bodewig <bodewig@apache.org> +uid Antoine Levy-Lambert (Apache Ant Committer) <antoine@antbuild.com> +sig 3 265B4C63 2003-08-18 Antoine Levy-Lambert (Apache Ant Committer) <antoine@apache.org> +sig 3 5F6B8B72 2003-12-12 Stefan Bodewig <bodewig@apache.org> +sub 1024g/A3060393 2003-08-18 +sig 265B4C63 2003-08-18 Antoine Levy-Lambert (Apache Ant Committer) <antoine@apache.org> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.2 (MingW32) + +mQGiBD9AzmcRBACMqgb7IFvC/nLxw7mUAgHENeZXY3JOQJ8wVBevIbbMEeFvzHE2 +diFydqUXocPexduYr0ahkf033WvWdAiNqDLfVW/HFOsc1TpjbHkqPUHtJ62Ya5tg +nH4UGN9BYZfMbfVDOSz41lYwmfK5HYgpZN/sBQBSKf2qgoFB+LxYaae8YwCgrWlu +fYhf7fkKbbdSf3BGS67ggNkD/0VvkXkw1SEnPaqrkKGkPKomCTb2auGxcYYI3/rP +1m+SGRf0gE1NtocmIEitiR6WvfKUjoMAXSCp5KdnUXmO9rwzkM002KCA7K5CY+e/ +2bLDuiQ3rNiD4mFfG6M+UnmZ+GMFba1p9Cp4PqLNLsCHz67t7hEsscTZQ8mZ9xKM ++GCsA/9P+XFM7JDn9MLhYab9qo1CkceBkthUP6jWGjuAZ00elmBCkpkzNv5aIzss +xih2GpaU/tmcMjw8FGp0dTwzqdpmbZBLjunRnuBTir4m4l5G9rwl4JbfK1PVqk4a +VKkh9W7/yqBcEfNcsfJO9cqaQ+PzcnCoDiD9UHEBYzUhrCKwhLRCQW50b2luZSBM +ZXZ5LUxhbWJlcnQgKEFwYWNoZSBBbnQgQ29tbWl0dGVyKSA8YW50b2luZUBhbnRi +dWlsZC5jb20+iFsEExECABsFAj9AzmcGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQ +hhTWqyZbTGMnOgCeJV2gI+1CIxMR7dcIhXjPkiusreIAn2SGOsPS0o89l0EIVuc9 +J2F03aB+iEYEExECAAYFAj/ZwioACgkQohFa4V9ri3J8CACgiGlh+td0BAnJPq19 +ovEQR2DJ02MAoLP203EF+BLPpykeTcGp8UEWmeGQtEBBbnRvaW5lIExldnktTGFt +YmVydCAoQXBhY2hlIEFudCBDb21taXR0ZXIpIDxhbnRvaW5lQGFwYWNoZS5vcmc+ +iF4EExECAB4FAj/SSwYCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQhhTWqyZb +TGOh/QCfbrSoipMlizyGT6c8BOPEd9zzfi0AnRRTqTDzXzsGk4CG/BJME9CCm7Ts +iEYEExECAAYFAj/ZwiMACgkQohFa4V9ri3IOVACgh2QHS1+cVjvM4eLjls1bJwWi +o5IAoLtAszHrwHS5qrhvr2rtnlyyyV2guQENBD9AzmkQBACNpBfqi2PweozCtxoX +PqzKdRDKqCw7TOrDR6lbP3z/ov/1SN5Vc0XqNzBSGqwBcmGWtneABkX7n4uzJrC5 +wvX/TZ/DkMvypPyeNVMu+/ZMlzdbx06OUDKr6Fy/NtaI7cN1rw+Igyv22Q8ilhhg +s/5Rdj84EtJkWQjVRml6wXSAZwADBwP/TqyhOC4sA5YrePYGH8i46h0SU9dXjfEF +JijC8vXZ+BNQHQVK3fjEXedZL8Zvvp1bsMu7Muz9SMnqygM1unp2NGxLRd/9315p +Qh0VStYKn0xq13ybOKr0Gsyx5yyl3Nzlu/1qAR0es/zN4jV7/IQi3R2GOvezcpHX +mkbsYiZAhu2IRgQYEQIABgUCP0DOaQAKCRCGFNarJltMYxcsAKCSJJUABlXYnLBj +b+WtmAzu0JjZNACdFJ4KIATJDK/5ajFq5+irOpodoHc= +=UomR +-----END PGP PUBLIC KEY BLOCK----- + +pub 1024D/5F6B8B72 2001-05-28 Stefan Bodewig <bodewig@apache.org> +sig 3 5F6B8B72 2001-05-28 Stefan Bodewig <bodewig@apache.org> +sig 51898504 2002-01-11 Conor MacNeill <conor@codefeed.com> +sig 3 F88341D9 2003-03-17 Lars Eilebrecht <lars@eilebrecht.org> +sig 3 2261D073 2003-03-17 Astrid Kessler (Kess) <kess@kess-net.de> +sig 21D0A71B 2003-03-17 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 75A67692 2003-03-18 Erik Abele <erik@codefaktor.de> +sig B3B2A12C 2003-05-20 ct magazine CERTIFICATE <pgpCA@ct.heise.de> +sig 3 8103A37E 2003-04-04 Andre Malo <nd@apache.org> +sig 3 5F6B8B72 2001-05-28 Stefan Bodewig <bodewig@apache.org> +sig D6298F01 2003-04-27 Paulo Henrique Gaspar Jorge <pjorge@asatnet.com.br> +sig 0CAA68B4 2004-11-11 Patrick Rentsch <patrick.rentsch@suissimage.ch> +sig 2FE28BCF 2005-07-01 Harald Wilhelm (HAWI) <Harald.Wilhelm@hawi.de> +sig 5793498F 2005-07-21 Tim Ellison <tim@ellison.name> +sig E4136392 2005-07-21 [User id not found] +sig 8408F755 2005-07-21 Christian Geisert <chrisg@apache.org> +sig 2 FC243F3C 2005-07-20 Henk P. Penning <penning@cs.uu.nl> +sig 3 EC140B81 2005-07-20 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 3 EE65E321 2005-07-20 Martin Kraemer <martin@apache.org> +sig 3 A99F75DD 2005-07-21 Rodent of Unusual Size <coar@php.net> +sig 3 3642CB4B 2005-07-20 Martin Kraemer <martin@apache.org> +sig 3 302DA568 2005-07-21 Rodent of Unusual Size (DSA) <coar@Apache.Org> +sig 3 2C312D2F 2005-07-21 Rodent of Unusual Size <coar@php.net> +sig 3 CC78C893 2005-07-22 Rich Bowen <rbowen@rcbowen.com> +sig 3 E2D774DF 2005-07-22 Sylvain Wallez <sylvain@apache.org> +sig 3 E04F9A89 2005-07-22 Roy T. Fielding <fielding@gbiv.com> +sig 3 015AFC8A 2005-07-22 Bertrand Delacretaz <bdelacretaz@apache.org> +sig 3 87315C31 2005-07-23 Raphaël Luta <raphael.luta@aptiwan.com> +sig 3 E41EDC7E 2005-07-24 Carsten Ziegeler <cziegeler@apache.org> +sig 3 F39B3750 2005-07-24 Colm MacCarthaigh <colm@stdlib.net> +sig 1CD4861F 2005-07-25 Eran Chinthaka <chinthaka@apache.org> +sig EA1BA38D 2005-07-25 Ajith Harshana Ranabahu (Made at Apachecon 2005) <ajith@apache.org> +sig 333E4E84 2005-07-26 Chathura Kamalanath Herath (Apachecon Europe 2005) <chathura@apache.org> +sig 152924AF 2005-07-29 Sander Temme <sander@temme.net> +sig 3 9C85222B 2005-07-24 Henning Schmiedehausen <hps@intermeta.de> +sig 3 9978AF86 2005-07-25 [User id not found] +sig 3 2A623F72 2005-07-25 [User id not found] +sig 3 F8EA2967 2005-07-26 [User id not found] +sig 3 C152431A 2005-07-27 Steve Loughran <stevel@apache.org> +sig DE885DD3 2005-11-25 Sander Striker <striker@apache.org> +uid [revoked] Stefan Bodewig <bodewig@bost.de> +sig 3 5F6B8B72 2001-05-28 Stefan Bodewig <bodewig@apache.org> +sig 51898504 2002-01-11 Conor MacNeill <conor@codefeed.com> +sig 3 F88341D9 2003-03-17 Lars Eilebrecht <lars@eilebrecht.org> +sig 3 2261D073 2003-03-17 Astrid Kessler (Kess) <kess@kess-net.de> +sig 21D0A71B 2003-03-17 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 75A67692 2003-03-18 Erik Abele <erik@codefaktor.de> +sig B3B2A12C 2003-05-20 ct magazine CERTIFICATE <pgpCA@ct.heise.de> +sig 3 8103A37E 2003-04-04 Andre Malo <nd@apache.org> +sig 0CAA68B4 2004-11-11 Patrick Rentsch <patrick.rentsch@suissimage.ch> +sig 2FE28BCF 2005-07-01 Harald Wilhelm (HAWI) <Harald.Wilhelm@hawi.de> +rev 5F6B8B72 2005-07-22 Stefan Bodewig <bodewig@apache.org> +sig 5793498F 2005-07-21 Tim Ellison <tim@ellison.name> +sig 3 EC140B81 2005-07-20 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 3 EE65E321 2005-07-20 Martin Kraemer <martin@apache.org> +sig 3 A99F75DD 2005-07-21 Rodent of Unusual Size <coar@php.net> +sig 3 3642CB4B 2005-07-20 Martin Kraemer <martin@apache.org> +sig 3 302DA568 2005-07-21 Rodent of Unusual Size (DSA) <coar@Apache.Org> +sig 3 2C312D2F 2005-07-21 Rodent of Unusual Size <coar@php.net> +sig 3 CC78C893 2005-07-22 Rich Bowen <rbowen@rcbowen.com> +sig 3 E2D774DF 2005-07-22 Sylvain Wallez <sylvain@apache.org> +sig 3 E04F9A89 2005-07-22 Roy T. Fielding <fielding@gbiv.com> +sig 3 87315C31 2005-07-23 Raphaël Luta <raphael.luta@aptiwan.com> +sig 3 E41EDC7E 2005-07-24 Carsten Ziegeler <cziegeler@apache.org> +sig 3 F39B3750 2005-07-24 Colm MacCarthaigh <colm@stdlib.net> +sig 1CD4861F 2005-07-25 Eran Chinthaka <chinthaka@apache.org> +sig EA1BA38D 2005-07-25 Ajith Harshana Ranabahu (Made at Apachecon 2005) <ajith@apache.org> +sig 333E4E84 2005-07-26 Chathura Kamalanath Herath (Apachecon Europe 2005) <chathura@apache.org> +sig 152924AF 2005-07-29 Sander Temme <sander@temme.net> +sig 3 9C85222B 2005-07-24 Henning Schmiedehausen <hps@intermeta.de> +sig 3 9978AF86 2005-07-25 [User id not found] +sig 3 2A623F72 2005-07-25 [User id not found] +sig 3 F8EA2967 2005-07-26 [User id not found] +sig 3 C152431A 2005-07-27 Steve Loughran <stevel@apache.org> +sig DE885DD3 2005-11-25 Sander Striker <striker@apache.org> +uid Stefan Bodewig <stefan.bodewig@freenet.de> +sig 3 5F6B8B72 2003-03-07 Stefan Bodewig <bodewig@apache.org> +sig 3 F88341D9 2003-03-17 Lars Eilebrecht <lars@eilebrecht.org> +sig 3 2261D073 2003-03-17 Astrid Kessler (Kess) <kess@kess-net.de> +sig 21D0A71B 2003-03-17 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 75A67692 2003-03-18 Erik Abele <erik@codefaktor.de> +sig B3B2A12C 2003-05-20 ct magazine CERTIFICATE <pgpCA@ct.heise.de> +sig 3 8103A37E 2003-04-04 Andre Malo <nd@apache.org> +sig 51898504 2005-06-21 Conor MacNeill <conor@codefeed.com> +sig 0CAA68B4 2004-11-11 Patrick Rentsch <patrick.rentsch@suissimage.ch> +sig 2FE28BCF 2005-07-01 Harald Wilhelm (HAWI) <Harald.Wilhelm@hawi.de> +sig 5793498F 2005-07-21 Tim Ellison <tim@ellison.name> +sig 8408F755 2005-07-21 Christian Geisert <chrisg@apache.org> +sig 3 EC140B81 2005-07-20 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 3 EE65E321 2005-07-20 Martin Kraemer <martin@apache.org> +sig 3 A99F75DD 2005-07-21 Rodent of Unusual Size <coar@php.net> +sig 3 3642CB4B 2005-07-20 Martin Kraemer <martin@apache.org> +sig 3 302DA568 2005-07-21 Rodent of Unusual Size (DSA) <coar@Apache.Org> +sig 3 2C312D2F 2005-07-21 Rodent of Unusual Size <coar@php.net> +sig 3 CC78C893 2005-07-22 Rich Bowen <rbowen@rcbowen.com> +sig 3 E2D774DF 2005-07-22 Sylvain Wallez <sylvain@apache.org> +sig 3 E04F9A89 2005-07-22 Roy T. Fielding <fielding@gbiv.com> +sig 3 87315C31 2005-07-23 Raphaël Luta <raphael.luta@aptiwan.com> +sig 3 E41EDC7E 2005-07-24 Carsten Ziegeler <cziegeler@apache.org> +sig 3 F39B3750 2005-07-24 Colm MacCarthaigh <colm@stdlib.net> +sig 1CD4861F 2005-07-25 Eran Chinthaka <chinthaka@apache.org> +sig EA1BA38D 2005-07-25 Ajith Harshana Ranabahu (Made at Apachecon 2005) <ajith@apache.org> +sig 333E4E84 2005-07-26 Chathura Kamalanath Herath (Apachecon Europe 2005) <chathura@apache.org> +sig 152924AF 2005-07-29 Sander Temme <sander@temme.net> +sig 3 9C85222B 2005-07-24 Henning Schmiedehausen <hps@intermeta.de> +sig 3 9978AF86 2005-07-25 [User id not found] +sig 3 2A623F72 2005-07-25 [User id not found] +sig 3 F8EA2967 2005-07-26 [User id not found] +sig 3 C152431A 2005-07-27 Steve Loughran <stevel@apache.org> +sig DE885DD3 2005-11-25 Sander Striker <striker@apache.org> +uid Stefan Bodewig <stefan@samaflost.de> +sig 3 5F6B8B72 2005-05-31 Stefan Bodewig <bodewig@apache.org> +sig 51898504 2005-06-21 Conor MacNeill <conor@codefeed.com> +sig 2FE28BCF 2005-07-01 Harald Wilhelm (HAWI) <Harald.Wilhelm@hawi.de> +sig 5793498F 2005-07-21 Tim Ellison <tim@ellison.name> +sig 3 EC140B81 2005-07-20 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 3 EE65E321 2005-07-20 Martin Kraemer <martin@apache.org> +sig 3 A99F75DD 2005-07-21 Rodent of Unusual Size <coar@php.net> +sig 3 21D0A71B 2005-07-20 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 3 3642CB4B 2005-07-20 Martin Kraemer <martin@apache.org> +sig 3 302DA568 2005-07-21 Rodent of Unusual Size (DSA) <coar@Apache.Org> +sig 3 2C312D2F 2005-07-21 Rodent of Unusual Size <coar@php.net> +sig 3 CC78C893 2005-07-22 Rich Bowen <rbowen@rcbowen.com> +sig 3 E2D774DF 2005-07-22 Sylvain Wallez <sylvain@apache.org> +sig 3 E04F9A89 2005-07-22 Roy T. Fielding <fielding@gbiv.com> +sig 3 87315C31 2005-07-23 Raphaël Luta <raphael.luta@aptiwan.com> +sig 3 E41EDC7E 2005-07-24 Carsten Ziegeler <cziegeler@apache.org> +sig 3 F39B3750 2005-07-24 Colm MacCarthaigh <colm@stdlib.net> +sig 1CD4861F 2005-07-25 Eran Chinthaka <chinthaka@apache.org> +sig EA1BA38D 2005-07-25 Ajith Harshana Ranabahu (Made at Apachecon 2005) <ajith@apache.org> +sig 333E4E84 2005-07-26 Chathura Kamalanath Herath (Apachecon Europe 2005) <chathura@apache.org> +sig 152924AF 2005-07-29 Sander Temme <sander@temme.net> +sig 3 9C85222B 2005-07-24 Henning Schmiedehausen <hps@intermeta.de> +sig 3 9978AF86 2005-07-25 [User id not found] +sig 3 2A623F72 2005-07-25 [User id not found] +sig 3 F8EA2967 2005-07-26 [User id not found] +sig 3 C152431A 2005-07-27 Steve Loughran <stevel@apache.org> +sig DE885DD3 2005-11-25 Sander Striker <striker@apache.org> +uid [revoked] Stefan Bodewig <stefan.bodewig@epost.de> +rev 5F6B8B72 2005-07-01 Stefan Bodewig <bodewig@apache.org> +sig 75A67692 2003-03-18 Erik Abele <erik@codefaktor.de> +sig 3 F88341D9 2003-03-17 Lars Eilebrecht <lars@eilebrecht.org> +sig 3 5F6B8B72 2002-01-11 Stefan Bodewig <bodewig@apache.org> +sig 3 8103A37E 2003-04-04 Andre Malo <nd@apache.org> +sig 3 2261D073 2003-03-17 Astrid Kessler (Kess) <kess@kess-net.de> +sig 21D0A71B 2003-03-17 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 2FE28BCF 2005-07-01 Harald Wilhelm (HAWI) <Harald.Wilhelm@hawi.de> +sub 1024g/24774157 2001-05-28 +sig 5F6B8B72 2001-05-28 Stefan Bodewig <bodewig@apache.org> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.2.4 (GNU/Linux) + +mQGiBDsSIk4RBADSCj6rUjV64tYCGT1DYKYR7GthyWpNdGHSYLbETBcDatAe1dzQ +5NsCgfrlybfyeY+y1lxr3T9bqf6zJWDw/718wff96qmmv1qzexSYtmIrj+h53V82 +EXwWOFuYMJisuxdT940iQzosm3GOv4MJdEg3oI2SgfEyRQQ6vO4Ob5rHDwCg5taZ +nrHOrXx2dIGHxpxRZ0SUl30D/jmtttFjYOQ3LBMriikz5mh2sK3ZnoSRF4o5O0zW +Ve6e2SFXOEjVjImKsH6KCbdQNelrAdgiyOoXClyQKsQ27pncbdWo6bO0E3POJZVm +XaeW7iudHVr63rU5PViXObIQrdQl0D59j5brKj4vdlTyUw8kaHPvbKPDEOwvZq4Y +LJQ5BACA1YilTeXRJqwFsNlpcxCHwlULD4QUVP496prQWf1B7Z6g0KvLGrQsO0Vn +Jcn+fEqukysTJixSXCPebosltd4RalJIupVYkp4w6MJ7biaDAlLuNhDcI/AiXTmV +dXUedVXIaM8I3Ne23gucwbAyc0Hvb+3cSAKRhl/azFQhuHBvlrQjU3RlZmFuIEJv +ZGV3aWcgPGJvZGV3aWdAYXBhY2hlLm9yZz6IYgQTEQIAGgULBwoDBAMVAwIDFgIB +AheAAhkBBQI7EiJPABIHZUdQRwABAQkQohFa4V9ri3KPOACfdr6cV41veYBlBHiV +FxfLcX7x5OEAniK4u3g2jpNQH3E0ROubdj/RO+RTiEYEEBECAAYFAjw+1Y8ACgkQ +gQRkT1GJhQSdkgCeM6RDHUF/E334TtiLPgw7GpmNJSkAoNCLQCW/9VHrV+ZHsodn +XUnaD4dIiJkEEwECAAYFAj513wwACgkQPo+38viDQdknZAPlHNiMnR+LUavo2yOY +iJT+W9+8+qNs2grYDZ+WSYujaWT2NJrUCYXQRM6gKDyFlkcJvHI9lF2yYMkVetll +ZVN1TJkeEdtbHncNHcdq+ZUQR0NkFKTF9d1K7UI2rfWxt1y6a13TcUjpJXzbtw/O +XX9EZSI6QQt4rSFlvci9J3mIRgQTEQIABgUCPnXawQAKCRDu0eo5ImHQc0W4AJ9v +uq4wlkc6TmmmZPF/gZVLluHcTgCeItrnvzyS11xkIETk6v4b7K4gaiiIPwMFED51 +qhr9b4jGIdCnGxECRAUAoOaVZW5CdZ9oYr3PwI/i8RJN+JfJAKCmd/XIlYOCpa9Q +c4C855pM8NFw6YhGBBARAgAGBQI+d6QQAAoJEBU/oM11pnaSL+sAn1DTHmbhITeE +w0ZSgyBLQw2ZhcM5AJ0ZrRBbZ9lbgHXBKOJQiLpWBj4XsYhGBBARAgAGBQI+yi6W +AAoJENvSRfyzsqEsF/AAoNXq7Cp/0AwEmWvhoTjmtY6eVYB5AKCMFhBUdYWNXVya +lPTq8ThswNUnr4hGBBMRAgAGBQI+jc4sAAoJEMppOXSBA6N+kUoAn1Nj6YqarQg0 +sL2KrFsQROM3A6fSAKCyl40SpfVJSO33fYuPci9dHp+QCIhXBBMRAgAXBQI7EiJO +BQsHCgMEAxUDAgMWAgECF4AACgkQohFa4V9ri3IsngCfbIpJDWj6UgXY7rBH8To1 +2BgB+RIAn3jw72WJzplAtShVTmuMlRFS+FUNiEYEEBECAAYFAj6sazwACgkQqywx +6dYpjwFkeQCeOkJrnO5r2hWDhX4ACPPLObZvXLIAnR0VHAgkEH1W/t7B4zdDYdBB +Zrd5iEYEEBECAAYFAkGS8mMACgkQ5BNhMwyqaLQs9ACgio5zJcieYLppigvSYLBf +ubUVrXUAnRKZJ6MACpH6fpoz2vkc2dh69tbSiEYEEBECAAYFAkLFMoEACgkQm/Ij +RS/ii88aCQCfd1cIawDqpkYU86f3JEjcN85ntFcAni0m8WR6s+bkh3fd+EIrSRsr +u3uQiEYEEBECAAYFAkLfRQIACgkQQeoJoFeTSY8XxQCdFd+XEWqyDkCx37gaIQAG +4dHpwiUAoOZ/K5OHyTJCNFaBUDtpCh7hL8TPiEYEEBECAAYFAkLfkncACgkQAQVm +vOQTY5L3SgCgiEi5/1vYvJrKoAdl0hRWU57ieUIAn2n08BQfMZJQ439aNW/CnIK8 +jPBPiEYEEBECAAYFAkLgNdAACgkQc84u+4QI91XdNQCgoBB1ebohIflinAPlvI37 +pFHuu0MAoJ4yMtbKZMaq0xIBnxV9c5uu99tGiEYEEhECAAYFAkLerWMACgkQi5Yp +Q/wkPzxD7ACgqKnyeb/fjVS8vov4FePxeLju4msAn1SCGaiF9gEf+qIaZUnjcT7J +DJ96iJwEEwECAAYFAkLerG8ACgkQMaY9luwUC4Ea9gP/WON+0xIWOvWP7mKkg/+X +0ukW+mbjE426qKtG/B0vNrTKpElmz8ttR+oajqbg20LazoEUuA9ZXjLPfsdWA+vF +kxgV6qIdtxYPMamPm7ytEBOmgMowYXUftGteqM5fxLlceHiwdUlynG2fmtMqvPnd +2OCezSFRx3W6nvAiIjoLZpCInAQTAQIABgUCQt7H0wAKCRA34/Rf7mXjIcAUA/4n +DlQbnToSSDOZkFj1CoGL8TjsVgzrO3r3S3x38uQQTFAE/AGBY4mtHgNcYmiJaC2h +N1Y+mlEGu/80Rjv185ZfJsFEerU6Y/9tRJJ1So9AAe5AmvGpD9ysXae5geB+k+ep +IMSuf9WMeTRUCbQs9ufGZLV5a8jqstv+btcrzNaY9oicBBMBAgAGBQJC32x4AAoJ +EJrNPMCpn3XdRBkD/iNi0Y6A3afDG9ZL/K4JrOPgHUFWC/DgAEBme4AY62agUsT0 +uXlz+Mu1Ps2E0t26ejScuVMMvqpXg7iJ2+3yKzsnX0ySEXW6/696XEpe3TFn1iVO +mMElPKxakn3t/jr6SDepo9jqD5P5CJR4GsDsG3iKIisWdDf81ZXpf86y7A5eiEYE +ExECAAYFAkLeuuUACgkQMsnkzjZCy0vmSQCdHGC6jOEVo96yyospTq7bL+EEeioA +oNMKIZy5qFLXXZbSNvsj7mDRg2c8iEYEExECAAYFAkLfbHoACgkQUI6uxTAtpWhY +hQCaAvqVBsTX5s4c+sTOo06BNMdzHIUAoIwpThAKq936Szy/3Gfv8K3gs5NOiEYE +ExECAAYFAkLfbHwACgkQ3bpkuiwxLS9z8ACfYeocOK4J204xwbXgEdUJQyvHK2UA +oKz2AF1I2b8Ebu7vTUZLNFV1QMtwiEYEExECAAYFAkLgyTgACgkQXP03+sx4yJNb +EgCfRcj6QKHVHQtYVXdCYKUbrj97wAoAnimqV15cvz1siDjUK9K/aTskGwajiEYE +ExECAAYFAkLg7MsACgkQybWm7OLXdN8UoQCdFfqef8My1xhn6mLd9WTLLaIewTQA +nRXGh/Af4hVG0KwtZcJEA464nCoJiEYEExECAAYFAkLg7TwACgkQW5aAEOBPmol+ +JwCeLxZjKNisjgP4AxV5BCKR+5SU9NoAoIwPF/7B2NmGNR0t3EZze8wpNhQ0iEYE +ExECAAYFAkLg7V8ACgkQN/aP9QFa/IqerACfafKJi4s8LYV2JxNfQKHgmRXzeIIA +oNBHOzukDCdxIvmYJfamItnCP45giEYEExECAAYFAkLiYm8ACgkQbZiNF4cxXDH8 +HwCgq8P29CwMX7PKhRmY3T32APsOaMEAnjdd/WvzVBFtTcJFWkH6iF4L8EQpiEYE +ExECAAYFAkLjVb4ACgkQEy5J1OQe3H56DACcDPfWLO5cDkeKFCvIP8mc4p4KkfkA +oJITROldIRxXqUiML1oTJxieuHJfiEYEExECAAYFAkLjZNoACgkQdcqio/ObN1CI +tACgsJhqBxeZTaSrRVNk3aj6ciAJrgEAoIxPXYTvIpnWBr4/WMbN0jpV0TGEiEYE +EBECAAYFAkLkbxIACgkQjON2uBzUhh/gZQCbBpIqkCEuIbd6tqChz3PzcIGiZbgA +njluBFHl4l1/NHtP9fEYCgl8nbCviEYEEBECAAYFAkLkkr4ACgkQBJE0Quobo42f ++QCgjtO6EOdDRiruCi6gKvwM1a2eRwcAn0XUELm5AZezL5E0rEfIM2FBiMi5iEYE +EBECAAYFAkLlwh0ACgkQYRlqLjM+ToS9pwCfUEgO834XY/clWzkw/VLBfe7MLZQA +mwdz0nleOHYWFBrnYgEz53d4MxUPiEYEEBECAAYFAkLqY/QACgkQsr68QBUpJK/o +MQCfc7M9KpApCWW7eE22PlLoN1sPK+4AoJdwE8TsDM2Pmehk9K+uHIx6FoRviEYE +ExECAAYFAkLj7WcACgkQMoZOQZyFIitClACfWpH0+V/N6vuucWZ7bsMm2BcmM3oA +n3fF5qqovlog4/PcgvKCToNEF8uWiEYEExECAAYFAkLlELcACgkQUnkvr5l4r4YU +ZwCgg7vJpDpUXnuNvgc5RHgG7UYhRQYAoIEKHsrswh6XzVn5yQRkfjdB/A0OiEYE +ExECAAYFAkLlEaQACgkQa3OhBipiP3JA4QCffb8NgQssOQXaVR0dSwPCeU2nQPUA +n15EAjykVZsUi2tZWqEM08SNOKI9iEYEExECAAYFAkLmmWIACgkQaOuMdvjqKWd7 +AQCbBpwyitQ77kd9KIT6y95Im1vmWt8AnAnkNTBctVtMfwddYTG+xLkaOllOiEYE +ExECAAYFAkLnYVAACgkQbpR1lMFSQxqIRACffQqUXTgOa4hyHYQBUwrlGEqmWt4A +nRMXVGhd47loS27MmiEiWwDlkNjJiEYEEBECAAYFAkOHn54ACgkQZjW2wN6IXdOr +9gCgh2fn26W0DSL5WZATvvQkwZeJNiMAnR6+0AlUK8uFSFIVhl+RZMnY+XFwtCBT +dGVmYW4gQm9kZXdpZyA8Ym9kZXdpZ0Bib3N0LmRlPohfBBMRAgAXBQI7EjmBBQsH +CgMEAxUDAgMWAgECF4AAEgkQohFa4V9ri3IHZUdQRwABAcm6AKDaA//SYJv2pcXw +GBC89OSzGvxy3gCg1kx6qu6zJKaWaE1L9oFqVc65OUSIRgQQEQIABgUCPD7VlQAK +CRCBBGRPUYmFBNCzAJ9tv7tNS6NwaOZQ8cR0pGslJGKtuQCgpttMmhhRrUwyVuEX +c+dKX7rdQMKImQQTAQIABgUCPnXfDwAKCRA+j7fy+INB2Vm6A+IDxiYtMvd/mad+ +7hRoKXvD5AddB1SwnvQdJe0ewStFBYZxZdNOLXdkVngCwAJziPGZcQmocEHVMrN+ +Mxe+3OX0PEZ+3KOOsAUi+fTov2xvf8EWKgX9d0li9iEytVA4M0c52a3bPTC0Kki/ +KAY3m8oNvAmTwWB9dBSooFFDMIhGBBMRAgAGBQI+ddrHAAoJEO7R6jkiYdBzruYA +nAzvTrvDQNvoAoaDQJ+o/ydqMA8ZAJwNEOQDHsz+6ynbMPoQmKmUqfEISIg/AwUQ +PnWqIf1viMYh0KcbEQIkpwCeInf4o3C5Ykh/xBodVImrp2Cvcy8AoMn3me5p4Sl2 +rm2tjVxTJZt2sUr7iEYEEBECAAYFAj53pBoACgkQFT+gzXWmdpIpGgCgiTARP6Cf ++JKOxUaVFr0L9DC5oUcAoIxF7D5mOVK/AFcp1cxNk3BLtdq3iEYEEBECAAYFAj7K +LjIACgkQ29JF/LOyoSwAbACglNp7V2Pw4U575IuooM677bZf8pwAn2U2TcHj7PYp +rU+qYRkyJ3pa7FyyiEYEExECAAYFAj6NzjUACgkQymk5dIEDo35YPwCeJIU/monN +96nP4jJjAuflEXMbemUAoJXq7oVCYuOCqWr/T3VW0DM3W+dniEYEEBECAAYFAkGS +8+sACgkQ5BNhMwyqaLQ2RwCeMcDf4bb+OMjRUJwAk2LHN9th42QAn03fVqMUZEVm +OrVXfWILpjXNLMDIiEYEEBECAAYFAkLFMoYACgkQm/IjRS/ii8/gpQCffXXRCeZf +1Vv5ih70yE2ZXg0r/rsAoJYKsdx0K5aqfoEzyiBCj5I46JvhiGoEMBECACoFAkLh +OBAjHSBUaGlzIHdhcyBhIGpvYiBhZGRyZXNzIGFuZCBJIHF1aXQACgkQohFa4V9r +i3LxGACgiQ+wlaa9iMOue5DuhtyLPMSmuiIAoIkrciYFOf3VBBD0HLWfGVWUqxzR +iEYEEBECAAYFAkLfRQwACgkQQeoJoFeTSY/ndgCfUEQl4Rc5nnu3G4ZX3o4OywbF +7DEAn3Htv1s/on+ei+1mmS6Z/PdwgM7viJwEEwECAAYFAkLerHEACgkQMaY9luwU +C4F1JAP/epJYDZX4flU0sa8AlFtSROY/O6g3iVq5zeYm1WD3e0xOOYTXlkIntkYF +hqbBzZQ3pFYfWmbhzCW/Tc0RigACdmroEELrwyrfLIHvsnUTF7C5AL6SuFQZqG6q +oMjtHFd6KDMos2sDEZ3VXDG1buW+hpHY9rWRJKPzb/SgSetTCeuInAQTAQIABgUC +Qt7H2QAKCRA34/Rf7mXjIaxmBACiYCwxZLtxnaRfwSOBkASqmnS8oBdyIKvTad9d +LE3CziNgEW+AdfE76vQskeDxL3ZVQubhKWiaM4B7YU2nYxk4INVpok1qht9bN1Ps +y+TS3SvpPKqq8Ri8xc4ZPDwdcCcCJiXLy5iR5tx3iBsnHRM5+LMIJg+LiOqd/ZnB +sggjjYicBBMBAgAGBQJC32x5AAoJEJrNPMCpn3XdrMQD/3vFtnKssqT6mB7NOZ08 +Tcw+cC5e9gAVr5Y33X+ZgPe7BJd6uPNt+I97FDdVJOnNtTZSvnkQZ/C79Yoci0yZ +AAoHYlzRb4tXguLy4UDBjj3BlvPsCOKJZrKn7bxvtoTbeHgjHmneiIwCuyzSoA1h +AYxiPliDrwuVCQTudHDVxjl1iEYEExECAAYFAkLeuu0ACgkQMsnkzjZCy0sSYACf +X2gis4g5jep0HjKABAk31byHU0QAoI5294fLHOeIHKLCIdvKm+7gVLn+iEYEExEC +AAYFAkLfbHsACgkQUI6uxTAtpWg6BwCfVQtdTRbNPgQGFqGQSUlBJ459xfYAoLKh +j68YUwZB5VgIeIorpqt9bWR2iEYEExECAAYFAkLfbH0ACgkQ3bpkuiwxLS94SQCg +hB4+5RwGR0ZOyy2xUA4e6ImO6ZQAoIjkWwYRd1Vp9SQoJW5OdSquYSctiEYEExEC +AAYFAkLgyTsACgkQXP03+sx4yJOsAACeKo39hTRNVVyvj5y9ohT9Ye3/C+MAn27a +EKrGgxNbwq50qGxFE+p36j7fiEYEExECAAYFAkLg7MwACgkQybWm7OLXdN8i0ACg +s+aW41FnchB0K/OUdB3t0Lg4i5IAoM+l0PyxS3XJsAwI+JbCm0aR3VA8iEYEExEC +AAYFAkLg7UAACgkQW5aAEOBPmokbqACcC3in6U+mqjSwb67rB5zTY0ThYucAoI4V +7qe0XHTDUwwWOgRo/NzR7k1OiEYEExECAAYFAkLiYm8ACgkQbZiNF4cxXDGcDgCg +i5CrpyZ1Dcu0IKML05Ffvw8lPhYAn0nL0BczEo9RpNVYg2ytJ+YtjKUFiEYEExEC +AAYFAkLjVcAACgkQEy5J1OQe3H7q9gCfV5xTyo5SD7G62VSUbjYfeqcuxXwAoKAu +chsMkavYWCt0jBhgLuTJkFqUiEYEExECAAYFAkLjZNsACgkQdcqio/ObN1AdZACg +pUgi5qnnDUpVXhTsJUoo4U485sYAoOXmMbhyaOMH9g9ndYFm5aHPMbf9iEYEEBEC +AAYFAkLkbxQACgkQjON2uBzUhh9ScwCgqFELgIdNWky221EuFgjKzgEG5WoAn3cB +ZbE+PMFhAZyUhQIl2hHEbVJIiEYEEBECAAYFAkLkkscACgkQBJE0Quobo43EoQCf +RCtbvMHoTGmS7dmZ3sRyAj4W7WoAoJDfouy1wZ5tSMJT+XBm5oFtwSUSiEYEEBEC +AAYFAkLlwiAACgkQYRlqLjM+ToRAHwCbBxMHNYyvbYmAb1kTEt8ydF660oYAn3zs +rmZawTXrjvbPE/VpC+/7wpzpiEYEEBECAAYFAkLqY/gACgkQsr68QBUpJK8VgwCf +aCR45JtzFnz0v4jCuooqaFGgH80An2BcoE/psLPTECGRDKE4v7JNADnCiEYEExEC +AAYFAkLj7WoACgkQMoZOQZyFIisbBgCeJjAXLGfz5ahDdgozqDYrbOzxWG8Ani7h +FwwxHFAIe42+OsL6xweRD46fiEYEExECAAYFAkLlELcACgkQUnkvr5l4r4ZbzQCe +MBjFzDvBIFmK5VNIvvcK3ejdDPwAoLzg1ytKCg3A0OebfMX9nr5iQOxwiEYEExEC +AAYFAkLlEaUACgkQa3OhBipiP3JevgCeJGjwezorOSri8IWxMJqTt3tOzkEAoMNZ +CTo3AmcKICFhtdttgcuOZNWAiEYEExECAAYFAkLmmWIACgkQaOuMdvjqKWfg8QCf +dYdGhkb7pBqgFhGn3uJ50+sY/QgAn1PdZCfRtVgdk/JVv35F7fJp5a1CiEYEExEC +AAYFAkLnYVcACgkQbpR1lMFSQxoJggCfQ7Du5ZKb7ooJj6CF+ne77nxVuYgAnjLF +1tZ19A1n+hPaT4A2nmfnW2tRiEYEEBECAAYFAkOHn54ACgkQZjW2wN6IXdPfvgCf +RhYzSFLrXLaM7hTa3iHktsQE1iUAn01MLep3eEdd3+VNPojrE8FlV+odtCpTdGVm +YW4gQm9kZXdpZyA8c3RlZmFuLmJvZGV3aWdAZnJlZW5ldC5kZT6IXAQTEQIAHAUC +PmiBXAIbAwQLBwMCAxUCAwMWAgECHgECF4AACgkQohFa4V9ri3JPKACfXhFOr4gM +MIQwEGvUb6J/X4asuzIAnje2H9T1r/jSVi1NbIEtQfbpmyQXiJkEEwECAAYFAj51 +3w8ACgkQPo+38viDQdmGkgPnUYJfHlDrQ2jYJWuPDve9n4pV9OvyIllKyLdfULjs +LWXw4Jm+fMQJgWr2GEov1ZYIyS2+rGDZpbz/vxaBVbgqM8TPdiXzxwU8AFq4k+Em +4fKXR58ByLSJjvLLza61spNHJennEUFp3tTpEsr4bNuuaoRYhtiKzTqNuoC+0x+I +RgQTEQIABgUCPnXaxwAKCRDu0eo5ImHQc5lcAJ9FOoAL4uHMuqHXrrxsEVPJvEJ2 +/ACggaOR62EziUqcqpdm/1Zy3P4T22iIPwMFED51qjj9b4jGIdCnGxECWssAoKnk +R63bWGCFDB5YJtfZJ+nQq3TAAKD1bzG/kITQpIHsT2vCY1yBmlWbBYhGBBARAgAG +BQI+d6QaAAoJEBU/oM11pnaS+9IAn0kFlXAzOhhu4r5fglMVuw5bTAd0AKCtYRX2 +ESU/+tsE8vuXWtsMCGeI5YhGBBARAgAGBQI+yi67AAoJENvSRfyzsqEsSccAoKqG +39X2y6xoQa56nviF5iCj/oTFAJwLKx9GyKEUbSM9f/IQ7AsZPhHT54hGBBMRAgAG +BQI+jc41AAoJEMppOXSBA6N+xYgAn1HbGamcXTDYSFjn3U5ik2vQa8nuAKC/uUM0 +1gsdn+71EiAkmrjlH6H9MIhGBBARAgAGBQJCuAqrAAoJEIEEZE9RiYUE0MUAn3cW +FVW03CDuMuA7TSUqTf/eWARWAKC/GjQnPZ0+g7NbDw68ZSY3k8WuuohGBBARAgAG +BQJBkvP5AAoJEOQTYTMMqmi0GIQAn1mpdHz/wV++rSU2Qn7R32slfNdpAKDJPqpn +mcN4MUmk90yZEeHAdJmrhIhGBBARAgAGBQJCxTKGAAoJEJvyI0Uv4ovP3YUAn1z8 +L1EnLdIYttWrT1zs0E89Lz4BAJ4sFzcSq2NO3OZsEQfh9F6CrUe3UohGBBARAgAG +BQJC30UMAAoJEEHqCaBXk0mPIUgAoOF/OCzco+n/3sGJ57m0+aqGLOwjAJ9bC86B +2hRvkaZlGm/ne3TzCgFGnohGBBARAgAGBQJC4DXTAAoJEHPOLvuECPdVsEoAn2hq +8w0JUtfJpu3SmMUkFZLBFm3+AJ48pxmjHXjoBJGpokXw4i9Cfb56BoibBBMBAgAG +BQJC3qxxAAoJEDGmPZbsFAuBGDUD93nHzcDWR6AuDxDvaDp1xR8oJZHojeZ9sWSR +QffiNJKF07vvdjGbygqiWbQmtTM9qBnAxEiBpSpJemBhvGTKivPkb9H88KQe2jqo +wDO3IJorIVMT+eUFB+4pn5c+kFLD/IhG7ohZ2rBIc47L62FFuD19esxvMcVelrBF +q67ZV4KInAQTAQIABgUCQt7H2QAKCRA34/Rf7mXjIY9vBADqrguzlNOJFkWvEkgd +VXCCH2TP3OUuPZ9JQtbJfbkg1nn1hCnMITapNJlEE3yyjB7kEpBkmUtyKv3VSwOD +spfis/ps6zJRIne/2R5xqtT38Hf/sYucoMZUceipFAoCLYOqkKJKwTpYM0401dUp +uxp1y8Lq5N0SDtTW9fKMNs9jioicBBMBAgAGBQJC32x5AAoJEJrNPMCpn3Xdek0E +ANLj3wh2FCukydsfSzqgjFDpkVjiBxbTtCep86flaLMrF3H0idckGCjMUf/JostB +sjwCpL2VlCtvhwl5ZgIzm8luceHupq2iC5hvUN0IjKuIXMLbZP7DE+Lfcvw82nKt +8JNPpjosXiMhysQZms2XfuNP6f/Ey8J5jaB2Z2JCYWJBiEYEExECAAYFAkLeuu0A +CgkQMsnkzjZCy0vBrgCglfCttIxFGqVTLTq/nhPnRFMHX9YAoM4Z05oTuPFxGWS4 +RzxCzCb3vpsAiEYEExECAAYFAkLfbHsACgkQUI6uxTAtpWgipACfTBzbyb7Vc0jr +2FZDiXJFUSBCoEYAnR+ySWmedkcJWESStqRstD8T72mOiEYEExECAAYFAkLfbH0A +CgkQ3bpkuiwxLS/5RACgm88lpYDxy0bYF9/ubFbvqCw6i9YAnjrQoOLRBtQ4QmIP +R+T/9HReOeSciEYEExECAAYFAkLgyTwACgkQXP03+sx4yJNXxQCffoccUBWO51YI +EM0mbsqpnKHtawoAn2xTiDgo3TjtbRJskADuw+QnATQLiEYEExECAAYFAkLg7MwA +CgkQybWm7OLXdN8bPwCfeKtfQWKm8i+KuFJTIoMTvAN65QQAn2A9G1wtEN4Vzg6H +fnTvtgus32rRiEYEExECAAYFAkLg7UAACgkQW5aAEOBPmonAkwCfeF3l1lE2WijQ +F0BmPMfqvkyA2UcAnRQzuc7PWyP0nydGoJvfEUHByVs7iEYEExECAAYFAkLiYm8A +CgkQbZiNF4cxXDEC6gCgqICh/djzt1i6uadJAOztZc/zxl0AnjR1OaM2JxR+wqK3 +loSTEKX1uOpBiEYEExECAAYFAkLjVcAACgkQEy5J1OQe3H7rRwCeJWLmLyPzpg3n +r65j7AxqGRJeDfUAnRT2Oa85dAM02wgdYlj3FejPuNFziEYEExECAAYFAkLjZNsA +CgkQdcqio/ObN1DA+gCeOaeMarEJDPbZjaN3y/Pf5PB/Cv0AoMGPjPSTGt/iHJ2a +Arfyd0ME/R52iEYEEBECAAYFAkLkbxQACgkQjON2uBzUhh+lnQCfVbPGF5UWlzFb +xK+xKmY2DbKXb5wAnjpoAxffSRO1PZlQUHgWlS+NaeCziEYEEBECAAYFAkLkkscA +CgkQBJE0Quobo40fbACgo9YCJXu5Hpoc/SVp3rHCYmTuEMYAoIt2q6rPL/Jbbkik +bRqausEnFstziEYEEBECAAYFAkLlwiAACgkQYRlqLjM+ToRP8wCeOVAIpaG+q9G7 +uJgVCyDZ0JbjjfIAoJgg+NrBfhNeOBuu5mS1PSGDztQ+iEYEEBECAAYFAkLqY/gA +CgkQsr68QBUpJK8HfwCfWgNlYNLBWmn/nejlx0m6NstT2CsAnRdhsusv6RbcKNoV +UudxGG4Xm3nGiEYEExECAAYFAkLj7WoACgkQMoZOQZyFIiv6jQCeMior8Tg4msrR +c+FfXfj5Uln03d4An3RTaHKU+Sv4SgEecXlW0RYlVa6eiEYEExECAAYFAkLlELcA +CgkQUnkvr5l4r4ZC9gCbB5X0rL/DtpGptiNO12DdTQqzsMMAoOWpJFg3W7zAr7al +Vjqlx0t1vS4KiEYEExECAAYFAkLlEaUACgkQa3OhBipiP3LYawCgiuQqhVay7FE8 +e05Za69seQwF4CYAnAxBVNyvXu/1aeAuSi3iC6tywvFoiEYEExECAAYFAkLmmWIA +CgkQaOuMdvjqKWfdbQCdHfDneYM+nWXT/oYOqohamLvk8iQAn1LLJhkLiCMOa9/b +iF24zKt+MjaHiEYEExECAAYFAkLnYVcACgkQbpR1lMFSQxog0ACgp/m7d/NdNP0w +605VyrJWCdogeG8An2E+FpFBQgyvJaD6klzDRNNYLc71iEYEEBECAAYFAkOHn54A +CgkQZjW2wN6IXdNgDgCfUVMGJZV/D1QEdnwrTkRmMb37KR4AnRLDWMsKtq4qKXQj +YbmuLNdHa1EQtCRTdGVmYW4gQm9kZXdpZyA8c3RlZmFuQHNhbWFmbG9zdC5kZT6I +XgQTEQIAHgUCQpxp5QIbAwYLCQgHAwIDFQIDAxYCAQIeAQIXgAAKCRCiEVrhX2uL +csktAJ9XkWAsu0zJ293dGa+Yban+Zr1V9ACg3b9Petds6ebqQZoiHRopckbbOLqI +RgQQEQIABgUCQrgKqwAKCRCBBGRPUYmFBP0VAKCPH0b7S+TylV1uBuYcYnWIb/RJ +zwCeJvRTMPnWNjVz+CVOvVzJTH4ol5mIRgQQEQIABgUCQsUyhgAKCRCb8iNFL+KL +z3iqAKCXRZWdGjBVbj3IBFl3kvh3xF2gsgCcD3H79mbVDRNMxpGArFQ1hqQFzleI +RgQQEQIABgUCQt9FDAAKCRBB6gmgV5NJjzHQAJ9IfkjKkiEuFxUhznsghAQ8bsBW +nACgoT0kWSB3iUepLIDoWhhGtDIS5FSInAQTAQIABgUCQt6scQAKCRAxpj2W7BQL +gebOBACAFFpEKETO3ZHbjMnPogACNr6EZCQxzGTIXrXSyWQs68VcH54wUOA4yk3c +GpfH2pgAxYjaHejTJRvDKvGrPGlKHgCZFy4+wHzo17pW9J1aKk2sUWlT67snDVdM +un/i8WxD9yz299cXR6iCxPfP2HIMEqbsxWJaXITo7drWSjO35YicBBMBAgAGBQJC +3sfZAAoJEDfj9F/uZeMhRawEAM9wfn9sBIsFzQRQbAO+ll83f8ki++A4Anj6DXQ4 +xRmClUxqahL1BjxxeQhE+Qomq1IebDJr0Se34XB0g3J7bzr/i9QmEwEqnDJfWVob +v1Ugjy+1jzErlZBhm8hnCI+zPnrWKLk0n78vzJ5RrnVaTTV+OW5r4rdVZ86yKYHt +pVSoiJwEEwECAAYFAkLfbHkACgkQms08wKmfdd0HDQP8DDD+1FQU8PPPe+Kuf2bJ +OO7Ycrej4JF1I/Gbs2HH3xXgOZsRv6WJ41M/ovxJLYrpVqQA2YF/Gxwguwrf4lPk ++4spFdabguiJK0d2/KZAtnLsjIzdYcoY01IKGT3xkPwIDErNFSmxX6bKCUePcFNH +YZ6dDBHFFcYVTsdo/wbAe6aIRgQTEQIABgUCQt6wsgAKCRD9b4jGIdCnG30UAKDC +xsPZksKIcvj7tbHQEwm+PV5+DwCg7PorUCgIvTIWnID8zRWDBG4ACXaIRgQTEQIA +BgUCQt667QAKCRAyyeTONkLLS/d2AJwM7BQIQgqLA0qA75R2EjHFXQKZWACgo7ia +ANHxIRc/Nw19j8CxNbWJRJ6IRgQTEQIABgUCQt9sewAKCRBQjq7FMC2laIx3AJsF +0Hjrm4N21EwdrmhS9PHKQL2KdgCgjlus2GyuCzafgb9JHVhBDrhelkmIRgQTEQIA +BgUCQt9sfQAKCRDdumS6LDEtL7MWAKC6rQU6ZjSS6gVnwswutaqBwfwtvwCgv2mM +GJf2hnYVaNNqV5WIFAuycmOIRgQTEQIABgUCQuDJOwAKCRBc/Tf6zHjIk9TlAJ9d +bM2HowI5oD6hGSnADhI2dKfBrQCg4O9WtFiRzLqC1TgCAsbigqy+JDiIRgQTEQIA +BgUCQuDszAAKCRDJtabs4td0311pAJ9L3yUe7GUeDqMzd3WLWatclf7ruQCeOenA +9nhyKgHASeEK/ZXQXDDBW0uIRgQTEQIABgUCQuDtQAAKCRBbloAQ4E+aibNVAJ4w +nAfcA/rtUs3+Hu9nNn8ar/2Q5wCfe6W+k9yHjd7hZWnYHdnCkAZkOMeIRgQTEQIA +BgUCQuJibwAKCRBtmI0XhzFcMezQAKCnk+So0Anm4kLDwl+srHvIB7b6jACgqROB +N5MeEGXQm+Gan2VSt+nvTZ+IRgQTEQIABgUCQuNVwAAKCRATLknU5B7cflR0AKCT +AlfhPFwHPXnBo+5IROopwNQnsQCgh2vHS9VRZRt5I9isNDaNf1biCQmIRgQTEQIA +BgUCQuNk2wAKCRB1yqKj85s3UK9XAKCELi7ymxtLxdwYfdfV3dxd63mV2wCgjgaU +lQqFXjx5mXnRsgy4S6cS9yuIRgQQEQIABgUCQuRvFAAKCRCM43a4HNSGH5/sAJ9J +VHMVwBwHD8PN3DQq8hHEumn8twCfVQSXooNY2P744K+8k6lLO8nOH6GIRgQQEQIA +BgUCQuSSxwAKCRAEkTRC6hujjb+qAJ0Z+AoGDYe122wRAOYAKayl9f9e0QCeKeto +ll6NZ+Rm/NKbFJGP6fYywIuIRgQQEQIABgUCQuXCIAAKCRBhGWouMz5OhDd7AJ40 +l37cLZcSxfPt3M7/aOPgVGpa5wCfciaEynzuHDfIQD/vtXrZb2m0+NeIRgQQEQIA +BgUCQupj+AAKCRCyvrxAFSkkrwQsAJwM8IqtXQk/TBiQi6Fyq/HHm5/zvACg5atZ +V8F+r7jVRhT1SJ+FaVsaQDiIRgQTEQIABgUCQuPtagAKCRAyhk5BnIUiKwuyAJwO +ljL2++fVQ0BSKRvFSvS+fSu3KACeJxsOhbyCd3o3rqwaVeY5FFi+Fm+IRgQTEQIA +BgUCQuUQtwAKCRBSeS+vmXivhv0OAJ0Sg/UEnB/IAoqjHzKoBivCMYDtrQCfVY3I +DKRHbbLNfWBSDERWCTpHXtiIRgQTEQIABgUCQuURpQAKCRBrc6EGKmI/cqGBAKDE +gTewzt6TjmCkI9RrYjF46a9H4wCeJPh4bmTymcfwRGn60h0a9Mz1mKaIRgQTEQIA +BgUCQuaZYgAKCRBo64x2+OopZ3lEAJ9w4EWAgRUMxf0Ud1zoygYDQedAgQCeJPHS +bk62Ej11NljNGN1zdwzRHuSIRgQTEQIABgUCQudhVwAKCRBulHWUwVJDGkOfAKCg +QM+50dTktJDaDd8gVOGBKRiSIgCgkT9gdtDac0m9s2IHAqktk0mc0U+IRgQQEQIA +BgUCQ4efngAKCRBmNbbA3ohd05uvAKCjMnn4GpnZhjWFS7iN0LIXgxm5PwCfYodj +KF5zSbIROx79dJ41Gg0/VxW0KFN0ZWZhbiBCb2Rld2lnIDxzdGVmYW4uYm9kZXdp +Z0BlcG9zdC5kZT6IdwQwEQIANwUCQsVK6jAdIEkgbm8gbG9uZ2VyIGhhdmUgYWNj +ZXNzIHRvIHRoYXQgZW1haWwgYWRkcmVzcy4ACgkQohFa4V9ri3LW7wCdEc6hdCr0 +94a8LG+chTd+OzGxfFUAnR3FvtuG8sv367Knk0ybMnpOM/4hiEYEEBECAAYFAj53 +pBoACgkQFT+gzXWmdpL1ewCeOSe7lOufhc3mfTXs7eSvqECt89oAn0VM+YgQHbfd +Vp32YE7Ht6N6GPf0iJkEEwECAAYFAj513w8ACgkQPo+38viDQdkP7QPmPZXPi7m6 +wRiLofsTlHCbBrR+ehWoSSqCmHQjN1DGRtamGE6X8QbMIttD+NLp+uTx8j/E0sGU +dPnWkky6fwt1f3AYeoAgCXNvPoewsC6mZn3FMdEo6vJc43FmhsUfumOtunvGNBnX +dM8GSCJ+RBS/ASMjRrECF12/14xwgyyIVwQTEQIAFwUCPD7aNgULBwoDBAMVAwID +FgIBAheAAAoJEKIRWuFfa4tys/4AoND5QhEdyVIypBvCUHv5SCaAKcd/AKDFthtZ +TrjF+eEYlktPLRtI9zjeE4hGBBMRAgAGBQI+jc41AAoJEMppOXSBA6N+jAIAoIcA +eCIKt2QBPnAthnUk4DhlmM7FAKCA0Iz9ZutXGb2l+p8s7hhF3+Y9L4hGBBMRAgAG +BQI+ddrHAAoJEO7R6jkiYdBzi84AnRddvByuDodl5KaCSdpe6k9aYkLqAJoC/ud2 +8X0M478KlmacVVjb+PqzBIg/AwUQPnWqLv1viMYh0KcbEQJ6DwCff918LRigFUyE +vYj04C12so87JNUAn0RNFw+P1/SR9Mr/JQmOzJVhlwdriEYEEBECAAYFAkLFMoYA +CgkQm/IjRS/ii8+wZwCfRvfW6NyBoAp7oS9ILRHNYh2GbhsAnRYGs1hSaGK4rGxm +/fmqxj+DvqI2uQENBDsSIlQQBADNUpZLxCuTKzJ1tMm7b/XjAhvPYKiL3doAZ6XA +LBdLF/nQmlh1jcuRy93QWpPxtwSfPjcwJLHy+Uq5tC1SnH1YwYhviLG1KEsniUBr +oUmV2HJyHP92fFI3LPk3xbqxvLh1NXFpzSuWjGMA66sZqeEbtMy2B8OLRwQShdHI +BWgrIwADBQP+PWkmbg2mraaUmgTswre8CGArBgcV+WYm6yaq9IC1G4V1PXmlswms +DlsAr6UDdJU46GFZMIi2WmFJHarEkIBwFN44ypSLmiEVwKRJE2/CYO0f7zQHcF6G +USwQo2TxneahrZyHs7GdvpcRcfm0YnlC/H1CJ3pl8FpfHttzzIrIJviITgQYEQIA +BgUCOxIiVAASCRCiEVrhX2uLcgdlR1BHAAEBDTIAoJ3NtpI/E345LVOruElFKrnd +uWWXAJ9Adm9Mz4yoxrosHSkp5BWzXBUt4A== +=95C5 +-----END PGP PUBLIC KEY BLOCK----- + +pub 1024D/C152431A 2005-07-18 [expires: 2010-07-17] +uid Steve Loughran <stevel@apache.org> +sig 3 C152431A 2005-07-18 Steve Loughran <stevel@apache.org> +sig 2 FC243F3C 2005-07-20 Henk P. Penning <penning@cs.uu.nl> +sig 3 302DA568 2005-07-21 Rodent of Unusual Size (DSA) <coar@Apache.Org> +sig 3 2C312D2F 2005-07-21 Rodent of Unusual Size <coar@OpenSource.Org> +sig 3 E04F9A89 2005-07-22 Roy T. Fielding <fielding@gbiv.com> +sig 8103A37E 2005-07-20 Andre Malo <nd@apache.org> +sig 5793498F 2005-07-21 Tim Ellison <tim@ellison.name> +sig E4136392 2005-07-21 Noel J. Bergman <noel@apache.org> +sig 1CD4861F 2005-07-25 Eran Chinthaka <chinthaka@apache.org> +sig EA1BA38D 2005-07-25 Ajith Harshana Ranabahu (Made at Apachecon 2005) <ajith@apache.org> +sig 3 21D0A71B 2005-07-20 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 3 3642CB4B 2005-07-20 Martin Kraemer <martin@apache.org> +sig 3 2261D073 2005-07-20 Astrid Kessler (Kess) <kess@kess-net.de> +sig 3 E2D774DF 2005-07-22 Sylvain Wallez <sylvain@apache.org> +sig 3 015AFC8A 2005-07-22 Bertrand Delacretaz <bdelacretaz@apache.org> +sig 3 E41EDC7E 2005-07-24 Carsten Ziegeler <cziegeler@apache.org> +sig 3 F39B3750 2005-07-24 Colm MacCarthaigh <colm@stdlib.net> +sig 3 9C85222B 2005-07-24 Henning Schmiedehausen <hps@intermeta.de> +sig 3 9978AF86 2005-07-25 Christoph Probst <chris@netzpunkt.org> +sig 3 2A623F72 2005-07-25 Christoph Probst <chris@netzpunkt.org> +sig 3 F8EA2967 2005-07-26 Brian McCallister <brianm@apache.org> +sig 3 A99F75DD 2005-07-21 Rodent of Unusual Size <coar@OpenSource.Org> +sig 3 EC140B81 2005-07-20 Dirk-Willem van Gulik (http://www.anywi.com/ - Senior partner) <dirkx@anywi.com> +sig 3 EE65E321 2005-07-20 Martin Kraemer <martin@apache.org> +sig 152924AF 2005-07-29 Sander Temme <sander@temme.net> +sig 3 87315C31 2005-07-23 Raphaël Luta <raphael.luta@aptiwan.com> +sub 2048g/59066D7B 2005-07-18 [expires: 2010-07-17] +sig C152431A 2005-07-18 Steve Loughran <stevel@apache.org> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.2 (GNU/Linux) + +mQGiBELb2+oRBADhgEV29jhAMg4dFJN9fjeIjN7+J0Lj3rcLBWc5RTlM33DTOCFM +BCIE9B/RXJuVhGgi7fUuB+WsHz7XMgZRn+5nqIKGecIxwEUtZCfwsaV6Id3abt30 +wccyYDTSV95gQie+bbwWF44ao7n/CaR1WUU/Nx5b26nY2EzOrQcgP1qYEwCgynnc +NU1N3zd1cIYr5hQVqvdazKsEAMbYAm5WsjBlLBrolxs/smx4vxZYJaA3gUqTz9WY +D08rDsotVIMoosYF0b4b3WxcePJ68N1pkF3U+zo8bIZJThT91nAfMh29ZAcSyRqg +Mkd25OcrrjykeF7OavuFSwhvYoDdlwsvkuijHY3weXyhpjvzi+GzvZoONo3zSl4g +aWncA/4vu6k7XZUZ6B9DbJLJ4Xqq8uhD7uT4417uCQdozIWgKE4ThM2WffhV2IgY +W6IXg+o6AqY1qiMLSYYdeRsVkQ/GVss+sR++cbsO5ijDGfvlWPfGxIcA+P+alAwf +KY9M45IB8E92DUDru6ImrDHMeOrlDNPRusxRyZ4SiSJYNcgBtLQiU3RldmUgTG91 +Z2hyYW4gPHN0ZXZlbEBhcGFjaGUub3JnPohhBBMRAgAhBQJC29vqBQkJZgGABgsJ +CAcDAgMVAgMDFgIBAh4BAheAAAoJEG6UdZTBUkMaZugAnjJVyMa1FYEm/9811Whm +K06kGzXbAJ4rgRTBOcuyVbmbOAeYCgqloOxky4hGBBIRAgAGBQJC3rlGAAoJEIuW +KUP8JD88RewAn3LmpnmnLlYnlQW7+byITmKLO9gwAKCi0GGQz0QUq9tFG4YeF7Rp +UCl8ZIhGBBMRAgAGBQJC32y8AAoJEFCOrsUwLaVof1cAoLX3ROO9ufH+QXYlBuy6 +HA5SgofAAJ9aON/jC3WmrxT9Lz/DlIBKVI9TZohGBBMRAgAGBQJC32zBAAoJEN26 +ZLosMS0vCycAnjFhGc63FoWHwzpfVoocrBm8yQTHAJ47Kle1Tr+fBnlkYsAg0xY6 +12VZ9YhGBBMRAgAGBQJC4PEqAAoJEFuWgBDgT5qJY6IAnj2jxdReXh3eBRr+easP +bboH9Lu0AKCSoT0Gt+pM+G7XM8vQbZjsyjDhrohMBBARAgAMBQJC3t+3BYMJYv2z +AAoJEMppOXSBA6N+4VAAnRfGDGvU4qDop0EdApmHCExFDHFDAJ9/3xZDnJjEeSGr +l2JyOPJfbv/k0YhMBBARAgAMBQJC30/tBYMJYo19AAoJEEHqCaBXk0mPRKwAoI0M +FDyhr2PON57N4614Po16a9ZNAJ0SGKJtMOIxgoDHSf6SYuFy+8sBLYhMBBARAgAM +BQJC35MFBYMJYkplAAoJEAEFZrzkE2OSgcsAnjKv4POPmFUYhDGH+GCcxSyM9LPo +AJ0TPnoLf74lUroWD5+rlhTPD9eMHYhMBBARAgAMBQJC5HvtBYMJXWF9AAoJEIzj +drgc1IYfdCAAoIKybYLGd4yGE8NcrvnGaPSXx6NXAJ4zrIPA9tQu23tOHarZxSqg +7AWGh4hMBBARAgAMBQJC5JCBBYMJXUzpAAoJEASRNELqG6ONWZsAniJvvMiDR61N +rV5Y7xx/3/id/ekWAJ9MNUUQAXTES1dkywQVHVp6C8QFvohMBBMRAgAMBQJC3rR1 +BYMJYyj1AAoJEP1viMYh0Kcb26oAn2JuF355Lq6PIEvnhEr+SA3noxS8AJ9msBXz +nHsORsz8mB4WZ4DMAYEH0YhMBBMRAgAMBQJC3rvoBYMJYyGCAAoJEDLJ5M42QstL +Cu0An2vCOimm9iyRJekvlh7IcsrXVDksAJ9S1iVXBgyRuWBkbcuRk9OLs/TnwohM +BBMRAgAMBQJC3twlBYMJYwFFAAoJEO7R6jkiYdBz3gkAn3b48pHpjPG5DCbfp0oT +/WN9IqYlAJ47CLk2xg7e8N53WTmYfL+F/c/ZrohMBBMRAgAMBQJC4O0jBYMJYPBH +AAoJEMm1puzi13Tf+KgAnjviBj4kvC9ABiWR70t4BU3y8kgJAJ9qmj71qWjrek/L +Cb3+fAmlASx82IhMBBMRAgAMBQJC4O20BYMJYO+2AAoJEDf2j/UBWvyKJywAnjSC +smaB18utPgHthVW0qDQ+DDmNAJ9a64uKqcDI7u1cDEbi3nL5ELztCohMBBMRAgAM +BQJC41snBYMJXoJDAAoJEBMuSdTkHtx+SyUAn19MjVdnPdxKdiXjpMRWwOs5fhTL +AJ9AGh+TvyOt877cfLVaywPK+GhN0ohMBBMRAgAMBQJC42UQBYMJXnhaAAoJEHXK +oqPzmzdQe9gAoL7BugDd1NniX/ZNqs0aD7Y1uUfhAJ0b4p34ZYPWFg1CyUduwYlx +MAOqo4hMBBMRAgAMBQJC4+3gBYMJXe+KAAoJEDKGTkGchSIrHl8An0ERlWCCDHYy +0jlbsVcQ4FOS9qe6AJ4sLF02AltG01bK1kpvnKXxHFVYoIhMBBMRAgAMBQJC5RDw +BYMJXMx6AAoJEFJ5L6+ZeK+GWEkAoIl+GM1cgJosSMsMG0NqXog9yqeKAJ9aJ0Xr +j7JP5abRyjROroIUCUcc4ohMBBMRAgAMBQJC5RHdBYMJXMuNAAoJEGtzoQYqYj9y +IawAn3TzgRnJPfl4gg2kwIlJtD/a4ql5AJ43+Bbg3EWh2RVaLB7QpA1pAsRFB4hM +BBMRAgAMBQJC5pnVBYMJW0OVAAoJEGjrjHb46ilnWz8An1WpumoYARq3Le1VG0vu +SkQcdg8SAJ488MHNQRq2fyQFk9uIstWriQfa7YicBBMBAgAGBQJC32y2AAoJEJrN +PMCpn3Xdsl0D/j7J+/vobH/4+pmWCWv3okqBbbd9PH/NJTC3B7KU+p8bFdIIZWYh +n9SPXRdLoUlbKnqYw6+x0Ktn/9oWqwTM2b1bOHoMEUy/hPDM1ZK2gGDU11BFbfC4 +zkXowbq2xCHLyaQXqj5Wju01PT/wj8bw5A0E2rzv2iUA2ilXJE1vQdx+iKIEEwEC +AAwFAkLerQ0FgwljMF0ACgkQMaY9luwUC4H6jAP+L3lvntIdecj0QlnD4gTkdLn+ +nbOPT0G9MPSjA3ML9Bqeoh/uD2TeHS0dqb67DpIzhKV/zu6vrOhsXHXNiCjR4lxR +YHBg0PoxLJkggpjdAduk5vcM2ZgRJZQojsQ9CunxnmA/YCRCEEUPFeKj/5p1aFGm +uPsl2zwggHxbdOBY1maIogQTAQIADAUCQt7IywWDCWMUnwAKCRA34/Rf7mXjITNS +A/9YB8srHD2WbpZy5P/cN6WjPshYgx0lVFOifFdXgD4AUzgJ3VmtH1NI0Rkgadcw +8PdJYAynH/Hdz4PJ8wIEkmMFEe6TKB3BCjCGY8+Ti6R/VrlkizIGL0HzAUzNc+g2 +D1NI8725Idx+XNSOSBcOBZ3mwPVo1k67X1rF8BoYAeo8TohMBBARAgAMBQJC6mYn +BYMJV3dDAAoJELK+vEAVKSSv8BwAniQzr7l/ihVvAhvNUnpJzFWfr6tfAJ93Mama +D+Fz4kgEVjnO5j8MrM6JtIhMBBMRAgAMBQJC4mNBBYMJX3opAAoJEG2YjReHMVwx +Pr4AmQGWlApW3C1VbkuRgVs8pj6/ejXqAKC1z3D5mMpj83yyejnBjxDjXTLsUbkC +DQRC29vxEAgA05PNdXcVOSTsYuizTCbdBU9i3qUBkAyqPmDE6hkWI+7fnr8KAUUo +UghWwhxqBngpv48o3mE+bC+l/cTH+DuHIOsszpSK5ydufyitXi7piYk4RS+UNbyl +b4BU5qGodwWwXC9wKBIjXL5rK2KjKh4Ovh0WogtZ1fwc5NzQkjcfbner9WsAmjtd +nmVV2vZhJdDlxf3BBM9ai2R2IRvfhF61QFZcr2ehqAdsiDix8p0ugpC/oQS8h8pg +GQebz7aNeSjh/Vb3dsdo8CaLvHp1nM5aVCDRqoCfoeKUbRfwwwKxtc1cyYzOHD1f +KG9BuvtL4y4JQ/gDCsQVKdAAoiktu8Ks9wADBQf/fGkVYIh7w0+8xSIvez1DKirX +rl1J3XNvOYIa1qlBk65hllXnFXeXqoOLQpvygcwNRfil3AGcpwzwlNloem3ozjnt +IFvYJYzB6q4SMl1/a5uLrcc2frq8tbG0RhU+ZEhWR6sIEOBQhkKZ9LZbJ1tK9buJ +M0meaIt5gVLAVbI5vf+2Lvmlv0+E/a4Zn2exl1RcBYATNZT1gC55m0z5PMzG6Bc4 +tOAhPEo3WpfNjIrFeXcB0ksk4mfDIWKlA0mc8A+faKSSMdiDpeU4H4uZy5pE/hVv +2VyE3Ej5PoA3DajRzgQ69YlojTYnfnPyJErCBZhtZXTtRY7aDm9/xBT7FZ06RIhM +BBgRAgAMBQJC29vxBQkJZgGAAAoJEG6UdZTBUkMakjEAoINKV6yLAdbBhXhvMsqK +0N6XOghJAJ4mSgdwgv+sIOaPKQqCm+PL2M0lPw== +=4TlI +-----END PGP PUBLIC KEY BLOCK----- + +pub 1024D/AA0077B0 2006-06-13 +uid Kev Jackson (apache key) <kevj@apache.org> +sig 3 AA0077B0 2006-06-13 Kev Jackson (apache key) <kevj@apache.org> +sub 2048g/8A6DD738 2006-06-13 +sig AA0077B0 2006-06-13 Kev Jackson (apache key) <kevj@apache.org> + +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: GnuPG v1.4.1 (Darwin) + +mQGiBESOfuoRBADiCLjvY8EG8cDrfNvPaVJr1/8d8GDoLjBCeJWl50M7j1IQDB+r +rzBPXOzhoqiNRbZMkpjv8ofa5hVOQitVS4B69FA07RbuiQNTKg142h8ogtJeAI1g +eXuTZtmGE47TOpj7FMG8bHOmoJdQMkzUsdOhEAyqRu4noknuuIKgsE1kYwCgnhaH +9KBlpKaRG7Bb2BH6da+wmKUEAIaBeZ1aSQodUzDqnGjCd4hZbpzjyWg7O5BylNhK +ogMY95BvwFRD8WFdSvhvH9VKBtSuNqg/6gIkqAljRRESVxL4QrzlYSqF513kK1ds +lUTmqU9Dvaf7dkH+MYnkPVTP5tMZVCT7HEt4F6HcqlaZKlz5jsu3R53KBx6XZATc +SEGbA/wOournJ64We8sXTJGHFupvSLBy3nh68mPLaplzTnH2al1DLBnoF2giC32v +ZGG+e12kWE+fyyQ3pdAIRHgVjZ/ckPmcmxnVcYrhzbgV99fo2+JRh2SVrLrmvw+G +CKiUtNHn0HS1klBKSj+3ML1AQQlbyfrcVSf0Fefug51BqoqU+rQqS2V2IEphY2tz +b24gKGFwYWNoZSBrZXkpIDxrZXZqQGFwYWNoZS5vcmc+iF4EExECAB4FAkSOfuoC +GwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQoL/5PaoAd7BnTACff9f8Y2RFB7O7 +Wjncyb1XbEwJB/gAninrR0isW9jGx49GmSnQCjtO9k34uQINBESOfzMQCACP+GP2 +x2nE2JxjUUjj16ftOxUivbL8L9ksplx41n7yeRvu+RzOXcjlonuld0LYxprNsHGv +mbAoZj93QozHQIMfC2kfnia+hxCcBPMbev9RPCqgogpb90BtV0f9HGyWXs2QTgWG +R2hyjq/RpwtA3obSXw3pb1CnXW4stV65WAdd72KDc66wRR1gmjxKQx6b1dGcC+E4 +HyOgu2CDtr1ULPeI5U4BA4y8FLgDfYwkxp6vj5ViegGP7GlMa3bSgNRGsYX7VwgZ +pmI8WY4B5k3/Pyv2Toe6/5zTmKH8WlyZd00ede/tbFTqQLg+EylAcWJ8c3asood+ +SjCwTuD8l8a0wpO3AAMHB/9GXkbBUE8cbMTaS4yj7UL5iWRVhSPo9IzMSrzaXmZN +8ykX96ud35BCEfmYgty3USMk90Rs/PbwB4Mh3h1ZTXqRWcfOXzJ8kMabm2RANyf2 +H2DvGKoFPtpX/9I13vo9qRLRHVRENNg+3JCa1ii8cq7h8bWvTT0VxX/rOG0cl8nO +XkHTUARR19cGPf6XkHEcl+u1pAxIJGqY/gVowjyFGZs+RXFl/q/Vrgu+lvvxmryd +yEdeGdsBvQ9M0KKr98w1RiJnDUkSqI711xwlVk14Uu6Xke0oB3bbpe4UxD52avAC +yEzYY7vbpe6XS2+dOcZxWE3eur6SfsucAkj4Ib72mchhiEkEGBECAAkFAkSOfzMC +GwwACgkQoL/5PaoAd7BQAwCeJFb9yZvOWfdf73A7t2MvPXn1y6kAnRquMmA5eVdh +HbAUXWyYuT2OHOSD +=F2q3 +-----END PGP PUBLIC KEY BLOCK----- diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE new file mode 100644 index 00000000000..f820d4bd3a6 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE @@ -0,0 +1,203 @@ +/* + * Apache License + * Version 2.0, January 2004 + * http://www.apache.org/licenses/ + * + * TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + * + * 1. Definitions. + * + * "License" shall mean the terms and conditions for use, reproduction, + * and distribution as defined by Sections 1 through 9 of this document. + * + * "Licensor" shall mean the copyright owner or entity authorized by + * the copyright owner that is granting the License. + * + * "Legal Entity" shall mean the union of the acting entity and all + * other entities that control, are controlled by, or are under common + * control with that entity. For the purposes of this definition, + * "control" means (i) the power, direct or indirect, to cause the + * direction or management of such entity, whether by contract or + * otherwise, or (ii) ownership of fifty percent (50%) or more of the + * outstanding shares, or (iii) beneficial ownership of such entity. + * + * "You" (or "Your") shall mean an individual or Legal Entity + * exercising permissions granted by this License. + * + * "Source" form shall mean the preferred form for making modifications, + * including but not limited to software source code, documentation + * source, and configuration files. + * + * "Object" form shall mean any form resulting from mechanical + * transformation or translation of a Source form, including but + * not limited to compiled object code, generated documentation, + * and conversions to other media types. + * + * "Work" shall mean the work of authorship, whether in Source or + * Object form, made available under the License, as indicated by a + * copyright notice that is included in or attached to the work + * (an example is provided in the Appendix below). + * + * "Derivative Works" shall mean any work, whether in Source or Object + * form, that is based on (or derived from) the Work and for which the + * editorial revisions, annotations, elaborations, or other modifications + * represent, as a whole, an original work of authorship. For the purposes + * of this License, Derivative Works shall not include works that remain + * separable from, or merely link (or bind by name) to the interfaces of, + * the Work and Derivative Works thereof. + * + * "Contribution" shall mean any work of authorship, including + * the original version of the Work and any modifications or additions + * to that Work or Derivative Works thereof, that is intentionally + * submitted to Licensor for inclusion in the Work by the copyright owner + * or by an individual or Legal Entity authorized to submit on behalf of + * the copyright owner. For the purposes of this definition, "submitted" + * means any form of electronic, verbal, or written communication sent + * to the Licensor or its representatives, including but not limited to + * communication on electronic mailing lists, source code control systems, + * and issue tracking systems that are managed by, or on behalf of, the + * Licensor for the purpose of discussing and improving the Work, but + * excluding communication that is conspicuously marked or otherwise + * designated in writing by the copyright owner as "Not a Contribution." + * + * "Contributor" shall mean Licensor and any individual or Legal Entity + * on behalf of whom a Contribution has been received by Licensor and + * subsequently incorporated within the Work. + * + * 2. Grant of Copyright License. Subject to the terms and conditions of + * this License, each Contributor hereby grants to You a perpetual, + * worldwide, non-exclusive, no-charge, royalty-free, irrevocable + * copyright license to reproduce, prepare Derivative Works of, + * publicly display, publicly perform, sublicense, and distribute the + * Work and such Derivative Works in Source or Object form. + * + * 3. Grant of Patent License. Subject to the terms and conditions of + * this License, each Contributor hereby grants to You a perpetual, + * worldwide, non-exclusive, no-charge, royalty-free, irrevocable + * (except as stated in this section) patent license to make, have made, + * use, offer to sell, sell, import, and otherwise transfer the Work, + * where such license applies only to those patent claims licensable + * by such Contributor that are necessarily infringed by their + * Contribution(s) alone or by combination of their Contribution(s) + * with the Work to which such Contribution(s) was submitted. If You + * institute patent litigation against any entity (including a + * cross-claim or counterclaim in a lawsuit) alleging that the Work + * or a Contribution incorporated within the Work constitutes direct + * or contributory patent infringement, then any patent licenses + * granted to You under this License for that Work shall terminate + * as of the date such litigation is filed. + * + * 4. Redistribution. You may reproduce and distribute copies of the + * Work or Derivative Works thereof in any medium, with or without + * modifications, and in Source or Object form, provided that You + * meet the following conditions: + * + * (a) You must give any other recipients of the Work or + * Derivative Works a copy of this License; and + * + * (b) You must cause any modified files to carry prominent notices + * stating that You changed the files; and + * + * (c) You must retain, in the Source form of any Derivative Works + * that You distribute, all copyright, patent, trademark, and + * attribution notices from the Source form of the Work, + * excluding those notices that do not pertain to any part of + * the Derivative Works; and + * + * (d) If the Work includes a "NOTICE" text file as part of its + * distribution, then any Derivative Works that You distribute must + * include a readable copy of the attribution notices contained + * within such NOTICE file, excluding those notices that do not + * pertain to any part of the Derivative Works, in at least one + * of the following places: within a NOTICE text file distributed + * as part of the Derivative Works; within the Source form or + * documentation, if provided along with the Derivative Works; or, + * within a display generated by the Derivative Works, if and + * wherever such third-party notices normally appear. The contents + * of the NOTICE file are for informational purposes only and + * do not modify the License. You may add Your own attribution + * notices within Derivative Works that You distribute, alongside + * or as an addendum to the NOTICE text from the Work, provided + * that such additional attribution notices cannot be construed + * as modifying the License. + * + * You may add Your own copyright statement to Your modifications and + * may provide additional or different license terms and conditions + * for use, reproduction, or distribution of Your modifications, or + * for any such Derivative Works as a whole, provided Your use, + * reproduction, and distribution of the Work otherwise complies with + * the conditions stated in this License. + * + * 5. Submission of Contributions. Unless You explicitly state otherwise, + * any Contribution intentionally submitted for inclusion in the Work + * by You to the Licensor shall be under the terms and conditions of + * this License, without any additional terms or conditions. + * Notwithstanding the above, nothing herein shall supersede or modify + * the terms of any separate license agreement you may have executed + * with Licensor regarding such Contributions. + * + * 6. Trademarks. This License does not grant permission to use the trade + * names, trademarks, service marks, or product names of the Licensor, + * except as required for reasonable and customary use in describing the + * origin of the Work and reproducing the content of the NOTICE file. + * + * 7. Disclaimer of Warranty. Unless required by applicable law or + * agreed to in writing, Licensor provides the Work (and each + * Contributor provides its Contributions) on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + * implied, including, without limitation, any warranties or conditions + * of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + * PARTICULAR PURPOSE. You are solely responsible for determining the + * appropriateness of using or redistributing the Work and assume any + * risks associated with Your exercise of permissions under this License. + * + * 8. Limitation of Liability. In no event and under no legal theory, + * whether in tort (including negligence), contract, or otherwise, + * unless required by applicable law (such as deliberate and grossly + * negligent acts) or agreed to in writing, shall any Contributor be + * liable to You for damages, including any direct, indirect, special, + * incidental, or consequential damages of any character arising as a + * result of this License or out of the use or inability to use the + * Work (including but not limited to damages for loss of goodwill, + * work stoppage, computer failure or malfunction, or any and all + * other commercial damages or losses), even if such Contributor + * has been advised of the possibility of such damages. + * + * 9. Accepting Warranty or Additional Liability. While redistributing + * the Work or Derivative Works thereof, You may choose to offer, + * and charge a fee for, acceptance of support, warranty, indemnity, + * or other liability obligations and/or rights consistent with this + * License. However, in accepting such obligations, You may act only + * on Your own behalf and on Your sole responsibility, not on behalf + * of any other Contributor, and only if You agree to indemnify, + * defend, and hold each Contributor harmless for any liability + * incurred by, or claims asserted against, such Contributor by reason + * of your accepting any such warranty or additional liability. + * + * END OF TERMS AND CONDITIONS + * + * APPENDIX: How to apply the Apache License to your work. + * + * To apply the Apache License to your work, attach the following + * boilerplate notice, with the fields enclosed by brackets "[]" + * replaced with your own identifying information. (Don't include + * the brackets!) The text should be enclosed in the appropriate + * comment syntax for the file format. We also recommend that a + * file or class name and description of purpose be included on the + * same "printed page" as the copyright notice for easier + * identification within third-party archives. + * + * Copyright [yyyy] [name of copyright owner] + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE.dom b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE.dom new file mode 100644 index 00000000000..05013f1985f --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE.dom @@ -0,0 +1,71 @@ +This license came from: +http://www.w3.org/Consortium/Legal/copyright-software-19980720 + + +W3C® SOFTWARE NOTICE AND LICENSE +Copyright © 1994-2001 World +Wide Web Consortium, <a href="http://www.w3.org/">World +Wide Web Consortium</a>, (<a href= +"http://www.lcs.mit.edu/">Massachusetts Institute of +Technology</a>, <a href="http://www.inria.fr/">Institut National de +Recherche en Informatique et en Automatique</a>, <a href= +"http://www.keio.ac.jp/">Keio University</a>). All Rights Reserved. +http://www.w3.org/Consortium/Legal/ + +This W3C work (including software, documents, or other related +items) is being provided by the copyright holders under the +following license. By obtaining, using and/or copying this work, +you (the licensee) agree that you have read, understood, and will +comply with the following terms and conditions: +Permission to use, copy, modify, and distribute this software +and its documentation, with or without modification, for any +purpose and without fee or royalty is hereby granted, provided that +you include the following on ALL copies of the software and +documentation or portions thereof, including modifications, that +you make: + +The full text of this NOTICE in a location viewable to users of +the redistributed or derivative work. + +Any pre-existing intellectual property disclaimers, notices, or +terms and conditions. If none exist, a short notice of the +following form (hypertext is preferred, text is permitted) should +be used within the body of any redistributed or derivative code: +"Copyright © [$date-of-software] World Wide Web Consortium, (Massachusetts Institute of +Technology, Institut National de +Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. +http://www.w3.org/Consortium/Legal/" + +Notice of any changes or modifications to the W3C files, +including the date changes were made. (We recommend you provide +URIs to the location from which the code is derived.) + +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND +COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF +MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE +USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD +PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, +SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE +SOFTWARE OR DOCUMENTATION. + +The name and trademarks of copyright holders may NOT be used in +advertising or publicity pertaining to the software without +specific, written prior permission. Title to copyright in this +software and any associated documentation will at all times remain +with copyright holders. +____________________________________ +This formulation of W3C's notice and license became active on +August 14 1998 so as to improve compatibility with GPL. This +version ensures that W3C software licensing terms are no more +restrictive than GPL and consequently W3C software may be +distributed in GPL packages. See the older formulation for the +policy prior to this date. Please see our Copyright FAQ for common +questions about using materials from +our site, including specific terms and conditions for packages like +libwww, Amaya, and Jigsaw. +Other questions about this notice can be +directed to site-policy@w3.org. + +webmaster diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE.sax b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE.sax new file mode 100644 index 00000000000..006c924b263 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE.sax @@ -0,0 +1,20 @@ +This license came from: http://www.megginson.com/SAX/copying.html + However please note future versions of SAX may be covered + under http://saxproject.org/?selected=pd + + +This page is now out of date -- see the new SAX site at +http://www.saxproject.org/ for more up-to-date +releases and other information. Please change your bookmarks. + + +SAX2 is Free! + +I hereby abandon any property rights to SAX 2.0 (the Simple API for +XML), and release all of the SAX 2.0 source code, compiled code, and +documentation contained in this distribution into the Public Domain. +SAX comes with NO WARRANTY or guarantee of fitness for any +purpose. + +David Megginson, david@megginson.com +2000-05-05
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE.xerces b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE.xerces new file mode 100644 index 00000000000..70cb54a0d2d --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/LICENSE.xerces @@ -0,0 +1,56 @@ +/* + * The Apache Software License, Version 1.1 + * + * + * Copyright (c) 1999-2002 The Apache Software Foundation. All rights + * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, + * if and wherever such third-party acknowledgments normally appear. + * + * 4. The names "Xerces" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was + * originally based on software copyright (c) 1999, International + * Business Machines, Inc., http://www.ibm.com. For more + * information on the Apache Software Foundation, please see + * <http://www.apache.org/>. + */ diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/NOTICE b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/NOTICE new file mode 100644 index 00000000000..5ef72b968d6 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/NOTICE @@ -0,0 +1,20 @@ + ========================================================================= + == NOTICE file corresponding to the section 4 d of == + == the Apache License, Version 2.0, == + == in this case for the Apache Ant distribution. == + ========================================================================= + + Apache Ant + Copyright 1999-2006 The Apache Software Foundation + + This product includes software developed by + The Apache Software Foundation (http://www.apache.org/). + + This product includes also software developed by : + - the W3C consortium (http://www.w3c.org) , + - the SAX project (http://www.saxproject.org) + + The <sync> task is based on code Copyright (c) 2002, Landmark + Graphics Corp that has been kindly donated to the Apache Software + Foundation. + diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/README b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/README new file mode 100644 index 00000000000..263c111d542 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/README @@ -0,0 +1,70 @@ + + A N T + + + What is it? + ----------- + + Ant is a Java based build tool. In theory it is kind of like "make" + without makes wrinkles and with the full portability of pure java code. + + + Why? + ---- + + Why another build tool when there is already make, gnumake, nmake, jam, + and others? Because all of those tools have limitations that its original + author couldn't live with when developing software across multiple platforms. + + Make-like tools are inherently shell based. They evaluate a set of + dependencies and then execute commands not unlike what you would issue on a + shell. This means that you can easily extend these tools by using or writing + any program for the OS that you are working on. However, this also means that + you limit yourself to the OS, or at least the OS type such as Unix, that you + are working on. + + Makefiles are inherently evil as well. Anybody who has worked on them for any + time has run into the dreaded tab problem. "Is my command not executing + because I have a space in front of my tab!!!" said the original author of Ant + way too many times. Tools like Jam took care of this to a great degree, but + still use yet another format to use and remember. + + Ant is different. Instead a model where it is extended with shell based + commands, it is extended using Java classes. Instead of writing shell + commands, the configuration files are XML based calling out a target tree + where various tasks get executed. Each task is run by an object which + implements a particular Task interface. + + Granted, this removes some of the expressive power that is inherent by being + able to construct a shell command such as `find . -name foo -exec rm {}` but + it gives you the ability to be cross platform. To work anywhere and + everywhere. And hey, if you really need to execute a shell command, Ant has + an exec rule that allows different commands to be executed based on the OS + that it is executing on. + + The Latest Version + ------------------ + + Details of the latest version can be found on the Apache Ant + Project web site <http://ant.apache.org/>. + + + Documentation + ------------- + + Documentation is available in HTML format, in the docs/ directory. + For information about building and installing Ant, see + docs/manual/index.html + + + Licensing + --------- + + This software is licensed under the terms you may find in the file + named "LICENSE" in this directory. + + + Thanks for using Ant. + + The Apache Ant Project + <http://ant.apache.org/> diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/WHATSNEW b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/WHATSNEW new file mode 100644 index 00000000000..3f37d82be71 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/WHATSNEW @@ -0,0 +1,3723 @@ +Changes from Ant 1.7.0 TO current SVN version +============================================= + +Changes that could break older environments: +------------------------------------------- + +Fixed bugs: +----------- + +Other changes: +-------------- + +Changes from Ant 1.6.5 to Ant 1.7.0 +=================================== + +Changes that could break older environments: +------------------------------------------- + +* Initial support for JDK 6 (JSR 223) scripting. + <*script*> tasks will now use javax.scripting if BSF is + not available, or if explicitly requested by using + a "manager" attribute. + +* The -noproxy option which was in the previous 1.7 alpha and beta + releases has been removed. It is the default behavior and not needed. + +* Removed launcher classes from nodeps jar. + +* <classconstants> filter reader uses ISO-8859-1 encoding to read + the java class file. Bugzilla report 33604. + +* Defer reference process. Bugzilla 36955, 34458, 37688. + This may break build files in which a reference was set in a target which was + never executed. Historically, Ant would set the reference early on, during parse + time, so the datatype would be defined. Now it requires the reference to have + been in a bit of the build file which was actually executed. If you get + an error about an undefined reference, locate the reference and move it somewhere + where it is used, or fix the depends attribute of the target in question to + depend on the target which defines the reference/datatype. + +* <script> and <scriptdef> now set the current thread context. + +* Unrestrict the dbvendor names in the websphere element of the ejbjar task. + Bugzilla Report 40475. + +* <env> nested element in <java>, <exec> and others is now case-insensitive + for windows OS. Bugzilla Report 28874. + +* Removed support for xalan1 completely. Users of Xalan1 for Ant builds will + have to stay at ant 1.6.5 or upgrade to xalan2. + +* Use org.apache.log4j.Logger instead of org.apache.log4j.Category. + Category has been deprecated for ~2 years and has been removed from + the log4j code. Logger was introduced in log4j 1.2 so users of + log4j 1.1 and log4j 1.0 need to upgrade to a newer version of log4j. + Bugzilla Report 31951. + +* build.sysclasspath now also affects the bootclasspath handling of + spawned Java VMs. If you set build.sysclasspath to anything other + than "ignore" (or leave it unset, since "ignore" is the default when + it comes to bootclasspath handling), then the bootclasspath of the + VM running Ant will be added to the bootclasspath you've specified. + +* The <java fork="false"> now as per default installs a security manager + using the default permissions. This is now independent of the + failonerror attribute. Bugzilla report 33361. + +* <signjar> now notices when the jar and signedjar are equal, and switches + to the same dependency logic as when signedjar is omitted. This may break + something that depended upon signing in this situation. However, since + invoking the JDK jarsigner program with -signedjar set to the source jar + actually crashes the JVM on our (Java1.5) systems, we don't think any + build files which actually worked will be affected by the change. + +* <signjar> used to ignore a nested fileset when a jar was also provided as an + attribute, printing a warning message; now it signs files in the fileset. + +* An improved method of handling timestamp granularity differences between + client and server was added to the <ftp> task. FTP servers typically + have HH:mm timestamps whereas local filesystems have HH:mm:ss timestamps. + Previously, this required tweaking with the timediffmillis attribute + which also was used to handle timezone differences. Now, there is a new + timestampgranularity attribute. The default value for get operations is 0 + since the user has the more powerful preservelastmodified attribute to work + with. Since this is not available on put operations the default value + adds a minute to the server timestamp in order to account for this, + Scripts which previously used timediffmillis to do this compensation may + need to be rewritten. timediffmillis has now been deprecated. + +* On Java1.5+, Ant automatically sets the system property + java.net.useSystemProxies to true, which gives it automatic use of the local + IE (Windows) or Gnome2 (Unix/Linux) proxy settings. This may break any build + file that somehow relied on content outside the firewall being unreachable: + use the -noproxy command-line option to disable this new feature. + Note that the Java1.5 proxy configuration system still does not + appear to work reliably on Windows or Linux. + +* Support for the XSL:P XML parser has been removed. + Bugzilla Report 23455. + +* Visual Age for Java optional tasks removed. + +* Testlet (test) optional task removed. + +* Icontract optional task removed. + +* Metamata (maudit, mmetrics, and mparse tasks) removed. + +* Sitraka (jpcoverage, jpcovmerge, jpcovreport) tasks suppressed. + +* <fixcrlf> used \r (Mac) line endings on OS X, whose proper line separator + is \n (Unix). Bugzilla report 39585. + +* <scp> now optionally supports the sftp protocol, you may need a + newer jsch.jar. Bugzilla Report 39373. + +* Ant launcher program prints errors to stderr, and exits with a 2 exit code + value if, for any reason, it cannot actually start Ant proper. This will only + affect programs/scripts that called the launcher and which did not want to + receive an error if Ant itself would not start + +* All .NET tasks are now deprecated in favor of the new .NET Antlib: + http://ant.apache.org/antlibs/dotnet/index.html + +Fixed bugs: +----------- +* Directory deletion did not work properly. + Bugzilla 40972. + +* docletpath attribute of javadoc was ignored. + Bugzilla 40900. + +* Fixed incorrect recursion in DOMUtil.listChildNodes(). + Bugzilla 40918. + +* CompressedResource.compareTo() did not + take comparison with another CompressedResource into account. + Bugzilla 40949. + +* Avoid possible NPE in Jar.java. + Bugzilla 40847. + +* regression in attribute prefix (+ others) for refid in zipfileset and tarfileset. + Bugzilla 41004, 30498. + +* dependset failed if the basedir of a target fileset did not exist. + Bugzilla 40916. + +* Recursive filtering encountered NullPointerExceptions under certain + circumstances. Bugzilla 41086. + +* XmlProperty overrides previously set property value when handling duplicate + elements. Bugzilla 41080. + +* Having many tasks causes OOM. Bugzilla 41049. + +* Regression: <path> was evaluating nested content only once, so that it could + not e.g. pick up files that didn't exist the first time through. + Bugzilla 41151. + +* OOM caused by IH holding on to classes and thus their classloaders. + Bugzilla 28283 and 33061. + +* <delete> doesnt delete when defaultexcludes="false" and no includes is set + fixed. Bugzilla 40313. + +* Behavior change of DirectoryScanner/AbstractFileset when conditional include + patterns are used. Bugzilla 40722. + +* <javac> fails with NPE when compiling with eclipse ecj 3.1.x. + Bugzilla 40839. + +* JUnitTestRunner had a NPE when unable to create parser, the exception + containing the error did not get reported. Bugzilla 36733. + +* <checksum> with file and todir option failed. Bugzilla report 37386. + +* <path location="loc"> was broken (Regression from beta1). + Bugzilla report 40547. + +* Nested fileset in <cab> did not work. Bugzilla report 39439. + +* The ant wrapper script should now correctly locate the java + executable in more recent IBM JDKs for AIX as well. + +* URLResource did not close jar files, and also did not disconnect HTTPConnection (s). + +* Error calling junitreport. Bugzilla 40595. + +* <junittask/> created junitvmwatcher*.properties files but did not close and delete them. + +* <xmlproperty> did not create properties for empty leaf elements. + Bugzilla report 26286. + +* UnknownElement.maybeConfigure always configured. + Bugzilla report 40641. + +* No check for refid when prefix attribute is set in zipfileset. + Bugzilla report 30498. + +* Fix for junit4 issue introduced since beta2. + Bugzilla report 40682. + +* Error in duplicate project name with <import> and <antcall>. + Bugzilla report 39920. + +* junit4 did not work with fork=no and junit4 in $ANT_HOME/lib. + Bugzilla report 40697. + +* PathConvert on Windows should process forward and back slashes equivalently. + Bugzilla report 32884. + +* ant.bat now looks in %USERPROFILE% and %HOMEDRIVE%%HOMEPATH% in addition to + %HOME% for pre/post batch files. Bugzilla report 39298. + +* The inheritance hierarchy of the legacy <path> type was changed; code built + against Ant 1.7 would therefore no longer execute on older versions of Ant. + Since <path> is historically heavily used this was undesirable, and since it + is also avoidable, the change to <path>'s taxonomy was reverted. + +* <zip filesonly="true"> included empty directories. Bugzilla report 40258. + +* Invalid hash code of Target causes XmlLogger to fail. + Bugzilla report 40207. + +* Macro element did not include top level Text. Bugzilla report 36803. + +* AntClassLoader did not isolate resources when isolate was set. Bugzilla report 38747. + +* Diagnostics broken when using java 1.4. Bugzilla report 40395. + +* Exception reporting in <copy> was broken. Bugzilla report 40300. + +* Handling of corrupt tar files, TarInputStream.read() never returns EOF. + Bugzilla report 39924. + +* Some bugs in ReaderInputStream. Bugzilla report 39635. + +* <antlr> did not recognise whether the target is up-to-date for html option. + Bugzilla report 38451. + +* Documented minimal version of jsch now 0.1.29. + Bugzilla report 40333. + +* <available> searched parent directories for files. + Bugzilla report 37148. + +* The build could be halted if a file path contained more ".." components than + the actual depth of the preceding path. Now such paths are left + alone (meaning they will likely be treated as nonexistent + files). Bugzilla Report 40281. + +* Converting a <dirset> to a string was broken. Bugzilla Report 39683. + +* Manifests have improved line length handling, taking care of encoding. + Bug reports 37548 / 34425. + +* <manifest> now closes the inputstream explicitly. Bug report 39628. + +* <rpm> now also correctly searches the first element of the path. + Bug report 39345. + +* ant.bat now handles classpath set to "". Bug report 38914. + +* <junit> now supports JUnit 4. Bugzilla Report 38811. + +* <junit> can now work with junit.jar in its <classpath>. Bugzilla + Report 38799. + +* Some potential NullPointerExceptions, Bugzilla Reports 37765 and 38056. + +* Problem when adding multiple filter files, Bugzilla Report 37341. + +* Problem referencing jars specified by Class-Path attribute in manifest + of a ant task jar file, when this ant task jar file is located in + a directory with space, Bugzilla Report 37085. + +* Backward incompatible change in ZipFileSet, Bugzilla Report 35824. + +* Wrong replacement of file separator chars prevens junitbatchtest + from running correctly on files from a zipfileset. Bugzilla Report 35499. + +* Calling close twice on ReaderInputStream gave a nullpointer exception. + Bugzilla Report 35544. + +* Memory leak from IntrospectionHelper.getHelper(Class) in embedded + environments. Bugzilla Report 30162. + +* Translate task does not remove tokens when a key is not found. + It logs a verbose message. Bugzilla Report 13936. + +* Incorrect task name with invalid "javac" task after a "presetdef". + Bugzilla reports 31389 and 29499. + +* <manifest> was not printing warnings about invalid manifest elements. + Bugzilla report 32190. + +* <replace> got out of memory on large files (part of report 32566). + <replace> can now handle files as long as there is enough disk space + available. + +* Commandline.describeCommand() methods would attempt to describe + arguments even when none, other than the executable name, were present. + +* Create signjar's helper ExecTask instance directly rather than by + typedef discovery mechanisms. Bugzilla report 33433. + +* FileUtils.resolveFile() promised to return absolute files but + did not always do so. + +* <ftp> failed to retrieve a file when the path towards the file contained + an element starting with . Bugzilla report 33770. + +* "<rmic> always compiles on Java1.5" bugzilla report=33862. Fixed default + stub version to always be "compat", even on Java1.5+. + +* The .NET compilation tasks failed if filenames given as references + contained spaces. Bugzilla Report 27170. + +* SQL task would try access result sets of statements that didn't + return any, causing problems with Informix IDS 9.2 and IBM DB2 8.1 + FixPak 6 (or later). Bugzilla Reports 27162 and 29954. + +* Task.init() was called twice for most tasks. Bugzilla Report 34411. + +* JavaTest testcases sometimes fail on windows. Bugzilla Report 34502. + +* Targets with identical name work in imported project. Bugzilla Report 34566. + +* DemuxOutputStream now uses a WeakHashMap to store the thread-stream mapping, + to avoid holding on to thread references after they terminate. + +* <xmlvalidate> and <schemavalidate> create a new parser for every file in a + fileset, and so validate multiple files properly. Bugzilla Report 32791. + +* <tar> / <untar> now accepts files upto 8GB, <tar> gives an error if larger + files are to be included. This is the POSIX size limit. + +* <junitreport> removed line-breaks from stack-traces. Bugzilla + Report 34963. + +* Off-by-one error in environment setup for execution under OpenVMS fixed. + +* Bugzilla report 36171: -noclasspath crashes ant if no system + classpath is set. + +* <pvcs> used wrong switch for retrieving revisions by label. + Bugzilla Report 36359. + +* <sshexec> closed System.out, disabling output on second and subsequent + invocations. Bugzilla report 36302. + +* <cvschangelog> was crashing with CVS versions >= 1.12.x due to change in + the date format. Bugzilla report 30962. + +* The same IntrospectionHelper instance was continuously added as a listener + to project. Bugzilla report 37184. + +* FileUtils.toURI() was not encoding non-ASCII characters to ASCII, + causing impossibility to process XML entities referenced by XML + documents in non ASCII paths. Bugzilla report 37348. + +* > 1 ssh invocations to a given host would fail. Bugzilla report 36207. + +* EmailTask was eating SMTP error messages. Bugzilla report 37547. + +* PropertySet API setMapper(...) didn't properly set up the Mapper. + Bugzilla report 37760. + +* Proper return code for ant.bat. Bugzilla report 13655. + +* Project not set on ChainReaderHelpers used by the Redirector. + Bugzilla report 37958. + +* Copy task would fail on locked (or otherwise uncopyable) files even if + failonerror set to false. Bugzilla report 38175. + +* <junit> task did not print all the Test names when using forkmode='once'. + Bugzilla report 37426. + +* <available> could leak resources, Bugzilla Report 38260. + +* Redirector called Thread.sleep in a synchronized block. Bugzilla + report 37767. + +* CCUnlock's objselect attribute could exhibit unpredictable behavior; + standardized improperly included objselect and objsel property accessors to + delegate to the inherited objSelect property accessor. Bugzilla report 37766. + +* <unzip> and <untar> now correctly merge multiple nested patternsets. + Bugzilla Report 38973. + +* On case-insensitive filesystems, a <move> to change filename case + erroneously deleted the "destination" file before attempting to rename + the source file. Bugzilla 37701. + +* <scp> can now handle uris with @s other than the final one denoting the + domain. Bugzilla 38082. + +* If the class invoked by the <java> task threw a ClassNotFoundException, + this was misinterpreted as the specified class itself not being found. + +* <echoproperties> setPrefix javadoc claimed null or empty prefix would be + ignored; instead an error was thrown. Bugzilla report 39954. + +* <get> would fetch files that were up to date, because it used > in a + remote/local timestamp comparison, not >=. Bugzilla 35607. + +* <xslt> passes the current file (name + directory) to the + stylesheet/transformation. xsl-parameter name is configurable. + Bugzilla report 21042. + +* The <zip> API allowed creation of directories in file-only archives; a + habitual offender was the subclassed <jar>, which included META-INF/ in + the destination file regardless of whether filesonly was set to true. + +* <rmic> has a new adapter, xnew, to use the -XNew back end on java1.5+. + By forking rmic, this works on java1.6+. Bugzilla report 38732. + +* Copy of UnknownElement in macroinstance was not recursive. + Bugzilla report 40238. + +* Mixing of add and addConfigured methods in Mapper/ChainedMapper + causes incorrect chaining. Bugzilla report 40228. + +Other changes: +-------------- + +* Warn user when a reference in the form "${refid}" cannot be resolved as this + is a sign they probably meant "refid" (misuse of property expansion syntax). + +* Add dtd to javadoc for junit. + Bugzilla 40754. + +* Add quiet attribute to loadfile/resource. + Bugzilla 38249. + +* Make Locator#fromURI also append the drive letter when running under Windows + with JDK 1.3 or 1.2. + +* Do not uppercase the drive letters systematically in FileUtils#normalize. + +* Java 5 enumerations may now be used as values in XML attributes in place of + EnumeratedAttribute. Bugzilla 41058. + +* Create a pom file for ant-testutil and add ant-testutil.jar to the ant + distribution. Bugzilla 40980. + +* Roll back automatic proxy enabling on Java 1.5. It broke things like + Oracle JDBC drivers, and Ant itself on IBM's JVM on AIX, and didnt + seem to work to well the rest of the time. + To enable the feature, use the -autoproxy command line option. + +* Upgraded XML API and parser to Xerces 2.8.1 + +* A code review of some threaded logic has tightened up the synchronization + of Watchdog, ExecuteWatchdog and ExecuteJava, which could reduce the occurence + of race conditions here, especially on Java1.5+. + +* Allow broken reference build files. The defer reference processing would + break too many files - so allow them with a warning. + +* Removed dependency on sun.misc.UUEncoder for UUMailer. + +* Added regex attribute to the echoproperties task. + Bugzilla 40019. + +* <war> task now allows you to omit the web.xml file. as this is optional + in the servlet 2.5 and Java EE 5 APIs. set needxmlfile="false" to + avoid a missing web.xml file from halting the build. + +* Diagnostics catches and logs security exceptions when accessing system properties. + +* <javadoc> useexternalfile now applies to all command line arguments + of javadoc. Bugzilla report 40852. + +* javadoc/tag@description is now set to the name if description is + not specified. Bugzill report 32927. + +* Some performance improvements, including Bugzilla report 25778. + +* Add <matches> condition. Bugzilla report 28883. + +* Extending JAR-Task for SPI. Bugzilla report 31520. + +* Added <tokens> resource collection for convenient creation of string + resources from other resources' content. Inspired by Bugzilla 40504. + +* Added <compare> resource selector to select resources based on the + results of their comparison to other resources. + +* Added outputtoformatters attribute to <junit> to allow suppression + of noisey tests. Bugzilla report 12817. + +* Log level of message 'Overriding previous definition of reference to' + set to Verbose. Bugzilla report 17240. + +* Added setbeans attribute to <script> to allow <script>'s to be + run without referencing all references. + Bugzilla report 37688. + +* Added classpath attribute and nested element to <script> to allow + the language jars to be specified in the build script. + Bugzilla report 29676. + +* Trim the driver attribute on the <sql> task. Bugzilla report 21228. + +* Allow (jar) files as well as directories to be given to jdepend. + Bugzilla report 28865. + +* Convert SplashTask to use NOT sun internal classes. + Bugzilla report 35619. + +* Made PatternSet#hasPatterns public to allow custom filesets access. + Bugzilla report 36772. + +* Added searchparents attribute to <available>. Bugzilla report 39549. + +* Tasks that don't extend Ant's Task class will now get the build file + location reflected into a method of the signature void setLocation(Location) + - if such a method exists. + +* Remove needless synchronization in DirectoryScanner. + Bugzilla report 40237. + +* Improved recursion detection for lines with multiple matches of same token + on a single line. Bugzilla report 38456. + +* Task will now log correctly even if no project is set. + Bugzilla report 38458. + +* Use alternative names for the command line arguments in javac. Bugzilla + Report 37546. + +* The Reference class now has a project field that will get + used (if set) in preference to the passed in project, when + dereferencing the reference. Bugzilla Report 25777. + +* On DOS and Netware, filenames beginning with a drive letter + and followed by a colon but with no directory separator following + the colon are no longer (incorrectly) accepted as absolute pathnames + by FileUtils.normalize() and FileUtils.isAbsolutePath(). Netware + volumes can still be specified without an intervening separator. + UNC pathnames on Windows must include a server and share name, i.e. + "\\a\b" to be considered valid absolute paths. + +* A bug in SQLExec would prevent the execution of trailing, + non-semicolon-delimited statements. Bugzilla Report 37764. + +* InputHandler implementations may now call InputRequest.getDefaultValue() + if they wish. The default handler uses this also. Bugzilla report 28621. + +* Took in bugzilla report 39320, "Simple code cleanups" + +* Improve compatibility with GNU Classpath and java versions prior to + 1.5. Bugzilla 39027. + +* ${ant.core.lib} may now be used to refer to the library containing the + Ant classes, for instance useful when compiling tasks. + +* Minor performance improvements Bugzilla report 37777 + +* New task <manifestclasspath> converts a path into a property + suitable as the value for a manifest's Class-Path attribute. + +* Fixed references to obsoleted CVS web site. Bugzilla Report 36854. + +* Log fine-grained events at verbose level from JUnit. Bugzilla report 31885. + +* <WsdlToDotnet> and <style> are now deprecated in favor of <wsdltodotnet> and + <xslt>, respectively. Bugzilla report 25832. + +* <echoproperties> now (alphanumerically) sorts the property list + before echoing. Bugzilla report 18976. + +* A new base class DispatchTask has been added to facilitate elegant + creation of tasks with multiple actions. + +* Major revision of <wsdltodotnet>. Supports mono wsdl and the microsoft + wsdl run on mono, as well as most of the .NET WSE2.0 options. Extra + schemas (files or urls) can be named in the <schema> element. + Compilers can be selected using the compiler attribute, which defaults + to "microsoft" on windows, and "mono" on everything else. + +* It is now possible to specify the pattern created/parsed by <checksum>. + Bugzilla Report 16539. + +* Added a new "failall" value for the onerror attribute of <typedef>. + Bugzilla report 31685. + +* unzip/unwar/unjar/untar now supports a nested mapper, which lets you unzip + in useful ways. + +* Junit task -- display suite first. + Bugzilla report 31962. + +* Added isSigned condition and signedselector selector + Bugzilla report 32126. + +* Added preserveLastModified attribute to signjar task. + Bugzilla report 30987. + +* Added <scriptcondition> condition, for inline scripted conditions + +* Added <xor> condition for exclusive-or combining of nested conditions. + +* Added <scriptselector> selector for scripted file selection + +* ant -diagnostics lists contents of ${user.home}/.ant/lib , and + checks that the java.io.tmpdir directory exists and is writeable. + +* mail task accepts nested header element. Bugzilla report 24713. + +* zip/jar/war/ear supports level attribute for deflate compression level. + Bugzilla report 25513. + +* Added loginputstring attribute to the redirector type. + +* Tighten security by sending storepass and keypass to signjar + via the input stream of the forked process. + +* New task <schemavalidate> extends <xmlvalidate> with extra support + for XML Schema (XSD) files. + +* <fixcrlf> supports a file attribute for easy fixup of a single file. + +* New condition <parsersupports> which can look for XML parser feature or + property support in the parser Ant is using. + +* fixcrlf can be used in a filterchain. + +* <sync> has a new nested element <preserveInTarget> that can be used + to protect extra-content in the target directory. Bugzilla Report + 21832. + +* <signjar> now supports: + -nested filesets at the same time as the jar attribute + -a destDir attribute with the appropriate dependency logic, which + can be used with the jar attribute or nested filesets + -a mapper to permit filename remapping on signing + -tsaurl and tsacert attributes for timestamped JAR signing + -nested <sysproperty> elements, which can be used for proxy setup + and the like + +* The linecontains and linecontainsregexp filterreaders now support a + negate attribute to select lines -not- containing specified text. + Bugzilla Report 34374. + +* <os> condition adds "winnt" as a family which can be tested. This is + all windows platforms other than the Win9x line or Windows CE. + +* <exec> (and hence, <apply> and any other derived classes) have an OsFamily + attribute, which can restrict execution to a single OS family. + +* Added "backtrace" attribute to macrodef. Bugzilla report 27219. + +* Ant main provides some diagnostics if it ever sees a -cp or -lib option, + as this is indicative of a script mismatch. Bugzilla report 34860 + +* <junitreport> prints a special message if supplied an empty XML File. This + can be caused by the test JVM exiting during a test, either via a + System.exit() call or a JVM crash. + +* Project name is now used for *all* targets so one can write consistent import + build files. Bugzilla report 28444. + +* New condition <typefound> that can be used to probe for the declaration + and implementation of a task, type, preset, macro, scriptdef, whatever. + As it tests for the implementation, it can be used to check for optional + tasks being available. + +* Check for 1.5.* Ant main class. (weblogic.jar in classpath reports) + +* New condition <isfailure> that tests the return-code of an executable. This + contains platform-specific logic and is better than comparing the result with + "0". + +* Added initial support for Resource Collections, including the + resourcecount task. + +* property attribute of pathconvert is now optional. If omitted the + result will be written to the log. + +* New mapper, <scriptmapper>, supports scripted mapping of source files/strings + to destination strings. + +* Add the echoxml task. This will echo nested XML to a file, with + the normal <?xml ?> processor instruction. UTF-8 encoding only; no-namespace + support. + +* Try to make subprojects of custom Project subclasses instances of the + same type. Bugzilla report 17901. + +* <ssh> and <scp> support keyboard-interactive authentication now. + +* <javadoc> now supports -breakiterator for custom doclets if Ant is + running on JSE 5.0 or higher. Bugzilla Report: 34580. + +* New logger, TimestampedLogger, that prints the wall time that a build + finished/failed. Use with + -logger org.apache.tools.ant.listener.TimestampedLogger + +* <junitreport> now generates pages alltests-errors.html and + alltests-fails.html, that list only the errors and failures, respectively. + Bugzilla Report: 36226 + +* New task <makeurl> that can turn a file reference into an absolute file:// + url; and nested filesets/paths into a (space, comma, whatever) separated + list of URLs. Useful for RMI classpath setup, amongst other things. + +* <xslt> now accepts nested FileNameMappers e.g. <globmapper>. + Bugzilla report 37604. + +* New task <loadresource> that accompanies <loadfile> for non file resources. + +* <echo> now supports an encoding when saving to a file. + +* New GreedyInputHandler added. + +* Add textfile attribute to the <filesmatch> condition. When true, the text + contents of the two files are compared, ignoring line ending differences. + +* New <resourcesmatch> condition. + +* Added the onmissingfiltersfile attribute to filterset. Bugzilla report 19845. + +* Added the inline handler element to the input task. + +* <sql> supports property expansion if you set the expandProperties + attribute. By default it does not expand properties, something we + dare not change for fear of breaking complex SQL operations in + existing files. + +* <javadoc>'s packagenames attribute is now optional and defaults to "*". + +* <javac>'s source and target attributes as well as <javadoc>'s source + attribute will read default values from the properties + ant.build.javac.source and ant.build.javac.target. + +* Handling of ' ', '#' in CLASSPATH and '#' in -lib (cannot use ' ' + in -lib on UNIX at the moment). Bugzilla Report 39295. + +* <scp> now optionally supports the sftp protocol. Bugzilla Report 39373. + +* Resources can now be used to indicate the location of the stylesheet to use + in <xslt>. Bugzilla Report 39407. + +* New <antversion> condition. Bugzilla report 32804. + +* ReplaceTokens should allow properties files. Bugzilla report 39688. + +* FTP Account could not be specified in ant FTP task. Bugzilla report 39720. + +* Minor performance updates. Bugzilla report 39565. + +* New deleteonexit attribute for the <tempfile> task. Bugzilla report 39842. + Remember that the exit of the JVM can be a long time coming, + especially under an IDE. Don't rely on this being called. + +* <scriptdef>-created scripts have support for nested text. All text + passed to a scripted task can be accessed via self.text. + +* <fixcrlf> now supports an outputencoding attribute. Bugzilla report 39697. + +* <junitreport> now supports nested XSL parameters. Bugzilla report 39708. + +* <javacc> has a jdkversion attribute to pass the desired JDK version + down to javacc. Bugzilla report 38715. + +* <cvs> prints passfile info at -verbose level instead of -info. Bugzilla + report 35268 + +* When <javac> can't find the compiler class, it prints out java.home for + immediate diagnostics + +* Ant launcher now supports a -main attribute so that you can specify + an extension class to the built in org.apache.tools.ant.Main + class. This class must implement the interface AntMain + +Changes from Ant 1.6.4 to Ant 1.6.5 +=================================== + +Changes that could break older environments: +-------------------------------------------- + +Fixed bugs: +----------- + +* <move> was unable to replace existing files or write into + existing directories. Bugzilla report 34962. + +* <macrodef> with redefined default values was incorrect. (Fix for + 31215 had a bug). Bugzilla report 35109. + +* <javadoc> will convert backslashes to forwardslashes when generating file + list by useexternalfile. Bugzilla report 27814. + +Changes from Ant 1.6.3 to Ant 1.6.4 +=================================== + +Changes that could break older environments: +-------------------------------------------- +* <ftp> task has had a number of changes. Uptodate calculation previously + did not call a file uptodate if the source timestamp and the destination + timestamp were equal. Bugzilla report 34941. Any script that attempted + to compensate for this by using the timediffmillis attribute might need + to be tweaked. + + +Fixed bugs: +----------- + +* Sun javah failed with java.lang.NoClassDefFoundError. + Bugzilla report 34681. + +* DirectoryScanner.slowScan() was broken. Bugzilla report 34722. + +* DirectoryScanner.scan() could throw a NullPointerException on + case-insensitive filesystems (read Windows or MacOS X). + +* Get w/authentication failed with ArrayOutOfBoundsExceptions. + Bugzilla report 34734. + +* Granularity attribute for <sync> task was undocumented. + Bugzilla report 34871. + +* <unzip> and <untar> could leave file handles open on invalid + archives. Bugzilla report 34893. + +* propertyset threw NPE with nested, mapped propertysets. + +Other changes: +-------------- + +* AntXMLContext.setCurrentTargets() is now public. Bugzilla report 34680. + +Changes from Ant 1.6.2 to Ant 1.6.3 +=================================== + +Changes that could break older environments: +-------------------------------------------- + +* The subant task used the canonical version of a file path. This + has been changed to use the absolute path. Bugzilla 30438. + +* Tar now writes two EOF blocks rather than one. + Bugzilla report 28776 + +* The Reference object now has a project field which it uses in preference + to the project passed in. This allows composite references to be + handled to nested projects. + Bugzilla report 25777 + +* <junit> with filtertrace="true" will now also swallow lines for the + sun.reflect package. If you need to see them in your stack trace, + you must set filtertrace to false. + Bugzilla Report 22758 + +* The jikes compiler adapter now supports -bootclasspath, -extdirs and + -sourcepath and also uses the same logic for debug flags as javac. + This means, the jikes compiler adapter now requires Jikes 1.15 or later. + Bugzilla Reports 25868, 26404 and 32609. + +* The gcj compiler adapter used to include the Java runtime classes + even if includeJavaRuntime was set to false, unless the + bootclasspath has been specified as well. It will now always adhere + to includeJavaRuntime, you may need to set it to true explicitly now + if you relied on the old behavior. + +Other changes: +-------------- + +* <javadoc> can now take an attribute 'executable'. Bugzilla report 30606. + +* New attribute ignorecontents for <different> selector + +* Javadoc fixes for Location, Project, and RuntimeConfigurable + Bugzilla 30160. + +* Enable to choose the regexp implementation without system property. + Bugzilla Report 15390. + +* Expose objects and methods in IntrospectionHelper. Bugzilla Report 30794. + +* Allow file attribute of <move> to rename a directory. + Bugzilla Report 22863. + +* Add xmlcatalog nested element to XmlProperty. Bugzilla report 27053. + +* New attribute alwayslog for <redirector> type. + +* Added <target> nested elements to <ant> and <antcall> to allow + specification of multiple sub-build targets, which are executed + with a single dependency analysis. + +* Refactored Target invocation into org.apache.tools.ant.Executor + implementations. Bugzilla Reports 21421, 29248. + +* <rmic> now also supports Kaffe's rmic version shipping with Kaffe + 1.1.2 and above. + +* added casesensitive attribute to <globmapper> and <regexpmapper> + Bugzilla report 16686 + +* added handledirsep attribute to <globmapper> and <regexpmapper> + Bugzilla report 32487 + +* added a new mapper <filtermapper> + +* When a BuildListener tried to access System.err or System.out, Ant + would have thrown an exception - this has been changed. Ant now + silently ignores the message. BuildListeners still should avoid + accessing either stream. + +* Added a comment attribute to the zip task. + Bugzilla report 22793. + +* Overloaded FileUtils.createNewFile with a boolean mkdirs attribute + to create nonexistent parent directories. + +* <apply> has a new "force" attribute that, when true, disables + checking of target files. + +* Made the dest attribute of the apply task optional; mapped target + filenames will be interpreted as absolute pathnames when dest is omitted. + +* Changed default tempdir for <javac> from user.dir to java.io.tmpdir. + +* Added searchpath attribute to <exec> for searching path variable(s) + when resolveexecutable = true. + +* Added revision and userid attributes to <pvcs> documentation. + +* Added support to the touch task for a mkdirs attribute to create + nonexistent parent directories before touching new files. + +* Added support to the touch task for a pattern attribute to allow + alternate datetime formats. + +* Added support to the touch task to map touched files using a nested + mapper element. + +* Added support to the touch task for a verbose attribute to suppress + logging of new file creation. + +* bad link in docs to the enhancement page in bugzilla. + Bugzilla report 33252. + +* Added length task to get strings' and files' lengths. + +* <native2ascii> and <javah> now also support Kaffe's versions. + +* Recursive token expansion in a filterset can now be disabled by + setting its recurse attribute to false. + +* Pathconvert no longer requires that one of (targetos|pathsep|dirsep) + be set; platform defaults are used when this is the case. + +* Added preservelastmodified attribute to fixcrlf task. Bugzilla 25770. + +* Added isfileselected condition. + +* Added verbose="true|false" attribute to <subant>. When verbose is enabled, + the directory name is logged on entry and exit of the sub-build. + Bugzilla 33787. + +* Added -nouserlib option to allow running ant without automatically loading + up ${user.home}/.lib/ant. This is useful when compiling ant, and antlibs. + Modified the build.sh and build.bat to use the option. + +* Added -noclasspath option to allow running ant WITHOUT using CLASSPATH env + variable. Modified ant.bat to do this so that %CLASSPATH% is not looked at. + +* Add else attribute to the condition task, which specifies an + optional alternate value to set the property to if the nested + condition evaluates to false. Bugzilla report 33074. + +* Ant generated jar files should now be detected as jar files by + Solaris. Bugzilla Report 32649. + +* <rexec> with a single command should now work with unusal login + dialogs without special read/write pairs. Bugzilla Report 26632. + +* <csc>'s extraoptions can now contain multiple arguments. + Bugzilla Report 23599. + +* <macrodef> with default values set by properties would be + seen as new definitions when called twice with different properties. + This was confusing so the definitions are now treated as similar. + Bugzilla Report 31215. + +* <javadoc> has a new attribute "includenosourcepackages" that can be + used to document packages that don't hold source files but a + package.html file. Bugzilla Report 25339. + +* <rpm> has new attributes failonerror and quiet. + +* Added two tutorials + - beginner: introduction into Ant + - task developers: using path, fileset etc + +* a number of new attributes that allow the user to handle non-standard + server listing formats and time zone differences have been added in + the <ftp> task. + + +Fixed bugs: +----------- + +* Do not pass on ThreadDeath when halting <java fork="false">. Bugzilla + 32941. + +* Killing a thread running <java fork="true"> (e.g. from an IDE) would + not stop the forked process. Bugzilla 31928. + +* Programs run with <java fork="true"> can now accept standard input + from the Ant console. (Programs run with <java fork="false"> could + already do so.) Bugzilla 24918. + +* AbstractCvsTask prematurely closed its outputStream and errorStream. + Bugzilla 30097. + +* Impossible to use implicit classpath for <taskdef> + when Ant core loader != Java application loader and + Path.systemClassPath taken from ${java.class.path} Bugzilla 30161. + +* MacroInstance did not clean up nested elements correctly in the execute + method, causing multiple use of the same macro instance with nested + elements to fail. + +* checksum fileext property doc wrong. Bugzilla 30787. + +* FTP task, getTimeDiff method was returning wrong value. Bugzilla 30595. + +* make sure that Zip and its derivates call the createEmptyZip method when + there are no resources to zip/jar/... + +* Zip task was not zipping when only empty directories were found. + Bugzilla 30365. + +* Jar task was not including manifest files when duplicate="preserve" was + chosen. Bugzilla 32802. + +* ant.bat was missing runAntNoClasspath label for goto. + Bugzilla 34510. + +* Classpath was treated in the same way as -lib options. Bugzilla 28046. + +* Manual page for cvsversion contained incorrect attributes and did not + say since 1.6.1. Bugzilla 31408. + +* Typo in definition of <cvsversion> task causing it not to be defined. + Bugzilla 31403. + +* Execution of top level tasks in imported files get delayed by targets. + Bugzilla report 31487. + +* ExecTask executes checkConfiguration() even though os does not match. + Bugzilla report 31805. + +* Concat task instance could not be run twice. + Bugzilla report 31814. + +* NPE using XmlLogger and antlib. + Bugzilla report 31840. + +* Properties.propertyNames() should be used instead of .keys(). + Bugzilla report 27261. + +* Target location is not set for default target. + Bugzilla report 32267. + +* Incorrect classloader parent in junittask when using with + ant-junit.jar and junit.jar not in the project classloader. Bugzilla + report 28474. + +* getResources() on the classloader returned by ClasspathUtils would + see each resource twice - if the resource is in the project + classpath and if the classloader is requested with a null path. + +* XMLValidate used URL#getFile rather than the ant method FileUtils#fromURI + Bugzilla report 32508 + +* fixed Regexp-Mapper docs which gave outdated instructions (optional.jar) + Bugzilla report 28584 + +* <scp> using <fileset> didn't work with OpenSSH 3.9 and later. + Bugzilla report 31939 + +* <setproxy> failed to set user/password on some JDKs. + Bugzilla report 32667 + +* untar would go into infinite loop for some invalid tar files. + Bugzilla report 29877 + +* forked <javac> won't pass -source to a JDK 1.1 or 1.2 javac anymore. + Bugzilla report 32948 + +* propertyset references did not handle nested propertyset references. + +* oata.types.Description.getDescription(Project) would throw a + NullPointerException when the "ant.targets" reference was unset. + +* Wrapper scripts did not detect WINNT value of dynamic OS environment + variable when logged into workstations using Novell authentication. + Bugzilla Report 30366. + +* DependScanner.getResource() always returned nonexistent resources, + even when the resource actually existed. Bugzilla Report 30558. + +* <apply> was broken with classfilesets. Bugzilla Report 30567. + +* <available> returned false positives when checking a file + passed in with the current basedir leading twice: + e.g. ${basedir}${file.separator}${basedir}${file.separator}foo . + +* The first file open that took place when using input files with the + <exec>, <apply>, or <java> tasks was always logged to System.out + instead of to the managing Task. + +* <telnet> and <rexec> would try to disconnect from servers they never + connetced to, potentially leading to exceptions in commons-net. + Bugzilla Report 33618. + +* <zip> would drop files matched by defaultexcludes during updates. + Bugzilla Report 33412. + +* <zip> couldn't store files with size between 2GB and 4GB (the + upper limit set by the ZIP format itself). Bugzilla Report 33310. + +* NPE when when <presetdef> tries to configure a task that + cannot be instantiated. Bugzilla Report 33689. + +* <javac debug="false"> created an invalid command line when running + the Symantec Java compiler. + +* Get with usetimestamp did not work on Java 1.2. + +* Get with usetimestamp did not work when local timestamp roughly >= now. + +* The framed JUnit report now handles multiple reports for the same + testcase properly. Bugzilla Report 32745. + +* <cab> didn't work for files with spaces in their names on Windows. + Bugzilla Report 17182. + +* The VAJ tasks could fail if the project name contained characters + that need to get URL encoded. Bugzilla Report 23322. + +* TarInputStream#read() wasn't implemented correctly. Bugzilla Report + 34097. + +* <xslt> failed to process file-hierarchies of more than one level if + scanincludeddirectories was true. Bugzilla Report 24866. + +* forkmode="perBatch" or "once" would ignore extension attributes that + had been specified for <formatter>s. Bugzilla Report 32973. + +* The refid attribute of the I/O redirector was not functional. + +Changes from Ant 1.6.1 to Ant 1.6.2 +=================================== + +Changes that could break older environments: +-------------------------------------------- + +* The import task used the canonical version of a file path. This + has been changed to use the absolute path. Bugzilla 28505. + +* ant-xalan2.jar has been removed since the only class contained in it + didn't depend on Xalan-J 2 at all. Its sole dependency has always + been TraX and so it has been merged into ant-trax.jar. + +* All exceptions thrown by tasks are now wrapped in a buildexception + giving the location in the buildfile of the task. + +* Nested elements for namespaced tasks and types may belong to the + Ant default namespace as well as the task's or type's namespace. + +* <junitreport> will very likely no longer work with Xalan-J 1. + + Note that Xalan-J 1 has been deprecated for a very long time and we + highly recommend that you upgrade. + + If you really need to continue using Xalan-J 1, please copy the + junit-frames-xalan1.xsl from the distribution's etc directory as + junit-frames.xsl into a new directory and use the task's styledir + attribute to point to. This is the last version of the XSLT + stylesheet that is expected to be compatible with Xalan-J 1. + +Fixed bugs: +----------- + +* eliminate memory leak in AntClassLoader. Bugzilla Report 8689. + +* subant haltonfailure=false did not catch all failures. Bugzilla Report 27007. + +* macrodef @@ escaping was broken. Bugzilla Report 27069. + +* MacroDef did not allow attributes named 'description'. Bugzilla Report 27175. + +* Throw build exception if name attribute missing from patternset#NameEntry. + Bugzilla Report 25982. + +* Throw build exception if target repeated in build file, but allow targets + to be repeated in imported files. + +* <apply> didn't compare timestamps of source and targetfiles when + using a nested <filelist>. Bugzilla Report 26985. + +* tagdiff.xml was broken in ant 1.6.1. Bugzilla Report 27057. + +* if the basedir contained .. or . dirs, and the build file name contained + .. or ., the basedir was set incorrectly. Bugzilla Report 26765. + +* regression from ant 1.5, exec task outputted two redundant trailing newlines. + Bugzilla Report 27546. + +* NPE when running commons listener. Bugzilla Report 27373. + +* <java> swallowed the stack trace of exceptions thrown by the + executed program if run in the same VM. + +* -projecthelp swallowed (configuration) errors silently. + Bugzilla report 27732. + +* filterset used by filtertask doesn't respect loglevel. Bugzilla Report 27568. + +* wrong compare used in ProjectComponent for logging. Bugzilla Report 28070. + +* failOnAny attribute for <parallel> was broken. Bugzilla Report 28122. + +* If <javac> uses gcj and any of the nested <compilerarg>s implies + compilation to native code (like -o or --main), Ant will not pass + the -C switch to gcj. This means you can now compile to native code + with gcj which has been impossible in Ant < 1.6.2. + +* <import optional="false"> and <import optional="true"> + behaved identically. + +* <xslt> now sets the context classloader if you've specified a nested + <classpath>. Bugzilla Report 24802. + +* <zip> and friends would delete the original file when trying to update + a read-only archive. Bugzilla Report 28419. + +* <junit> and <assertions> are working together. Bugzilla report 27218 + +* AntClassLoader#getResource could return invalid URLs. Bugzilla + Report 28060. + +* Ant failed to locate tools.jar if the jre directory name wasn't all + lowercase. Bugzilla Report 25798. + +* Redirector exhibited inconsistent behavior with regard to split + output. When sent to file only, files would be created in all + cases; when split file-property, files were only created if + writes were performed. + +* fixed case handling of scriptdef attributes and elements. + +* UNC pathnames did not work for ANT_HOME or -lib locations on Windows. + Bugzilla report 27922. + +* replacestring tokenfilter only replaced the first occurrence. + +* AntLikeTasksAtTopLevelTest failed on cygwin. + +* I/O-intensive processes hung when executed via <exec spawn="true">. + Bugzilla reports 23893/26852. + +* JDependTask did not close an output file. Bugzilla Report 28557. + +* Using <macrodef> could break XmlLogger. Bugzilla Report 28993. + +* <genkey> no longer requires keytool to be in your PATH. Bugzilla + Report 29382. + +* <symlink> could create cyclic links. Bugzilla Report 25181. + +* <zip whenempty="skip"> didn't work in a common situation. Bugzilla + Report 22865. + +* <scp> now properly handles remote files and directories with spaces + in their names. Bugzilla Report 26097. + +* <scp> now has (local|remote)tofile attributes to rename files on the + fly. Bugzilla Report 26758. + +* <telnet> and <rexec> didn't close the session. Bugzilla Report 25935. + +* <subant> and XmlLogger didn't play nicley together. + +Other changes: +-------------- +* doc fix concerning the dependencies of the ftp task + Bugzilla Report 29334. + +* <xmlvalidate> has now a property nested element, + allowing to set string properties for the parser + Bugzilla Report 23395. + +* Docs fixes for xmlvalidate.html, javadoc.html, starteam. + Bugzilla Reports 27092, 27284, 27554. + +* <pathconvert> now accepts nested <mapper>s. Bugzilla Report 26364. + +* Shipped XML parser is now Xerces-J 2.6.2. + +* Added nested file element to filelist. + +* spelling fixes, occurred. Bugzilla Report 27282. + +* add uid and gid to tarfileset. Bugzilla Report 19120. + +* <scp> has a verbose attribute to get some feedback during the + transfer and new [local|remote][File|Todir] alternatives to file and + todir that explicitly state the direction of the transfer. + +* The OS/2 wrapper scripts have been adapted to use the new launcher. + Bugzilla Report 28226. + +* <sshexec> now also captures stderr output. Bugzilla Report 28349. + +* <xslt> now supports a nested <mapper>. Bugzilla Report 11249. + +* <touch> has filelist support. + +* <nice> task lets you set the priority of the current thread; non-forking + <java> code will inherit this priority in their main thread. + +* New attribute "negate" on <propertyset> to invert selection criteria. + +* Target now supports a Location member. Bugzilla Report 28599. + +* New "pattern" attribute for <date> selector. + +* <junit> has a new forkmode attribute that controls the number of + Java VMs that get created when forking tests. This allows you to + run all tests in a single forked JVM reducing the overhead of VM + creation a lot. Bugzilla Report 24697. + +* <jar> can now optionally create an index for jars different than the + one it currently builds as well. See the new <indexjars> element + for details. Bugzilla Report 14255. + +* Permit building under JDK 1.5. Bugzilla Report 28996. + +* minor Javadoc changes. Bugzilla Report 28998. + +* Misc. corrections in SignJar.java. Bugzilla Report 28999. + +* Remove redundant <hr> from javah.html. Bugzilla Report 28995. + +* Ignore built distributions. Bugzilla Report 28997. + +* A new roundup attribute on <zip> and related task can be used to + control whether the file modification times inside the archive will + be rounded up or down (since zips only store modification times with + a granularity of two seconds). The default remains to round up. + Bugzilla Report 17934. + +* A binary option has been added to <concat>. Bugzilla Report 26312. + +* Added DynamicConfiguratorNS, an namespace aware version of + DynamicConfigurator. Bugzilla Report 28436. + +* Add implicit nested element to <macrodef>. Bugzilla Report 25633. + +* Add deleteonexit attribute to <delete>. + +* Added Target.getIf/Unless(). Bugzilla Report 29320. + +* <fail> has a status attribute that can be used to pass an exit + status back to the command line. + +* <fail> accepts a nested <condition>. + +* <loadproperties> supports loading from a resource. + Bugzilla Report 28340. + +* Nested file mappers and a container mapper implementation have been + introduced. Additionally, the <mapper> element now accepts "defined" + nested FileNameMapper implementations directly, allowing a usage + comparable to those of <condition>, <filter>, and <selector>. + +* New <redirector> type introduced to provide extreme I/O flexibility. + Initial support for <exec>, <apply>, and <java> tasks. + +* <apply> has a new ignoremissing attribute (default true for BC) + which will allow nonexistent files specified via <filelist>s to + be passed to the executable. Bugzilla Report 29585. + +* <junitreport> now also works with Xalan XSLTC and/or JDK 1.5. + Bugzilla Report 27541. + +* <jspc> doesn't work properly with Tomcat 5.x. We've implemented a + work-around but don't intend to support future changes in Tomcat + 5.x. Please use the jspc task that ships with Tomcat instead of + Ant's. + +Changes from Ant 1.6.0 to Ant 1.6.1 +============================================= + +Changes that could break older environments: +-------------------------------------------- + +* License is now Apache Software License 2.0 + see http://www.apache.org/licenses/ for more information + +Fixed bugs: +----------- +* Remove a recursive template call in the junit xsls that could trigger a stack + overflow. It now uses Xalan extensions to call a Java class directly. + Bugzilla Report 19301 + +* Fix spurious infinite loop detection for filters (introduced in ant 1.6.0). + Bugzilla Report 23154. + +* Fix handling of default ant namespace for nested elements. + +* Fix jboss element of ejb task (introduced in ant 1.6.0). + +* <whichresource> failed to load classes correctly. + +* Ant could fail to start with a NullPointerException if + ANT_HOME/lib/ant-launcher.jar was part of the system CLASSPATH. + +* presetdef'ed types did not work with the ant-type attribute + +* fixed case handling of macrodef attributes and elements. Bugzilla + Reports 25687 and 26225. + +* <java> ignored the append attribute, Bugzilla Report 26137. + +* The gcj compiler adapter for <javac> failed if the destination + directory didn't exist. Bugzilla Report 25856. + +* Ant now fails with a more useful message if a new process will be + forked in a directory and that directory doesn't exist. + +* <splash> used to break the build on non-GUI environments. Bugzilla + report 11482. + +* Ant 1.6.0 cannot run build scripts in directories with non-ASCII names. + Bugzilla Report 26642. + +Other changes: +-------------- +* Shipped XML parser is now Xerces-J 2.6.1 + +* Translate task logs a debug message specifying the number of files + that it processed. Bugzilla Report 13938. + +* <fixcrlf> has a new attribute - fixlast. Bugzilla Report 23262. + +* <p4submit> has 2 new attributes, needsresolveproperty and changeproperty. + Bugzilla Report 25711. + +* add description attributes to macrodef attributes and elements. + Bugzilla Report 24711. + +* Extending ClearCase Tasks : + - Added an extra option to 'failonerr' to each ClearCase task/command. + - Extended the functionality of cccheckout. It can check (notco) to see if + the desired element is already checked out to the current view. Thus it + won't attempt to check it out again. + - Added three new ClearCase commands: ccmkattr, ccmkdir, ccmkelem + Bugzilla Report 26253. + +* added nested text support to <macrodef> + +* added initial support for Java 1.5. Java 1.5 is now correctly + detected by Ant and treated just like Java 1.4. You can now specify + source="1.5" in the <javac> task. + +* created new task <cvsversion> + +* added support for branch logging via the tag attribute in <cvschangelog> + Bugzilla Report 13510. + +* added support the groovy language in the script and scriptdef tasks + +Changes from Ant 1.5.4 to Ant 1.6.0 +=================================== + +Changes that could break older environments: +-------------------------------------------- + +* This version of Ant can not be built with JDK 1.1 and requires at + least Java 1.2 at runtime as well. Compiling for a 1.1 target is + still supported. + +* Targets cannot have the empty string as their name any longer. + +* ant.jar's manifest does no longer include a Class-Path entry, so it + is no longer possible to run Ant via "java -jar ant.jar" without + manually altering the CLASSPATH. Instead of that a file + ant-bootstrap.jar is included in the etc directory of the binary + distribution, copy this to the lib directory and use + "java -jar ant-bootstrap.jar" instead if you want to run Ant without + the wrapper script (not recommended). + +* The <script> task now requires Apache BSF instead of the older IBM + version. See <http://jakarta.apache.org/bsf/> + +* <xmlproperty> will no longer fail if the file to be loaded doesn't exist. + +* XML namespaces are now enabled in the XML parser, meaning XML namespace + declarations no longer cause errors. However task names containing colons + will cause errors unless there is a corresponding namespace uri. + +* The <ftp> and <telnet> tasks now require Jakarta Commons Net instead + of the older ORO Netcomponents version. See + <http://jakarta.apache.org/commons/net/index.html>. + +* <input> will no longer prompt the user and wait for input if the + addproperty attribute is set to a property that has already been + defined in the project. If you rely on the task waiting for input, + don't use the addproperty attribute. + +* The Class-Path attribute in manifests will no longer merge the + entries of all manifests found, but will be treated like all other + manifest attributes - the most recent attribute(s) will be used. + +* New Launch mechanism implemented. This moves some functionality from + the batch files / shell scripts into Java. This removes environment + limitations, for command issues, directory depth issues on Windows. Also + allows a per-user library location to be used if the main Ant install + is locked down. + +* The Entry nested element of PropertyFile will not any more have its value + attribute (actually increment) overwritten with the new value of the entry + after execution. + +* Output stored from a <java> or <exec> task is now exactly as generated. No + conversion to platform end-of-line characters is performed. + +* <translate> will now preserve line endings. + +* <ftp> followsymlinks="false" in nested fileset definitions is explicitly + required in order to exclude remote symbolic links (when doing a get, chmod, + delete, rmdir). + +* The values of the Copy#fileCopyMap variable has changed from String to + String[]. (In java 1.5 terms it was Hashtable<String, String> and + is now Hashtable<String, String[]>). This will affect third party code + that extend Copy and override Copy#doFileOperations. + +* <loadproperties> didn't expand properties while <property file="..."/> + does, so they were not equivalent. This has been fixed, which means + that propetries may get expanded twice if you use an + <expandproperties> filterreader. Bugzilla Report 17782. + +* User defined tasks and typedefs are now handled internally in the + same way as predefined tasks and typedefs. Also tasks and typedefs + are resolved at a later stage. This causes some + differences especially for user defined task containers. + +* <checksum> log message "Calculating checksum ..." has been degraded + from INFO to VERBOSE. + +Fixed bugs: +----------- +* Filter readers were not handling line endings properly. Bugzilla + Report 18476. + +* Filtersets were also not handling line endings properly. + +* Expand tasks did not behave as expected with PatternSets. + +* <property environment=... /> now works on OS/400. + +* <cab> could hang listcab on large <fileset>s. + +* The starteam stcheckout, stcheckin tasks now correctly compute + status of files against whatever local tree they are run against + and, optionally, will not process a file if it is current. + Previously you had to process everything unless you ran against the + default folder which wasn't the normal use-case for ant-starteam. + The stlist task now similarly displays that status correctly making + it a more generally useful tool. + +* entity includes would cause exceptions if path names included spaces. + +* addConfiguredXXX would not work for TaskAdapter wrapped tasks + +* Fix <ilasm> outputfile testing so that the output file does not need + to exist beforehand. + +* Ant will now exit with a return code of 1 if it encounters problems + with the command line arguments. + +* ClassLoader creation changes to use a factory method in Project. A new + class AntClassLoader2 implemented for 1.2+ specific features including + Package information and addition of classes specified in the Class-Path + element of a Jar's manifest. + +* It is now possible in <exec> to resolve the executable to a project + basedir or execution dir relative executable. The resolveExecutable + must be used to pick up such executables. + +* splash screen wouldn't disappear when build was finished. + +* <exec> output and error streams can now be redirected independently + to either a property or a file (or both) + +* TarEntry's File-arg constructor would fail with a + StringIndexOutOfBoundsException on all OSes where os.name is shorter + than seven characters. Bugzilla Report 18105. + +* <copy> and <move>'s failonerror didn't apply to filesets pointing to + non-existant directories. Bugzilla Report 18414. + +* The <stripjavacomments> filter sometimes removed parts of string + constants. Bugzilla Report 17441. + +* <antlr> will now recompile your grammar if the supergrammar has + changed. Bugzilla Report 12691. + +* <property env> will now work on Unices with /bin/env instead of + /usr/bin/env. Bugzilla Report 17642. + +* <jar index="on"> could include multiple index lists. Bugzilla 10262. + +* The index created by <jar> didn't conform to the spec as it didn't + include the top-level entries. Bugzilla Report 16972. + +* <tar> and <zip> didn't honor the defaultexcludes attribute for the + implicit fileset. Bugzilla Report 18637. + +* The <replacetokens> filter would throw an exception if the token's + value was an empty string. Bugzilla Report 18625. + +* Perforce tasks relying on output from the server such as <p4change> + and <p4label> were hanging. Bugzilla Reports 18129 and 18956. + +* Improve exception and logging behavior of Perforce tasks. + Bugzilla report 18154. + +* build.sh install had a problem on cygwin (with REALANTHOME). + Bugzilla Report 17257 + +* <replaceregexp> didn't work for multi-byte encodings if byline was false. + Bugzilla Report 19187. + +* <replaceregexp> was altering unnecessarily the timestamp of the directories + containing the files to process + Bugzilla Report 22541. + +* file names that include spaces need to be quoted inside the @argfile + argument using forked <javac> and (all JDKS). Bugzilla Report 10499. + NB : a first correction was only introducing quotes for JDK 1.4 + It has been changed to quote for all external compilers when paths + contain spaces. + Also the backslashes need to be converted to forward slashes + Bugzilla Report 17683. + +* Setting filesonly to true in <zip> and related tasks would cause the + archives to be always recreated. Bugzilla Report 19449. + +* file names that include spaces need to be quoted inside the @argfile + argument using <javadoc> and JDK 1.4. Bugzilla Report 16871. + +* <junit> didn't work with custom formatters that were only available + on the user specified classpath when a timeout occurred. Bugzilla + Report 19953. + +* <different> selector : make ignoreFileTimes effectively default to true + and fix a bug in the comparison of timestamps. Bugzilla Report 20205. + +* <different> selector can now be nested directly under a fileset + Bugzilla Report 20220. + +* <cvstagdiff> had a problem with "dd-MM-yy hh:mm:ss" formats + Bugzilla Report 15995. + +* <cvstagdiff> cvsroot and package attributes added to the root + element tagdiff of the xml output + Bugzilla Report 16081. + +* <cvstagdiff> had a problem with aliased modules and with requests for + multiple modules. Bugzilla Reports 21373 and 22877. + +* <cvstagdiff> could not parse properly the revision number of new files with + CVS 1.11.9 or higher. Bugzilla Report 24406. + +* <fixcrlf> make fixcrlf create its temporary files in the default directory + of FileUtils#createTempFile instead of the destination dir of fixcrlf. + Bugzilla Report 20870. + +* <ejbjar> implementation for Borland. + Prevent the task from being blocked by error messages coming from java2iiop. + Bugzilla Report 19385. + +* <unzip>'s and <untar>'s nested patternsets didn't work as documented + when the pattern ended in a slash or backslash. Bugzilla Report 20969. + +* <fixcrlf> will now create the parent directories for the destination + files if necessary. Bugzilla Report 20840. + +* <xmlproperty> now handles CDATA sections. BugZilla Report 17195 + +* <translate> now translate tokens that are placed close together. + Bugzilla Report 17297 + +* Nested websphere element for ejbjar does not support spaces in file name. + Bugzilla Report 21298 + +* Don't multiply Class-Path attributes when updating jars. Bugzilla + Report 21170. + +* Do not overwrite the value (increment) attribute of PropertyFile nested + Entry element. Bugzilla Report 21505. + +* Prevent sysproperties with no key or no value from being added in <junit>. + Bugzilla Report 21684. + +* Allow references to be properly inherited via antcall + Bugzilla Report 21724. + +* ftp chmod failed when the remote system was UNIX and local system Windows + Bugzilla Report 21865. + +* ftp put with chmod failed when the remote system was UNIX and local system + Windows. Bugzilla Report 23143. + +* ftp did not set the ascii mode explicity, causing problems with ftp servers + having binary as default + +* ftp was not able to download files when they were pointed to by symbolic + links. Bugzilla Report 14063. + +* ftp is able to download also directories pointed to by symbolic links. + +* replace would change \r\n into \r\r\n under Windows. + +* junitreport with frames did not display a link for classes without a package + or in the top package. + Bugzilla Report 21915. + +* Project.toBoolean(String) now handles null as argument and does not throw a + NullPointerException any more. + +* The socket condition will now close the socket created to test. + Bugzilla Report 23040. + +* <junit includeantruntime="true" fork="true"> replaced the CLASSPATH instead + of adding to it. Bugzilla Report 14971. + +* <splash> could fail on JVMs that use null to indicate the system classloader. + Bugzilla Report 23320. + +* <xmlcatalog>s only worked when defined inside of tasks. Bugzilla + Report 20965. + +* <csc> and siblings (<vbc> <jsharpc>) handle large filesets by +automatic use of response files. Bugzilla report #19630 + +Other changes: +-------------- + +* Shipped XML parser is now Xerces 2.6.0 + +* All tasks can be used outside of <target>s. Note that some tasks + will not work at all outside of targets as they would cause infinite + loops (<antcall> as well as <ant> and <subant> if they invoke the + current build file). + +* Six new Clearcase tasks added. + +* A new filter reader namely tokenfilter has been added. Bugzilla + Report 18312. + +* A new attribute named skip is added to the TailFilter and + HeadFilter filter readers. + +* The filesetmanifest attribute of <jar> has been reenabled. + +* The start and end tokens for <translate> may now be longer than a + single character. + +* <setproxy> lets you set the username and password for proxies that + want authentication + +* <loadproperties> has a new encoding attribute. + +* <echoproperties> can now create XML output. + +* <echoproperties> has a new srcfile attribute that can make it read + properties files and output them instead of Ant's properties. + +* <filterset> will now resolve filters recursively. + +* <input> has a new attribute that allows you to specify a default value. + +* Added <image> task (requires JAI). + +* <image> task has now proportions attribute in the <scale/> nested element + instead of keepproportions (bringing in more functionality) + +* New condition <isreference> + +* <ftp> now has a preservelastmodified attribute to preserve the + timestamp of a downloaded file. + +* new rmdir action for <ftp> that removes directories from a fileset. + +* <ftp> has attributes timediffauto and timediffmillis to use together + with the newer attribute to tell ant to take into account a time difference + between client and remote side. + Bugzilla Report 19358. + +* <ftp> has been optimized to go directly to the include patterns. + This reduces scanning time under UNIX when followsymlinks="true" + and casesensitive="true" (the default) + Bugzilla Report 20103. + +* The SOS and VSS tasks will no longer unconditionally prepend a $ to + vsspath or projectpath. + +* OS/400 now gets detected by the os condition. + +* <arg> has a new attribute pathref that can be used to reference + previously defined paths. + +* <xmlproperty> has been improved, you can now expand ${properties}, + define ids or paths and use Ant's location magic for filename resolutions + in the XML file. + +* <xmlcatalog> will now support external catalogs according to the + OASIS "Open Catalog" standard - if resolver.jar (newer than version + 1.0) from Apache's xml-commons is in your CLASSPATH. + +* Starteam tasks now have support for revision labels and build labels. + Checkouts now have the option of using repository timestamps, instead + of current. + +* new task <symlink> that creates and maintains symbolic links. + +* new tasks <chown> and <chgrp> which are wrappers of the Unix commands. + +* new task <attrib> to change file attributes on Windows systems. + +* <style> has a new attribute reloadstylesheet to work around a + bug in widespread Xalan versions. + +* <tarfileset> has a new dirmode attribute to specify the permissions + for directories. + +* <fixcrlf>'s eol attribute now also understands "mac", "unix" and "dos". + +* <classfileset> now picks up dependencies of the form MyClass.class. This + works for the code generated by the Sun java compiler. It may not work for + all compilers. + +* a new attribute "globalopts" can be added to all Perforce tasks. + You can put in it all the strings described by p4 help usage. Refer to + the docs for more information. + +* new Perforce tasks <p4integrate> , <p4resolve>, and <p4labelsync> + +* <p4submit> will change the property p4.change if the Perforce server + renumbers the change list. + It will set the property p4.needsresolve if the submit fails, + and the message says that file(s) need to be resolved. + +* <replaceregexp> now has an optional encoding attribute to support + replacing in files that are in a different encoding than the + platform's default. + +* The <exec> task may now have its input redirected from either a file + or a string from the build file. The error output can be separated + to a different file when outut is redirected. standard error may be + logged to the Ant log when redirecting output to a file + +* The <java> task also supports the input redirection and separate + error streams introduced to the <exec> task. In addition, it is now + possible to save the output into a property for use within the build + file as was possible with <exec> in Ant 1.5 + +* The <javadoc> task <tag> subelement has been enhanced to allow files + with tag mappings to be used. + +* New tasks: <scp> supports file transfers, <sshexec> executes a + command over SSH. They require jsch, a BSD licensed SSH library that + can be found at http://www.jcraft.com/jsch/index.html + +* New filterreader <escapeunicode/>. + +* Support for HP's NonStop Kernel (Tandem) OS has been added. + +* <cab>'s basedir attribute is now optional if you specify nested + filesets. Bugzilla Report 18046. + +* New task <sync> that synchronizes two directory trees. + +* <apply> has new forwardslash attribute that can force filenames to + use forward slashes (/) as file separators even on platforms with a + different separator. This is useful if you want to run certain + ported Unix tools. + +* Copy has a new outputencoding attribute that can be used to change + the encoding while copying files. Bugzilla Report 18217. + +* The xml formatter for JUnit will now honor test case names set with + setName. Bugzilla Report 17040. + +* JUnit now has an attribute reloading, which, when set to false, + makes the task reuse the same class loader for a series of tests. + +* <concat> now supports filtering and can check timestamps before + overriding a file. Bugzilla Report 18166. + +* <junit> has a new attribute tempdir that controls the placement of + temporary files. Bugzilla Report 15454. + +* <jdepend> now supports a new nested element <classespath> which is + the same as <sourcespath> but point to compiled classes (the + prefered mode of operation for JDepend > 2.5). Additionally, nested + <exclude> elements can be used to exclude certain packages from + being parsed. Bugzilla Report 17134. + +* The JProbe tasks now also work with JProbe 4.x. Bugzilla Report 14849. + +* <javacc> and <jjtree> will now autodetect JavaCC 3.x and can use it. + +* <sql> has a new attribute to control escape processing. + +* <sql> is able to display properly several resultsets if you are + running a compound sql statement. Bugzilla Report 21594. + +* A new <containsregexp> selector has been added, that selects files + if their content matches a certain regular expression. + +* <antlr>'s debug attribute has been enabled. Bugzilla Report 19051. + +* <mail> has a new attribute charset. Bugzilla Report 15434. + +* <mail> has new attributes user and password for SMTP auth. + maillogger can also use this. + The implementation only works with JavaMail (encoding="MIME"). + Implementation with plain mail remains to do. + Bugzilla Report 5969. + +* <mail> and mailloger support SMTP over TLS/SSL + Bugzilla Report 19180. + +* <mail> the attributes from, replyto ,tolist, cclist, bcclist + can now contain email addresses of the form name <address@xyz.com> + or (name) address@xyz.com + Bugzilla Report 22474. + +* <mail> (version PlainMail) + prevent blank headers from being sent, + make the order of the headers of plain mail messages predictable + Bugzilla Report 22088. + +* <zipfileset> can now be defined in the main body of a project + and referred to with refid="xyz". Bugzilla Report 17007. + +* A wrapper script for OS/2 has been added. + +* <unzip> will now detect and successfully extract self-extracting + archives. Bugzilla Report 16213. + +* <stcheckout> has a new attribute "converteol" that can be used to + control the automatic line-end conversion performed on ASCII files. + Bugzilla Report 18884. + +* Users can now modify the list of default excludes using the new + defaultexcludes task. Bugzilla Report 12700. + +* There is a new data type <propertyset> that can be used to collect + properties. It is supported by <ant>, <antcall>, <subant>, <java>, + <echoproperties> and <junit>. + +* <concat> can now control the encoding of the output as well and optionally + add new-line characters at the end of files that get concatenated but + don't end in newlines. Bugzilla Report 12511. + +* <rpm> will detect the rpmbuild executable of RedHat 8.0 and newer + and use that if it is on your PATH. Bugzilla Report 14650. + +* A new task <rexec> has been added that requires commons-net to work. + Bugzilla Report 19541. + +* <javadoc> now supports a nested <arg> element in addition to the + additionalparams attribute. + +* You can now determine the order of standard tags in <javadoc> via + <tag> elements - you must not use the description attribute for them. + Bugzilla Report 18912. + +* <javadoc> now supports the -noqualifier switch. Bugzilla Report 19288. + +* <javac>'s executable attribute can now also be used to specify the + executable for jikes, jvc, sj or gcj. Bugzilla Report 13814. + +* <javac> has a new attribute tempdir that can control the placement + of temporary files. Bugzilla Report 19765. + +* A new magic property build.compiler.jvc.extensions has been added + that can be used to turn of Microsoft extensions while using the jvc + compiler. Bugzilla Report 19826. + +* You can now limit the parallelism of <apply> and <chmod> by using the new + maxparallel attribute. + +* With the new addsourcefile attribute, you can make <apply> ommit the + source file names from the command line. Bugzilla Report 13654. + +* <apply> and <chmod> now support nested <filelist>s as well as <dirset>s. + Bugzilla Reports 15929 and 20687. + +* <apply> and <chmod> will display a summary if you set the new + verbose attribute to true. Bugzilla Report 19883. + +* <copy>/<move>'s failonerror attribute can now also be used to + continue the build if an I/O error caused a problem. Bugzilla + Report 12999. + +* new selector <type/> allowing to select only files or only directories. + Bugzilla Report 20222. + +* <java> and <junit> now support a nested <bootclasspath> element that + will be ignored if not forking a new VM. + +* <junit>'s nested <formatter> elements now support if/unless clauses. + +* <ejbjar> + cmpversion attribute added + jboss element will look for jbosscmp-jdbc.xml descriptor + if ejbjar has cmpversion="2.0" set + Bugzilla Reports 14707 and 14709. + +* <pvcs> config attribute added to set the location of a specific PVCS + .cfg file + Bugzilla Report 9752 + +* <mapper> has an "unpackage" mapper + Bugzilla Report 18908 + +* Added <scriptdef> task allowing tasks to be defined using any BSF-supported + scripting language. + +* <touch>'s datetime attribute can now accept time with a granularity + of seconds as well. Bugzilla Report 21014. + +* <checksum> has two new properties: totalproperty and todir. + +* FileUtils#createTempFile will now create temporary files in the + directory pointed to by the property java.io.tmpdir + +* <unzip> and friends now supports an optional encoding attribute to + enable it to expand archives created with filenames using an encoding + other than UTF8. Bugzilla Report 10504. + +* <patch> has a new attribute destfile that can be used to create a new + file instead of patching files in place. + +* OpenVMS is detected as a valid OS family. + +* DirectoryScanner has been optimized for cases where include patterns do not + start with wildcards. Bugzilla Report 20103. + +* DirectoryScanner begins to be optimized not to scan excluded directories. + Bugzilla Report 21941. + +* Added keep-going feature. Bugzilla Report 21144 + +* The archives generated by <zip> and friends will now contain CRC and + size information in the "local file header", thereby providing this + information to applications that read the archives using + java.util.ZipInputStream. Bugzilla Report 19195. + +* <copy> and <move> can now handle mappers that return multiple + mappings per source path. This behaviour is enabled by using + an enablemultiplemapping attribute. Bugzilla Report 21320. + +* <exec> will now work on OpenVMS (please read the notes in + <exec>'s manual page). Bugzilla Report 21877. + +* <exec> will now have a new attribute spawn (default false). + If set to true, the process will be spawned. Bugzilla Report 5907. + +* <java> will now have a new attribute spawn (default false). + If set to true, the process will be spawned. Bugzilla Report 5907. + +* <parallel> now supports a timeout which can be used to recover + from deadlocks, etc in the parallel threads. <parallel> also + now supports a <daemons> nested element. This can be used to + run tasks in daemon threads which the parallel task will not + wait for before completing. A new attribute failonany will cause + <parallel> to throw an exception if any thread fails without + waiting for all other threads to complete. + +* <zip> and friends will consume far less memory than they used to + when run with compress="false". Bugzilla Report 21899. + +* <if/> and <unless/> attributes added to <param/> element of <style> + Bugzilla Report 22044 + +* <zip> and friends have a new attribute "keepcompression" that can be + used to incrementally build an archive mixing compressed and uncompressed + entries. + +* <junit>'s XML formatter adds a new classname attribute to the <testcase> + elements. + +* new <permissions> type add permission handling to the code + this type can be nested in the <java> and <junit> tasks. + Bugzilla Report 22533. + +* additional shortcuts for ant options (-d --> -debug, -e --> -emacs, + -h --> -help, -p --> -projecthelp, -s --> -find). + +* new selector <modified>. "cache" was renamed to "modified". + Bugzilla Report 20474. + +* <stcheckout> and <stlist> have a new asofdate attribute that can be + used to checkout/list files based on a date instead of a label. + Bugzilla Report 20578. + +* New filter <concatfilter>. Adds the content of file at the beginning + or end of a file. Discussion started at + http://marc.theaimsgroup.com/?l=ant-user&m=106366791228585&w=2 + +* New task <import> + +* New task <macrodef> + +* New task <presetdef> + +* Ant libraries that can make use of namespaces to avoid name + clashes of custom tasks + +* <java> and <junit> now support <assertions>, which let you enable + and disable Java1.4 assertions on a package or class basis. These + only work when fork=true, currently. + +* .NET tasks expanded with VB support <vbc> and J#, via <jsharp>, + <importtypelib> and <ilasm>. <csc> supports nested <src> types, + <defines> for (potentially conditional) definitions, <reference> + filesets for references. The executable attribute lets you switch to + mono or other implementations -<csc> has been tested with Mono on + Linux and OSX. + + +Changes from Ant 1.5.3 to Ant 1.5.4 +=================================== + +Changes that could break older environments: +-------------------------------------------- + +* If the Visual Age tasks used to work for you, they may stop doing so + now - and we'd like to know about it. The current set of tasks is + supposed to work with any version of VAJ starting with 3.0. + +Fixed bugs: +----------- + +* The Visual Age for Java tasks didn't work (at least for versions 3.0 + and higher). Bugzilla Report 10016. + +* URL-encoding in <vaj*port> didn't work properly. + +* VAJRemoteUtil called getAbsolutePath instead of getPath + causing problems when using a Windows VAJ server from a UNIX server. + Bugzilla Report 20457. + +* VAJImport task failed with NullPointerException when using DirectoryScanner. + Bugzilla Report 22080. + +Other changes: +-------------- + +* Shipped XML parser is now Xerces 2.5.0 + +* <javah> will invoke oldjavah on JDK 1.4.2. Bugzilla Report 18667. + +* The VAJ tasks now support a haltonfailure attribute to conditionally + keep building even if they fail. + +* It is now possible to use the latest (versioned or unversioned) edition + in <vajload> by using special wildcard characters. Also fixes + Bugzilla Report 2236. + +Changes from Ant 1.5.2 to Ant 1.5.3 +=================================== + +Changes that could break older environments: +-------------------------------------------- + +* The <zip> task and friends have again changed a method signature + (sorry, was necessary to fix bug 17780). The return type of + getResourcesToAdd has changed. + +Fixed bugs: +----------- + +* <zipfileset>'s filemode would get ignored and the dirmode was used + for the included files as well. As a side effect, WinZIP was unable + to extract or display the files, so they seemed to be missing from + the archive. Bugzilla Report 17648. + +* <ftp> could use the wrong path separator when trying to change the + remote working directory. Bugzilla Report 17735. + +* <jar update="true"> would loose all original files if you didn't + specify any nested <(zip)fileset>s and the manifest had changed. + Bugzilla Report 17780. + +* If you used a value starting with \ on Windows for the appxml + attribute of <ear> or the webxml attribute of <war>, it would be + ignored. Bugzilla Report 17871. + +* Ant will no longer implicitly add Sun's rt.jar in <javac> when you + use jvc and don't specify a bootclasspath. Bugzilla Report 18055. + +* The prefix attribute of <zipfileset> would not generate directory + entries for the prefix itself. Bugzilla Report 18403. + +* starteam checkout can now handle deleted labels. Bugzilla Report 17646. + +* The Unix wrapper script failed if you invoked it as a relative + symlink and ANT_HOME has not been set. Bugzilla Report 17721. + +Other Changes: +-------------- +* Added ability to specify manifest encoding for the <jar> and + <manifest> tasks + +Changes from Ant 1.5.1 to Ant 1.5.2 +============================================= + +Changes that could break older environments: +-------------------------------------------- +* ANT_OPTS environment variable is now applied at the start of the + Java command line, allowing position specific parameters of some + JVMs, such as -classic to be specified. + +* ZipScanner#getIncludedFiles will now return the names of the ZipEntries + that have been matched instead of the name of the archive. + +* The <zip> task and friends have been heavily modified, almost every + method signature of the Zip class has changed. If you have subclassed + Zip (or one of its subclasses), your class will most likely not + compile against the current code base. If it still compiles, it will + probably not work as in Ant 1.5.1. + +Fixed bugs: +----------- +* <translate> was not ignoring comment lines. + +* <manifest> wouldn't update an existing manifest if only an attribute + of an existing section changed. + +* ant.bat now supports the ANT_ARGS and JAVACMD environment variables + again (like Ant 1.5 did). + +* The "plain" <junit> <formatter> could throw a NullPointerException + if an error occurred in setUp. + +* <junit> will now produce output when a test times out as well. + +* <replace> would count some internal character replacements when + reporting the number of replaced tokens. + +* <concat> would cause an exception if a <filelist> pointed to files + that do not exist. + +* <javadoc> will now pass -source to custom doclets as well. + +* <cvstagdiff> would throw a NullPointException if there had been no + differences. + +* <cvschangelog> could miss today's changes. + +* <concat> could append newline characters between concatenated files. + +* <xmlvalidate> ignored the specified encoding of the files to + validate. + +* the errorsbeginat attribute of the <http> condition didn't work. + +* Ant will try to force loading of certain packages like com.sun.* + from the system classloader. The packages are determined by the + version of the JVM running Ant. + +* Ant didn't find the runtime libraries on IBM's JDK 1.4 for Linux. + +* random component of temporary files is now always a positive integer. + +* Ant could incorrectly try to use the 1.4 regexp implementation even + if it isn't available if you run the JVM with -Xverify:none. + +* Ant would die with an exception if you used nested <reference> + elements in Ant and the refid attribute didn't point to an existing + project reference. + +* The <get> task can now be compiled (and Ant thus bootstrapped) using + Kaffee. + +* build.sysclasspath will now be honored by more tasks. + +* The signjar keystore attribute has been reverted to a String allowing + it to once again accept URLs. This should not affect current File based usage + unless you are extending the Signjar task. + +* <jar update="true"> would remove the original manifest. + +* fix up folder creation in PVCS task + +* <tar>'s up-to-date check didn't work for nested <(tar)fileset>s. + +* Corrected a problem in XMLLogger where it would not associated + messages with a taskdef'd task + +* <uptodate> now works when using attributes (i.e. not filesets) and pointing + to the same file + +* Java task (and output system) now stores output which doos not end + with a line feed. + +* splash screen wouldn't disappear when build was finished. + +* <exec> now supports OS/2. + +* <zip> and friends would only update/recreate existing archives if + the files to add/update have been newer than the archive. + +* <javadoc>'s <link> element could fail for offline="true" on some JDKs. + +Other changes: +-------------- + +* MailLogger now sets the Date header correctly. + +* Shipped XML parser is now Xerces 2.3.0 + +* signjar now accepts a maxmemory attribute to allow the memory allocated to the + jarsigner tool to be specified. The jarsigner from the JDK's JAVA_HOME bin + dir is now used rather than the first jarsigner on the path. + +* **/.DS_Store has been added to the list of default pattern excludes. + +* The Created-By header in the default manifest now contains the JVM + vendor and version according to the jar specification. A new header, + Ant-Version provides the Ant version used to create the jar. + +* <zip> can now store Unix permissions in a way that can be + reconstructed by Info-Zip's unzip command. + +Changes from Ant 1.5.1Beta1 to 1.5.1 +==================================== + +Fixed bugs: +----------- + +* <tstamp>'s prefix attribute failed to apply to nested <format> elements. + +* <junitreport> created an empty junit-noframes.html if no format had + been specified. + +* <basename> would remove more than it should if the file name + contained more than one dot. + +* <filterset>s nested into <filterset>s didn't work. + +Other changes: +-------------- + +* Shipped XML parser is now Xerces 2.2.0 + +* Filesets now support a 'file' attribute, allowing a single-file + fileset to be constructed without having to specify its parent + directory separately. + +* <junit> will now return the result of a call to getName instead of + "unknown" for Test implementations that don't extend TestCase but have + a public String getName() method. + +Changes from Ant 1.5 to 1.5.1Beta1 +================================== + +Fixed bugs: +----------- +* Date/time in CvsChangeLog was in local timezone and 12 hour format leading + to a problem when sorting by time. It is now UTC (GMT) and in 24-hour + format as per cvs 'specifications'. + +* CvsTagDiff now supports ampersand modules or modules that have a different + root directory than their name. + +* EjbJar threw NPEs for the Websphere element. The property 'websphere.home' + was not documented. + +* Mail example in the documentation was not correct. + +* Checksum was broken in the following scenario: + (using verifyproperty OR in a condition) AND using filesets + with multiple files. + +* The ExpandProperties filter threw NPEs when defined using + the <filterreader> format. + +* The sh wrapper script didn't work under Cygwin if ANT_HOME wasn't + set with a Unix style filename. + +* The sh wrapper script could fail if you started Ant from a directory + with whitespace in its name. + +* ant -diagnostics was not working properly when the task dependency + was missing and was just printing the missing dependency. + +* If a task got redefined via <taskdef>, it lost its child elements. + +* <property>'s classpathref attribute was broken. + +* <arg line="''" /> would result in no command line argument, will now + be a single empty argument. Use <arg value="''"/> if you need the + quotes literally. + +* <replaceregexp> could append a newline character at the end of the + file. + +Other changes: +-------------- + +* Appendix E of Java Development with Ant (Loughran/Hatcher) was + contributed to the docs. + +* <available> will only print deprecration warnings if it is actually + used to change the value of a property. + +Changes from Ant 1.5beta3 to Ant 1.5 +==================================== + +Changes that could break older environments: +-------------------------------------------- + +* The filesetmanifest attribute added to <jar> after the 1.4.1 + release has been removed for now. This change may affect only + the 1.5Beta/1.6Alpha users. An attempt will be made to add this + feature back into Ant 1.6. + +Fixed bugs: +----------- + +* <zip> and friends would always update existing archive if you set + the update attribute to true. + +* To support backward compatibility with older versions, <pathconvert> + will once again set the property, even if the result is the empty + string, unless the new 'setonempty' attribute is set to false|no|off + (default is "true"). + +* The manifest task would crash XmlLogger + +Other changes: +-------------- + +* added **/.svn and **/.svn/** to the default excludes + +Changes from Ant 1.5beta2 to Ant 1.5beta3 +========================================= + +Changes that could break older environments: +-------------------------------------------- + +* <pvcs> default filenameformat has been different from Ant 1.4.1. + Now it is different from 1.5beta1 and 1.5beta2. + +* <pathconvert> won't set the property if the result is the empty string. + +Fixed bugs: +----------- + +* <available> could fail to find files or directories that happen to + start with the name of the project's basedir but are not children of + the basedir. + +* Nested <property>'s inside <ant> can now be overriden by subsequent + <ant> and <antcall> tasks. + +* <xslt>'s outputtype attribute wouldn't do anything. + +* <linecontains> filterreader could swallow lines. + +* <sequential> used to configure the tasks (set their attributes) + before the first task has been executed. This means that properties + that have been set by nested task seemed to be unset for the other + tasks in the same <sequential> element. + +* <javac>'s sourcepath setting has been ignored by some compiler + implementations. + +* <javadoc>'s packagelist attribute didn't work. + +* the plain mailer would always use port 25 in <mail>. + +* Ant's default logger could swallow empty lines. + +* ejbjar's iPlanet nested element now can process multiple descriptors. + +* IPlanetEjbc was looking in the wrong place for four iiop files. + +* <javac> would pass the -source switch to JDK 1.3's javac, even + though it doesn't support it. + +Other changes: +-------------- + +* <checksum> now uses a buffer (of configurable size). + +* The "Trying to override task definition" warning has been degraded + to verbose level if the two task definitions only differ in the class + loader instance that has loaded the definition. + +* Add a jvmargs to the ejbjar's weblogic element to allow additional + arguments to be provided to the VM runnign ejbc. Document the + jvmdebuglevel attribute which can be used to avoid warnings about + interface classess being found on the classpath. Document the new + <sysproperty> element which allows JVM properties to be defined. + Added an outputdir attribute to allow the destination to be a + directory into which the exploded jar is written. + +* ejbjar now supports Borland Enterprise Server 5 and Jonas 2.5 + +Changes from Ant 1.5beta1 to Ant 1.5beta2 +========================================= + +Changes that could break older environments: +-------------------------------------------- + +* Properties will now be expanded in mail message bodies. This means + that one $ sign will be stripped if your mail message contains the text $$. + +* org.apache.tools.ant.taskdefs.Expand no longer extends MatchingTask. + +* Available#setFile now again uses a File argument as it did in 1.4, + this may break environments that have been adapted to the String + argument version present in 1.5beta1. + +Fixed bugs: +----------- +* When <move> attempts a rename, it deletes the destination file, if it + exists, before renaming the source file. However, <move> was not + checking if the destination file was actually a directory before + trying to delete it. + +* Make CVS Tasks to work under Cygwin. + +* Fix LineContains to handle huge files elegantly without causing + Stack Overflows. + +* if you ask for the "classic" compiler on Java1.4, you get upgraded to + "modern" because there is no classic compiler any more. + +* the <http> condition was viewing 404 'not found' exceptions as success. Now + it defaults to viewing any response >=400 as an error, and has an + errorsBeginAt attribute you can use if you want a higher or lower value. + +* <get> throws a build exception on an http authorization error, unless you + have set ignoreerrors to true. + +* <wsdltodotnet> was spelt in Wintel case: <WsdlToDotnet>. It is now lower + case, though the old spelling is retained for anyone who used it. + +* Merging of Manifests in jar now works as documented. + +* paths that have been separated by colons would be incorrectly parsed + on NetWare. + +* runant.pl now supports NetWare. + +* <tempfile> and <setproxy> tasks were in beta1, but not defined by + default; They now are. <tempfile> fills a property with the name of a + temporary file; <setproxy> lets you set the JVM's http, ftp and socks proxy + settings. + +* <available classname="foo" ignoresystemclasses="true"> failed for + JDK 1.1 and 1.2, even if the class could be found on the + user-specified classpath. + +* <property environment=... /> now works on z/OS. + +* forked <javac> failed for the wrong reason on JDK 1.1 - Ant would + use a temporary file to hold the names of the files to compile under + some conditons, but 1.1 doesn't support this feature. Ant will no + longer try this, but you may run into problems with the length of the + command line now. + +* the refid attribute for <property>s nested into <ant> or <param>s + nested into <antcall> didn't work. + +* <replaceregexp> didn't work for nested <fileset>s. + +* <javadoc> dropped sourcepath entries if no "interesting" .java + source files could be found below them. This has been backwards + incompatible and caused problems with custom doclets like xdoclet. + +* Using the doclet, docletpath or docletpathref attributes of + <javadoc> may have caused NullPointerExceptions. + +* nested <filesets> of <javadoc> would include too much. + +* <dependset> will no longer choke on <targetfileset>s that point to + non-existing directories. + +* <patch> didn't work at all. + +* <replace> and <replaceregexp> now fail if the file they are working + on is locked. + +* <javadoc> would pick up the wrong executable in the combination JDK + 1.2 and AIX. + +Other changes: +-------------- + +* z/OS now gets detected by the os condition. + +* <fileset> and <dirset> now have an optional followsymlink attribute + that can prevent Ant from following symbolic links on some platforms. + +* BeanShell is now supported in the <script> task. + +* <ejbjar> under Weblogic attempts to use the ejbc20 compiler for 2.0 beans + based on the deployment descriptor's DTD reference. Under weblogic 7.00 Beta + this ejbc class has been deprecated. To avoid the deprecation warning use + ejbcclass="weblogic.ejbc". + +* <ejbjar> will add a manifest to the generated jar based on the naming + convention in use. This overrides the manifest specified in the + <ejbjar> attribute + + +Changes from Ant 1.4.1 to 1.5beta1 +================================== + +Changes that could break older environments: +-------------------------------------------- + +* Important: Single $ signs are no longer silently stripped! + Before you panic that we have broken all your build files, we have kept + the old "$$" -> "$" behaviour. So only build files which accidentally had + a $ sign in a string that was being silently stripped may break. + We added this fix to stop newbie confusion; if you want to write a + build file which works on ant versions 1.4.1 or earlier, stay with + the double $$ sign rule. + +* Project.getBuildListeners now returns a clone of the listener + list. Changes to the returned list will not affect the listeners + currently attached to the Project. It also means that it is safe to + iterate over the returned list if listeners are added or removed + during the traversal. + +* <pvcs> default filenameformat has been different from Ant 1.4.1. + +* Some messages that are printed during startup will not be + written to the logfile specified via -logfile as they might destroy + the format of the file for special BuildLoggers (like XmlLogger). + +* The filesetmanifest attribute added to <jar> after the 1.4.1 + release has been removed for now. This change may affect only + the 1.5Beta/1.6Alpha users. An attempt will be made to add this + feature back into Ant 1.6. +* Shipped XML parser is now Xerces 2.0.1 along with the XML Parser APIs. + XML Parser APIs is a separate jar that contains the necessary + JAXP/DOM/SAX classes. + +* <telnet> was fixed to expand properties inside nested <read> and + <write> elements; before this only happened when you assigned the text + to the string attribute. If you had $ signs in the string, they may + need escaping. + +* the RegexpMatcher interface has been extended to support case + insensitive matches and other options - custom implementations of + this interface won't work any longer. We recommend to use the new + Regexp interface that also supports substitution instead of the + RegexpMatcher interface in the future. + +* <gzip> will throw an exception if your src attribute points to a directory. + +* Unjar, Unzip and Unwar will throw an exception if the Src attribute + represents a directory. Support for nested filesets is provided + instead. + +* It is no longer possible to overwrite a property using tasks like + <condition>, <exec>, <pathconvert>, or <tstamp>. In some exceptional + cases it will generate a warning if you attempt to overwrite an + existing property. + +* Taskwriters please note: Whenever tasks had any overloaded set* methods, + Ant's introspection mechanism would select the last overloaded method + provided to it by the Java Runtime. A modification has now been made such + that when the Java Runtime provides a method with a String as its argument, + a check is made to see if there is another overloaded method that takes in + some other type of argument. If there is one such method, then the method + that takes in String as an argument is not selected by the Introspector. + +* The pattern definition **/._* has been included into the Default + Excludes list. + +* <propertyfile>'s <entry> element was modified to remove "never" as a value + as its behavior was undocumented and flakey. + +* The -projecthelp flag now only prints out targets that include the + 'description' attribute, unless the -verbose or -debug flag is included + on the Ant command line. + +* Ant's testcases now require JUnit 3.7 or above, as they now use the new + assertTrue method instead of assert. + +* If the 'output' attribute of <ant> is set to a simple filename or a + relative path, the file is created relative to ${basedir}, not ${user.dir}. + +* The default value for build.compiler is now javac1.x with x + depending on the JDK that is running Ant instead of classic/modern. + +Fixed bugs: +----------- + +* <available> could fail to find files or directories that happen to + start with the name of the project's basedir but are not children of + the basedir. + +* Nested <property>'s inside <ant> can now be overriden by subsequent + <ant> and <antcall> tasks. + +* <xslt>'s outputtype attribute wouldn't do anything. + +* <linecontains> filterreader could swallow lines. + +* <sequential> used to configure the tasks (set their attributes) + before the first task has been executed. This means that properties + that have been set by nested task seemed to be unset for the other + tasks in the same <sequential> element. + +* <javac>'s sourcepath setting has been ignored by some compiler + implementations. + +* <javadoc>'s packagelist attribute didn't work. + +* the plain mailer would always use port 25 in <mail>. + +* Ant's default logger could swallow empty lines. + +* ejbjar's iPlanet nested element now can process multiple descriptors. + +* IPlanetEjbc was looking in the wrong place for four iiop files. + +* <javac> would pass the -source switch to JDK 1.3's javac, even + though it doesn't support it. + +* <zip> and friends would always update existing archive if you set + the update attribute to true. + +* To support backward compatibility with older versions, <pathconvert> + will once again set the property, even if the result is the empty + string, unless the new 'setonempty' attribute is set to false|no|off + (default is "true"). + +* The manifest task would crash XmlLogger + +* A bug existed that prevented generated log files from being deleted as + part of the build process itself. This has now been fixed. + +* Fixed bug where <move> ignored <filterset>s. + +* Ant works properly with the combination of Java1.4/WindowsXP. + +* Fixed bug where <java> used to sometimes invoke class constructors twice. + +* Fixed bug with 4NT shell support. + +* Fixed bug where ant would not perform ftp without remotedir being + specified even though this was not mandatory. + +* Fixed bug where ant would not copy system properties into new Project + in ant/antcall tasks when inheritall="false" is set. + +* <propertyfile> would not close the original property file. + +* <ant> will no longer override a subbuild's basedir with inheritall="true". + +* Fixed problem with the built-in <junit> formatters which assumed + that only one test could be running at the same time - this is not + necessarily true, see junit.extensions.ActiveTestSuite. + +* <jar>'s whenEmpty attribute is useless as JARs are never empty, they + contain at least a manifest file, therefore it will now print a + warning and do nothing. + +* <typedef> hasn't been all that useful as it couldn't be used outside + of targets (it can now) and nested "unknown" elements have always + been considered to be tasks (changed as well). + +* <fixcrlf> would fail for files that contained lines longer than 8kB. + +* Some junit formatters incorrectly assumed that all testcases would + inherit from junit.framework.TestCase. + +* <fixcrlf> dropped the first characters from Mac files. + +Other changes: +-------------- + +* <checksum> now uses a buffer (of configurable size). + +* The "Trying to override task definition" warning has been degraded + to verbose level if the two task definitions only differ in the class + loader instance that has loaded the definition. + +* Add a jvmargs to the ejbjar's weblogic element to allow additional + arguments to be provided to the VM runnign ejbc. Document the + jvmdebuglevel attribute which can be used to avoid warnings about + interface classess being found on the classpath. Document the new + <sysproperty> element which allows JVM properties to be defined. + Added an outputdir attribute to allow the destination to be a + directory into which the exploded jar is written. + +* ejbjar now supports Borland Enterprise Server 5 and Jonas 2.5 + +* added **/.svn and **/.svn/** to the default excludes. + +* Selector Elements now provide a way to create filesets based on + sophisticated selection criteria. + +* Gzip and Bzip2 files can now be constructed in the fly when using + the tar task without having to create the intermediate tar file on + disk. The Untar task can also untar GZip and BZip2 files on the fly + without creating the intermediate tar file. + +* New optional type, <classfileset> added. + +* <ejbjar> now allows control over which additional classes and interfaces + are added to the generated EJB jars. A new attribute "dependency" can be + defined which controls what classes are added. The addition of classes now + uses the Jakarta-BCEL library rather than reflection, meaning bean classes are + no longer loaded into Ant's JVM. The default dependency analyzer is known as + the ancestor analyzer. It provides the same behaviour as the 1.4.1 version of + <ejbjar>. If the BCEL library is not present, a warning will be issued stating + the ancestor analyzer is not available. In this case <ejbjar> will continue + to function but will not add super classes to the jar. + +* <available> has a new attribute named ignoreSystemClasses. + +* New task <cvschangelog/> generates an XML report of changes that occur + on CVS repository. + +* New filter readers: ClassConstants, ExpandProperties, HeadFilter, + LineContains, LineContainsRegExp, PrefixLines, ReplaceTokens, + StripJavaComments, StripLineBreaks, StripLineComments, TabsToSpaces, + TailFilter. + +* <copy>, <loadfile>, <loadproperties>, <move> support FilterChains + of FilterReaders. + +* New task <loadproperties> to load contents of file as Ant properties, + with nested <filterchain> elements. + +* New task <loadfile> to load a whole file into a property. + +* New task <echoproperties> to list your current properties to the screen + or a file. + +* New tasks <bzip2> and <bunzip2> to pack and unpack files using the + BZip2 alogrithm. + +* New tasks <replaceregexp>, <checksum>, <translate>, <waitfor>, + <manifest>, <vsscp>, <vssadd>, <vsscreate>, <splash>, <basename>, <dirname>, + <concat>, <sourceoffsite>, <jarlib-available>, <jarlib-display>, + <jarlib-manifest>, <jarlib-resolve>. + +* A new combined <mail> task, which replaces the old <mail> and + <mimemail> tasks, has been added. The <mimemail> task, and + old SendEmail and MimeMail classes have been deprecated. + +* Mail task allows specification of port number. + +* Users can control what <zip> and <jar> must do when duplicate files + are found. A new element <zipgroupfileset> allows for multiple zip + files to be merged into the archive. In addition, <jar> also has + another new attribute: filesetmanifest. The existing manifest + attribute of <jar> now also accepts the name of a jar added through + a fileset. + +* gzip now checks that the zipfile is older than the source file + before rebuilding the zipfile. + +* TarFileset takes in three new attributes - fullpath, prefix + and preserveLeadingSlashes. + +* <move> attempts to rename the directory, if everything inside it is + included, before performing file-by-file moves. This attempt will + be done only if filtering is off and if mappers are not used. This + is a performance improvement and there is no change otherwise in + the funtionality of this task. + +* Exec task has extra attribute "resultproperty" to get the return code + into a property. + +* Exec task prints a message when a timed-out process is killed. + +* Added optional attributes - name, arch and version to the <os> task. + +* Unjar, Untar, Unwar and Unzip now support patternsets to + select files from an archive for extraction. Filesets may be + used to select archived files for unarchival. + +* Javac task allows debug levels to be specified. Debug levels + will have an effect only when the modern compiler or the + classic compiler (version 1.2 and higher) is used and debugging + is enabled. + +* Added support for specifying CVS_RSH in the <cvs/> task + +* The attributes zipfile, jarfile, warfile and earfile (from the Zip, + Jar, War and Ear tasks) have been deprecated and superseded by a + new attribute "destfile". + +* Added new conditions <isset>, <checksum>, <http>, <socket>, <contains>, + <filesmatch>. + +* <taskdef> and <typedef> will now emit a warning if a task/type of + the given name already exists. + +* A new revision of VAJ tasks: The most important new feature + is the ability to execute VAJ tasks from the command line by + exploiting the Remote Tool Access feature of VAJ. + +* Improved support for Novell NetWare. + +* Added an optional encoding attribute to <fixcrlf>. + +* <apply> has a new attribute relative that allows users to pass the + filenames as relative instead of absolute paths on the command line. + +* References can now be copied into the child build by <ant> and + <antcall> using nested <reference> elements or the new inheritRefs + attribute. + +* <fail> now supports builds to fail based on conditions via if and + unless attributes. + +* Ant now comes with two new BuildLogger implementations - one that + can send emails containing a log of the build process (MailLogger), + and one that colorizes the output based on message levels, using + ANSI color code escape sequences (AnsiColorLogger). + +* A "package" mapper type has been added to allow package directory + names replaced with the dotted form. + +* You can now specify environment variables in the <java> and <junit> tasks + if the fork attribute has been set to true. + +* -propertyfile command-line option has been added to load an entire + property file just as -D properties are declared (as user properties). + -D properties take precedence over -propertyfile specified ones. + +* You can now set an ANT_ARGS environment variable to hold arguments you + always want passed to the 'ant' command -- for example, if you always + want to use a different logger or the -find flag. + +* <tstamp> now supports a new "prefix" attribute to prefix properties set. + +* You can now specify the -sourcepath for <javac> explicitly. + +* <javac> now supports a new "listfiles" attribute to list the source + files it's handing off to the compiler. + +* The compiler implementation for <javac> can now be chosen on a task by + task basis. The new "compiler" attribute of <javac> can be used to override + the value of the build.compiler property, if set. + +* <javac> has a new nested element, <compilerarg>, which allows you + to specify additional args for the specific compiler you're using. + +* <javac>'s "source" attribute is now enabled for jikes as well. + +* <propertyfile>'s <entry> now has a 'unit' attribute to specify the + increment/decrement unit on date operations. + +* <property> now supports a 'prefix' attribute when loading from a file + or resource. + +* In Ant 1.4, a feature has been added to the <junit> task that would + add ant.jar, optional.jar and junit.jar implicitly to the classpath - + this feature can now be disabled by setting the new includeantruntime + attribute to false. + +* <style> behaves differently from any other directory-based task, as it + processes all files that it finds in included directories in + addition to the files matched by your patterns. There is now a new + attribute, 'scanincludeddirectories', to suppress this behavior. + +* <javadoc> now supports a <tag> nested element to provide the -tag option + to the standard Java 1.4 doclet. The element is ignored when not running + on Java 1.4. + +* <ftp> can now chmod files on a remote server that supports + "site chmod", as well as set the umask before transferring files, if + the server supports "site umask". + +* New <serverdeploy> "optional" task. + +* <patternset> now supports nested patternsets. + +* Perforce tasks now support a "failonerror" attribute (defaults to "true"). + +* Open Source application server JOnAS support: + EJB hot deploy and deploy with <serverdeploy> and <ejbjar> + +* Added new DirSet (<dirset>) datatype. + +* <path> now supports nested <dirset> and <filelist> elements. + +* <pathconvert> now supports nested <dirset> and <filelist> elements. + +* <pathconvert>'s "dirsep" and "pathsep" attributes now accept + multi-character values. + +* <copy> task now has a 'failonerror' attribute to allow keep-going + behaviour when the file to be copied is not found (defaults to "true"). + +* <uptodate> now has a 'srcfile' attribute to allow specifying a + full-path filename. + +* <exec>, <sql> and <java> now support append attributes to allow + appending the output to an existing file. + +* <java> now supports a timeout attribute analog to <exec> - it is + highly recommended to only use it together with fork="true". + +* <javadoc> now supports a source attribute to enable javadoc to + handle assertions present in JDK 1.4 source code. + +* <replace> supports a new replacefilterfile attribute that + automatically turns all properties of a given file into + replacefilters. + +* An alias of <xslt> has been added to refer to the <style> task. + +* The compiler implementation for <rmic> can now be chosen on a task by + task basis. The new "compiler" attribute of <rmic> can be used to override + the value of the build.rmic property, if set. + +* <rmic> has a new nested element, <compilerarg>, which allows you + to specify additional args for the specific compiler you're using. + +* org.apache.tools.ant.XmlLogger now is a BuildLogger, rather than just + a BuildListener. It can operate in either mode successfully. + +* <junit> has a new attribute "showoutput". If set to true, output + generated by tests will be sent to Ant's logging system as well as + to the formatters (instead of sending it to the formatters + exclusively). + +* Ant has now a pluggable way to prompt users for input, which is used + by the new <input> task. IDE integrators can provide an + implementation of the InputHandler interface to decouple Ant's input + from the console. An implementation that gets its input from a file + for unattended builds is part of Ant's distribution. + + For more details see docs/manual/inputhandler.html. + +* <patch> has a new attribute that selects the directory in which to + run the command. + +* <javadoc> now supports two new nested elements, <fileset> and <packageset>. + + +Changes from Ant 1.4 to Ant 1.4.1 +=========================================== + +Fixed bugs: +----------- + +* <ant>'s antfile attribute will now also be considered an absolute path on + Windows systems, if it starts with a \ and no drive specifier. + +* The fullpath attribute of <zipfileset> has been ignored if you used + the src attribute at the same time. + +* The manifest file is now always placed as the second entry (after /META-INF) + in generated jars. This allows the manifest to be read by JarInputStreams + +* Fixed bug in depend task which would fail with a NullPointerException if no + dependency cache was specified. + +* sql task now handles REM statements correctly so that lines starying with rem + but which are not comments are actually processed. + +* XMLLogger now uses the task's name rather than the classname + +* <mapper>s will now work as expected if the to pattern expands to an + absolute pathname. + +* <javac> didn't ignore memory settings in non-fork mode + +* <cab> didn't split the options attribute into several command line + arguments correctly. + +Other changes: +-------------- + +* New source attribute for <javac> to enable assertion in JDK 1.4 + +* XmlLogger and <antstructure> now add an encoding declaration to the + XML files they generate. + +* <fileset> has a new attribute "casesensitive" to make it match + filenames in a case insensitive way (if you set it to false) - by + default filesets remain case sensitive. + +Changes from Ant 1.3 to Ant 1.4 +=========================================== + +Changes that could break older environments: +-------------------------------------------- +* JUnitReport now uses the xalan redirect extension for multi-output. + With Xalan 1.2.2 it forces the use of bsf.jar in the classpath. + (Available in the xalan distribution). It is recommended to switch + to Xalan 2.x that do not need it. + +* Zip.setWhenempty() has changed its signature. + +* <rmic> is now implemented using a factory. This makes extending + rmic to use a new compiler a lot easier but may break custom + versions of this task that rely on the old implementation. + +* several Zip methods have changed their signature as we now use a Zip + package of our own that handles Unix permissions for directories. + Furthermore <zip> will now use the platform's default character + encoding for filenames - this is consistent with the command line + ZIP tools, but causes problems if you try to open them from within + Java and your filenames contain non US-ASCII characters. Use the new + encoding attribute of the task and set it to UTF8 to get the old + behavior. + +* The <pvcs> task has been moved to a package of its own. + +* JUnitResultFormater has two additional methods that must be + implemented by custom formatters. + +* Ant will no longer use the canonical version of a path internally - + this may yield different results on filesystems that support + symbolic links. + +* The output generated by the xml formatter for <junit> has changed + again, it doesn't format the numeric value in the time attribute anymore. + +* Pattern matching rules have changes slightly, the pattern foo* + doesn't match files contained in a directory named foo - use foo/* + instead. + +* <fixcrlf> will not remove trailing whitespace at the end of lines anymore. + +* The Classloader usage has been changed for the taskdef, property, available + and sql tasks so that it delegates to the parent classloader. This may cause + ClassNotFoundExceptions to be thrown if a system class attempts to load a + class in the taskdef's classpath (typically factory objects). + +* Ant now allows multithreading of tasks and the containment of tasks within + other tasks. This can break customer listeners which do not expect messages + from a task before the previous task has finished. + +* Ant now installs its own ouput stream into System.out to route output to the + task currently executing on the current thread. This also means that all + output is now routed as Ant message events. Customer listeners and loggers + should not call System.out at any time. This has always been true but such + usage now will cause problems due to possible recursion. + +* Invalid manifest files will now cause build failures in the <jar> task. + +* Ant Introspection now looks for methods with method names starting with + addConfigured. When called these methods are passed an argument after it has + been configured from the build file. Custom tasks supporting nested elements + starting with the name configured will no longer function. + +* The environment variable JAVACMD that can be used to specify the + java executable to Ant's wrapper scripts must not contain additional + command line parameters any longer - please use the environment + variable ANT_OPTS for such parameters now. + +* Ant's wrapper scripts now quote the CLASSPATH environment variable, thus + supporting classpaths which refer to directories containing spaces. This means + that the CLASSPATH environment variable cannot have quotes. Any quotes should + be removed. This will not affect the operation of the CLASSPATH environment + variable in other contexts. + +* A delete task like + <delete includeEmptyFilesets="true"> + <fileset dir="somedir" /> + </delete> + will now remove "somedir" as well, unless there are still files left + in it (matched by the default excludes). + +* The copy task will now fail if the file to be copied is not found. + +* Ant properties defined in properties files now behave the same way as + properties defined in the build file. In particular the $ character needs + to be escaped in property values by doubling it to $$. So, to define a + property with the value $hello, you need to define it in a properties file + as + test.prop=$$hello + This was not the case in Ant 1.3 + +Other changes: +-------------- + +* New tasks: ear, p4counter, record, cvspass, vsscheckin, vsscheckout, + typedef, sleep, mimemail, set of tasks for Continuus/Synergy, dependset, + condition, maudit, mmetrics, jpcoverage, jpcovreport, jpcovmerge + +* Ant now uses JAXP 1.1 + +* rmic now supports Kaffe's and Weblogic's version of rmic. + +* new magic property build.rmic to chose the rmic implementation + +* <tar> will now add empty directories as well + +* you can now specify a description for <p4change> + +* <touch> can now work on <fileset>s + +* <uptodate> now supports a value attribute + +* <fail> supports nested text + +* <fixcrlf> won't override files that are already in the correct + format. + +* <sql> now supports REM comments as well as // and -- + +* <jar> now has a nested <metainf> element following the same idea as + <war>'s <webinf>. + +* <pvcs> can now handle multiple projects. + +* <available> now has a "type" attribute you can use in conjunction + with the "file" attribute to specify whether the "file" you're + looking for is a file or a directory. + +* New <junit> formatter named "brief" + +* <ejbjar> changes + * Add support for Borland Application Server to the <ejbjar> task using + a <borland> nested element. + * Add support for iPlanet Application Server to the <ejbjar> task. Also + includes some iPlanet utility tasks + * Add support for JBoss Application Server to the <ejbjar> task. + * Add a naming attribute to control the naming scheme that + ejbjar uses to name the generated EJB jars. + * Weblogic element now sets the compiler class for EJB 2.0 beans + * <dtd> elements can be specified at the <ejbjar> level for building generic + beans + * <dtd> elements can now be URLs + * Allow the manifest to be specified for the generated jars + * The weblogic element now supprts an attribte noEJBC to skip the processing + of the jar by ejbc. The ejbc step will then occur at deployment + * weblogic will tell ejbc to use Jikes compiler if build.compiler is set to + jikes. It can be restored to the default, javac, operation if desired. + +* Allow the <sql> Delimiter to be set in the so that Oracle stored procs may be + entered + +* <execon> and <apply> can now optionally skip empty filesets. + +* <javadoc> has a new useexternalfile attribute that makes it use a + temporary file for sourcefile and package names - helps to defeat + command line length limitations. + +* Data types like <path> can now be defined inside of <target>s + +* you can now specify a classpath for <style> - the XSLZ processor + will be loaded from this path + +* added a force attribute to <style> to support dependencies that the + task cannot determine itself (dependency on parameters, not file + modification times for example) + +* added vmlauncher attribute to exec tasks. This defaults to true. If + it is set to false, the VM's ability to launch commands in bypassed + and the OS shell, either directly or through the auxillary antRun + scripts is used. + +* regexp mapper now supports the java.util.regex package of JDK 1.4. + +* New filesonly attribute for <zip> and friends to suppress directory + entries. + +* New update attribute for <zip> and friends - update an existing + archive instead of creating a new one. + +* <apply> and <execon> have been merged into a single task. + +* added vssver.scc to the default excludes + +* <available> has a new filepath attribute/nested element that allows + you top search for a file in a given path. + +* <junit> can now optionally set a property on test failure. + +* <taskdef> can now define several tasks at once, reading the + name/classname pairs from a property file or resource. + +* <unzip/unjar/unwar> and <untar> now have an overwrite attribute that + defaults to true. If set to false, files that are newer than the + files in the archive will not be replaced. + +* <patternset> and <fileset> now support nested <in/excludesfile> + elements - using these you can have more than one in/excludes file + per <patternset>. + +* Three new supported compilers for javac: kjc for kopi, gcj for the + gcc frontend and sj for Symantec's compiler. + In addition extJavac or the new fork attribute can be + used to run the JDK's javac in a JVM separate from Ant. + +* <fixrlf> can now with CR only line-ends and can use an arbitraty + between 2 and 80. + +* The .NET tasks have been adapted to the beta2 release of the framework. + +* <move> will now try to rename() files before copying them byte by + byte - only if filtering is of, of course. + +* <ant> and <antcall> tasks now support a new attribute inheritAll. When set to + false, only user properties are passed through to the target Ant instance. + This includes properties set on the command line and properties explicitly + passed + +* <javadoc> now skips off line links if the package list cannot be found. + +* <wlrun> now allows the security policy file to exist outside the weblogic + directory. + +* <java> task will set the Thread contextClassLoader under JDKs 1.2+ to the + classloader for the class being executed. + +* Introduce the concept of a TaskContainer - a task or element which can contain + Ant Tasks. + +* Add new tasks implementing the TaskContainer interface <parallel> and + <sequential> which allow parallel execution of tasks to be specified. + +* <depend> task will now take into account dependencies on jar files and class + files from a given classpath. + +* <jar> manifest entries may now be specified in the build file either + completely or to be merged with a manifest file. + +* <tstamp> task custom formats now support locales. + +* Added a listner which will forward events to Log4J. The log4j configuration + file should be in the directory from which Ant is run or passed as a system + property using a JVM argument. + +* Introduced the concept of <filtersets> to allow for more control in which + filters get applied in a <copy> or <move> operation. + +* Added nowarn attribute to javac and deprecated the Jikes-magic property + build.compiler.warnings. + +* The <depend> task cache format has changed and all dependency information is + now stored in a single file. + +Fixed bugs: +----------- + +* Testcases have been made independent of current working directory. + +* Input ZIP-Files will be closed when using a <zipfileset>. + +* p4 tasks now don't fail if user, port or client have been omitted + (and this is acceptable for the context of the command). + +* <javah>'s outputfile attribute will be resolved as relative to the + projects basedir. + +* <antstructure> should create a valid DTD for propertyfile.operation.entry + and omit tasks it fails to load. + +* won't try to pass a -bootclasspath flag to javac 1.1 anymore + +* <style>'s style attribute no handles absolute paths correctly. + +* <delete includeemptydirs="true"> now deletes more than just the leaf + directories. + +* You can now specify a <fileset> for a directory that doesn't exist at + declaration time but will created before the fileset gets used for the + first time. + +* If the quiet attribute has been set, <delete> will handle <fileset>s + with non-existing directories gracefully. + +* Output written by testcases will now be captured by the <junit> task + and passed to the formatters. + +* Quote the -group parameter to Javadoc as per the specification + +* Initialise classes when loaded through the AntClassLoader - that is, run + static initializers + +* Implement getResource() and getResources() in AntClassLoader + +* Create the <ejbjar> weblogic command line as a set of arguments rather than + as a single line. Avoids problems with paths which contain spaces. + +* <ejbjar> now fails when the weblogic ejbc compiler reports an error. + +* Make the AntClassLoader load resources in the same order as it currently + loads classes. + +* Handle classpaths with spaces + +* Make sure XSLT processors close their output files in <style>. + +* perform proper uptodate check in <rmic> when compiling for IIOP. + +* <jjtree>'s uptodate test works even if outputdirectory is not the + parent dir of target + +* <copy> will remove target file (if it exists) before writing to it - + this avoids problems with links on filesystems that support them. + +* <ftp> now properly recurses remote directories. + +* <ftp> closes remote connection when it's done. + +* <junit> tries to include all necessary classes for the task itself + to the classpath when running in fork mode - doesn't work for JDK 1.1 + +* <apply> and <execon> do now execute the command only once, if you + specify the parallel attribute - instead of once per fileset. + +* directory based tasks and fileset could miss some included files in + directories that have been excluded + +* <fixcrlf> failed for large files. + +* <move> removed files you tried to move to themselves. + +* <sql> task will not trty to print the result set unless the query succeeded. + +* Ant classloader will now ignore paths which are invalid relative to the + project base + +* <ejbjar> weblogic elements check for jar file changes has been fixed. + Previously some changes would not be included. + +* properties loaded from properties files are now resolved internally. This + removes the spurious warnings about usage of properties which have not been + set. + +* <jar> task and friends now process the JAR manifest to ensure it is valid. + +* The task finished event now includes any exception thrown by the task. + +* <java> task now supports a jvmVersion attribute so that if another JVM is + being used, Ant can determine which options to use for features such as the + VM memory limits + + +Changes from Ant 1.2 to Ant 1.3 +=========================================== + +Changes that could break older environments: +-------------------------------------------- + +* Ant doesn't search for the buildfile anymore, unless you use the new + -find argument. + +* <perforce> has been replaced by a number of new tasks. + +* <javac> is now implemented using a factory. This makes extending + javac to use a new compiler a lot easier but may break custom + versions of this task that rely on the old implementation. + +* The output generated by the xml formatter for <junit> has changed a + little, it doesn't append " sec" in the time attribute anymore. + +Other changes: +-------------- + +* A GUI Frontend: Antidote. This is currently in development. At this + time, this is not part of the Ant release, although the source is + included if you are interested. + +* New tasks: stylebook, propertyfile, depend, antlr, telnet, csc, + ilasm, apply, javah, several clearcase tasks, junitreport, sound + +* Added output attribute to <java>. + +* Added nested zipfileset element to <zip> + +* Changed <sql> so that printing is at the task level rather than + the statement level. + +* javadoc task will pass -d flag to any doclet if the destDir attribute is + given. If the doclet does not accept the -d flag then omit the destdir + attribute. + +* <cab> can work on non-Windows platforms with the help of libcabinet. + See http://trill.cis.fordham.edu/~barbacha/cabinet_library/. + +* <ftp> now supports passive mode. + +* New <mapper> data type that can be used to get influence on the + target files for some tasks like <copy> or enable new types of tasks + like <apply>. + +* <execon> provides more control over the command line now, the names + of the source files are no longer required to be at the end of the + command. + +* Style tasks will now support TraX compliant XSL processors if one is present + in your classpath. + +* Added a failonerror to the javac task. If set to false, the build will + continue even if there are compilation errors. + +* Added nested format elements to the tstamp task allowing additional time + formats to be defined for arbitrary properties. + +* Added classpath attribute and nested classpath element to <property> + to make the resource attribute more powerful. + +* ${} property expansion will now be performed on the patterns read + from files specified as includesfile or excludesfile attributes. + +* The <tar> and <untar> tasks now support GNU format for handling paths + which are greater than 100 characters in length. In addition the <tar> + task now supports nested filesets through which the file permissions + may be controlled. + +* wlrun, wlstop and ejbjar now support Weblogic 6.0 + +* The MPasre task has been updated to work with MParse 2.0 + +* The documentation has been significantly updated. + + +Fixed bugs: +----------- + +* <signjar> no longer uses deprecated methods. + +* javadoc's failonerror attribute works again + +* javadoc's additionalparam attribute will now be split into separate + parameters (on spaces) to allow for more than one parameter. + +* Changed <sql> task so that printing result sets works on Oracle + +* Changes to ddcreator and ejbc helper to respect the descriptor hierarchy + keppgenerated in ejbc can now be turned off + +* ejbjar now correctly ignores <ejb-ref> elements in the deployment descriptor. + CMP files are included by parsing the weblogic deployment descriptor rather + than relying on the naming convention used in ant 1.2 + +* ejbjar includes super classes and super interfaces into the generated ejb + jar files. The <support> nested element allows support classes to be + included in the EJB jar. The toplink element should now correctly locate + the toplink descriptor. + +* <vssget> now correctly deals with spaces in arguments + +* <jar> fails early if a given manifest file doesn't exist + +* <rmic> doesn't search for the _Skel file anymore when stubversion is + set to 1.2. + +* <rmic> uses the the same classpath to verify a class can be rmic'd + as it passes to the compiler. + +* org.apache.tools.mail.MailMessage (and therefore <mail>) can now + handle SMTP servers sending multi line responses. + +* nested <classpath> elements of <taskdef> now work for <taskdef>s not + nested into <target> as well. + +* <property> and <available> will search for the resource "foo" instead + of "/org/apache/tools/ant/taskdefs/foo" when given a relative resource + name foo. + +* Handle build files in directories whose name contained a "#" character + +* <junit> can now log to files whose name contains a comma as well. + +* The AntClassLoader now refers to the loader which loaded it, any + requests it does not handle itself. Previously these went to the + primordial loader. + +Changes from Ant 1.1 to Ant 1.2 +=============================== + +Changes that could break older environments: +-------------------------------------------- + +* Semantics of <property> has changed again in the hope to be more + intuitive. ${} expansion now happens at runtime and <property> tags + living inside of targets only take effect if they are visited at + runtime. + + As a side effect of this change, task's attributes get set at runtime + not at parser time as well, which might change the results of + <script>s or other custom tasks that reference other tasks by their id + attribute. + +* copying of support files in <javac> has been removed - as well as + the filtering attribute. + +* the <expand> and <keysubst> tasks have been removed. + +* the ignore and items attributes of directory based tasks have been removed. + +* the command line switches _not_ starting with - have been removed. + +* Path and EnumeratedAttribute have been moved from + org.apache.tools.ant to org.apache.tools.ant.types. + +* the class attributes of <available>, <java>, <rmic> and <taskdef> + have been removed. + +* the src attribute of <chmod> has been removed. + +* <patch> and <javadoc> have lost some of their attributes. + +* <java> and <cvs> have lost some undocumented attributes. + +* the Unix antRun script would search for command.sh in the directory + it changed to and invoke this instead of command if present. This + behavior has been dropped. + +* <ejbjar> task syntax has been changed significantly + +* <exec> is no longer implemented by org.apache.tool.ant.taskdefs.Exec. + Custom tasks that rely on Project.createTask("exec") to return an + instance of this class are going to fail. + +* nested <include> and <exclude> elements expect the value of their + name attribute to be a single pattern, they don't accept multiple + patterns anymore. Split them into multiple elements of the same type. + +* <delete dir="somedir" /> will now delete the directory itself as + well as all included files. If you just want to clean out the + directory and keep the empty one, use a nested fileset. + +Other changes: +-------------- + +* New tasks: antstructure, cab, execon, fail, ftp, genkey, jlink, + junit, sql, javacc, jjtree, starteam, war, unwar, uptodate, + native2ascii, copy, move, mparse. + +* copydir, copyfile, deltree and rename are now deprecated. They + should be replaced with the new copy, delete and move tasks. + +* <java> uses a ClassLoader of its own in no-fork mode if a classpath is + specified. + +* <style> will create the necessary target directories and reprocess + all files if the stylesheet changes. + +* New data types fileset and patternset - expected to get a broader use. + They, as well as PATH like structures, can now be defined on a global + level and later be referenced by their id attribute. + +* You can specify environment variables to <exec>. + +* <get> can check whether a remote file is actually newer than a local + copy before it starts a download (HTTP only). + +* Added a -logger option to allow the class which performs logging to be + specified on the command line. + +* Added a -emacs option to tell the logger to leave out taskname adornments + on log output. + +* <chmod> works on all files in parallel and supports multiple filesets. + +* <replace> can now use tokens and/or values that cross line boundaries. + +* build.compiler supports now jvc as well. + +* project specific help can now be obtained with the -projecthelp option. + +* Added a -debug option to make -verbose less verbose (and more useful) + +* Ant will now search for a file named build.xml in the parent directory + and above (towards the root of the filesystem) if you didn't specify + -buildfile and there is no build.xml in the current directory. + +* <echo> can now write to a file and accepts nested text. + +Fixed bugs: +----------- + +* <chmod> didn't work when used as a directory based task. + +* Path, Available, Property didn't resolve relative filenames with + respect to the Project's basedir. + +* Project didn't interpret the basedir attribute correctly in all + cases. + +* Nested <src> in <javac> caused NullPointerException. + +* Corrupt Zip- and Jar-files ar now deleted if the task fails. + +* many more fixes we've forgotten to document here ... + +* The packagelistloc attribute of <javadoc>'s <link> child will be + resolved as a file (i.e. it is either absolute or relative to + basedir). diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/ant b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/ant new file mode 100644 index 00000000000..bcc63c85a31 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/ant @@ -0,0 +1,326 @@ +#! /bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Extract launch and ant arguments, (see details below). +ant_exec_args= +no_config=false +use_jikes_default=false +ant_exec_debug=false +show_help=false +for arg in "$@" ; do + if [ "$arg" = "--noconfig" ] ; then + no_config=true + elif [ "$arg" = "--usejikes" ] ; then + use_jikes_default=true + elif [ "$arg" = "--execdebug" ] ; then + ant_exec_debug=true + elif [ my"$arg" = my"--h" -o my"$arg" = my"--help" ] ; then + show_help=true + ant_exec_args="$ant_exec_args -h" + else + if [ my"$arg" = my"-h" -o my"$arg" = my"-help" ] ; then + show_help=true + fi + ant_exec_args="$ant_exec_args \"$arg\"" + fi +done + +# Source/default ant configuration +if $no_config ; then + rpm_mode=false + usejikes=$use_jikes_default +else + # load system-wide ant configuration (ONLY if ANT_HOME has NOT been set) + if [ -z "$ANT_HOME" -o "$ANT_HOME" = "/usr/share/ant" ]; then + if [ -f "/etc/ant.conf" ] ; then + . /etc/ant.conf + fi + fi + + # load user ant configuration + if [ -f "$HOME/.ant/ant.conf" ] ; then + . $HOME/.ant/ant.conf + fi + if [ -f "$HOME/.antrc" ] ; then + . "$HOME/.antrc" + fi + + # provide default configuration values + if [ -z "$rpm_mode" ] ; then + rpm_mode=false + fi + if [ -z "$usejikes" ] ; then + usejikes=$use_jikes_default + fi +fi + +# Setup Java environment in rpm mode +if $rpm_mode ; then + if [ -f /usr/share/java-utils/java-functions ] ; then + . /usr/share/java-utils/java-functions + set_jvm + set_javacmd + fi +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) cygwin=true ;; + Darwin*) darwin=true + if [ -z "$JAVA_HOME" ] ; then + JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home + fi + ;; +esac + +if [ -z "$ANT_HOME" -o ! -d "$ANT_HOME" ] ; then + ## resolve links - $0 may be a link to ant's home + PRG="$0" + progname=`basename "$0"` + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi + done + + ANT_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + ANT_HOME=`cd "$ANT_HOME" && pwd` +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$ANT_HOME" ] && + ANT_HOME=`cygpath --unix "$ANT_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# set ANT_LIB location +ANT_LIB="${ANT_HOME}/lib" + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + JAVACMD="$JAVA_HOME/jre/sh/java" + elif [ -x "$JAVA_HOME/jre/bin/java" ] ; then + JAVACMD="$JAVA_HOME/jre/bin/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD=`which java 2> /dev/null ` + if [ -z "$JAVACMD" ] ; then + JAVACMD=java + fi + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." + echo " We cannot execute $JAVACMD" + exit 1 +fi + +# Build local classpath using just the launcher in non-rpm mode or +# use the Jpackage helper in rpm mode with basic and default jars +# specified in the ant.conf configuration. Because the launcher is +# used, libraries linked in ANT_HOME/lib will also be included, but this +# is discouraged as it is not java-version safe. A user should +# request optional jars and their dependencies via the OPT_JAR_LIST +# variable +if $rpm_mode && [ -x /usr/bin/build-classpath ] ; then + LOCALCLASSPATH="$(/usr/bin/build-classpath ant ant-launcher jaxp_parser_impl xml-commons-apis)" + + # If no optional jars have been specified then build the default list + if [ -z "$OPT_JAR_LIST" ] ; then + for file in /etc/ant.d/*; do + if [ -f "$file" ]; then + case "$file" in + *~) ;; + *#*) ;; + *.rpmsave) ;; + *.rpmnew) ;; + *) + for dep in `cat "$file"`; do + case "$OPT_JAR_LIST" in + *"$dep"*) ;; + *) OPT_JAR_LIST="$OPT_JAR_LIST${OPT_JAR_LIST:+ }$dep" + esac + done + esac + fi + done + fi + + # If the user requested to try to add some other jars to the classpath + if [ -n "$OPT_JAR_LIST" ] ; then + _OPTCLASSPATH="$(/usr/bin/build-classpath $OPT_JAR_LIST 2> /dev/null)" + if [ -n "$_OPTCLASSPATH" ] ; then + LOCALCLASSPATH="$LOCALCLASSPATH:$_OPTCLASSPATH" + fi + fi + + # Explicitly add javac path to classpath, assume JAVA_HOME set + # properly in rpm mode + if [ -f "$JAVA_HOME/lib/tools.jar" ] ; then + LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar" + fi + if [ -f "$JAVA_HOME/lib/classes.zip" ] ; then + LOCALCLASSPATH="$LOCALCLASSPATH:$JAVA_HOME/lib/classes.zip" + fi + + # if CLASSPATH_OVERRIDE env var is set, LOCALCLASSPATH will be + # user CLASSPATH first and ant-found jars after. + # In that case, the user CLASSPATH will override ant-found jars + # + # if CLASSPATH_OVERRIDE is not set, we'll have the normal behaviour + # with ant-found jars first and user CLASSPATH after + if [ -n "$CLASSPATH" ] ; then + # merge local and specified classpath + if [ -z "$LOCALCLASSPATH" ] ; then + LOCALCLASSPATH="$CLASSPATH" + elif [ -n "$CLASSPATH_OVERRIDE" ] ; then + LOCALCLASSPATH="$CLASSPATH:$LOCALCLASSPATH" + else + LOCALCLASSPATH="$LOCALCLASSPATH:$CLASSPATH" + fi + + # remove class path from launcher -cp option + CLASSPATH="" + fi +else + # not using rpm_mode; use launcher to determine classpaths + if [ -z "$LOCALCLASSPATH" ] ; then + LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar + else + LOCALCLASSPATH=$ANT_LIB/ant-launcher.jar:$LOCALCLASSPATH + fi +fi + +if [ -n "$JAVA_HOME" ] ; then + # OSX hack to make Ant work with jikes + if $darwin ; then + OSXHACK="${JAVA_HOME}/../Classes" + if [ -d "${OSXHACK}" ] ; then + for i in "${OSXHACK}"/*.jar + do + JIKESPATH="$JIKESPATH:$i" + done + fi + fi +fi + +# Allow Jikes support (off by default) +if $usejikes; then + ANT_OPTS="$ANT_OPTS -Dbuild.compiler=jikes" +fi + +# For Cygwin, switch paths to appropriate format before running java +# For PATHs convert to unix format first, then to windows format to ensure +# both formats are supported. Probably this will fail on directories with ; +# in the name in the path. Let's assume that paths containing ; are more +# rare than windows style paths on cygwin. +if $cygwin; then + if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then + format=mixed + else + format=windows + fi + ANT_HOME=`cygpath --$format "$ANT_HOME"` + ANT_LIB=`cygpath --$format "$ANT_LIB"` + JAVA_HOME=`cygpath --$format "$JAVA_HOME"` + LCP_TEMP=`cygpath --path --unix "$LOCALCLASSPATH"` + LOCALCLASSPATH=`cygpath --path --$format "$LCP_TEMP"` + if [ -n "$CLASSPATH" ] ; then + CP_TEMP=`cygpath --path --unix "$CLASSPATH"` + CLASSPATH=`cygpath --path --$format "$CP_TEMP"` + fi + CYGHOME=`cygpath --$format "$HOME"` +fi + +# Show script help if requested +if $show_help ; then + echo $0 '[script options] [options] [target [target2 [target3] ..]]' + echo 'Script Options:' + echo ' --help, --h print this message and ant help' + echo ' --noconfig suppress sourcing of /etc/ant.conf,' + echo ' $HOME/.ant/ant.conf, and $HOME/.antrc' + echo ' configuration files' + echo ' --usejikes enable use of jikes by default, unless' + echo ' set explicitly in configuration files' + echo ' --execdebug print ant exec line generated by this' + echo ' launch script' + echo ' ' +fi +# add a second backslash to variables terminated by a backslash under cygwin +if $cygwin; then + case "$ANT_HOME" in + *\\ ) + ANT_HOME="$ANT_HOME\\" + ;; + esac + case "$CYGHOME" in + *\\ ) + CYGHOME="$CYGHOME\\" + ;; + esac + case "$JIKESPATH" in + *\\ ) + JIKESPATH="$JIKESPATH\\" + ;; + esac + case "$LOCALCLASSPATH" in + *\\ ) + LOCALCLASSPATH="$LOCALCLASSPATH\\" + ;; + esac + case "$CLASSPATH" in + *\\ ) + CLASSPATH="$CLASSPATH\\" + ;; + esac +fi +# Execute ant using eval/exec to preserve spaces in paths, +# java options, and ant args +ant_sys_opts= +if [ -n "$CYGHOME" ]; then + if [ -n "$JIKESPATH" ]; then + ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\" -Dcygwin.user.home=\"$CYGHOME\"" + else + ant_sys_opts="-Dcygwin.user.home=\"$CYGHOME\"" + fi +else + if [ -n "$JIKESPATH" ]; then + ant_sys_opts="-Djikes.class.path=\"$JIKESPATH\"" + fi +fi +ant_exec_command="exec \"$JAVACMD\" $ANT_OPTS -classpath \"$LOCALCLASSPATH\" -Dant.home=\"$ANT_HOME\" -Dant.library.dir=\"$ANT_LIB\" $ant_sys_opts org.apache.tools.ant.launch.Launcher $ANT_ARGS -cp \"$CLASSPATH\" $ant_exec_args" +if $ant_exec_debug ; then + echo $ant_exec_command +fi +eval $ant_exec_command diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/ant.bat b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/ant.bat new file mode 100644 index 00000000000..f8fb7d5daf1 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/ant.bat @@ -0,0 +1,226 @@ +@echo off
+
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements. See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License. You may obtain a copy of the License at
+REM
+REM http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+
+REM This is an inordinately troublesome piece of code, particularly because it
+REM tries to work on both Win9x and WinNT-based systems. If we could abandon '9x
+REM support, things would be much easier, but sadly, it is not yet time.
+REM Be cautious about editing this, and only add WinNT specific stuff in code that
+REM only runs on WinNT.
+
+if "%HOME%"=="" goto homeDrivePathPre
+if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
+
+:homeDrivePathPre
+if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePre
+if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePre
+if exist "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_pre.bat"
+
+:userProfilePre
+if "%USERPROFILE%"=="" goto alpha
+if "%USERPROFILE%"=="%HOME%" goto alpha
+if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto alpha
+if exist "%USERPROFILE%\antrc_pre.bat" call "%USERPROFILE%\antrc_pre.bat"
+
+:alpha
+
+if "%OS%"=="Windows_NT" @setlocal
+if "%OS%"=="WINNT" @setlocal
+
+if "%ANT_HOME%"=="" goto setDefaultAntHome
+
+:stripAntHome
+if not _%ANT_HOME:~-1%==_\ goto checkClasspath
+set ANT_HOME=%ANT_HOME:~0,-1%
+goto stripAntHome
+
+:setDefaultAntHome
+rem %~dp0 is expanded pathname of the current script under NT
+set ANT_HOME=%~dp0..
+
+:checkClasspath
+set _USE_CLASSPATH=yes
+rem CLASSPATH must not be used if it is equal to ""
+if "%CLASSPATH%"=="""" set _USE_CLASSPATH=no
+if "%CLASSPATH%"=="" set _USE_CLASSPATH=no
+
+rem Slurp the command line arguments. This loop allows for an unlimited number
+rem of arguments (up to the command line limit, anyway).
+set ANT_CMD_LINE_ARGS=%1
+if ""%1""=="""" goto doneStart
+shift
+:setupArgs
+if ""%1""=="""" goto doneStart
+if ""%1""==""-noclasspath"" goto clearclasspath
+set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
+shift
+goto setupArgs
+
+rem here is there is a -noclasspath in the options
+:clearclasspath
+set _USE_CLASSPATH=no
+shift
+goto setupArgs
+
+rem This label provides a place for the argument list loop to break out
+rem and for NT handling to skip to.
+
+:doneStart
+
+if _USE_CLASSPATH==no goto findAntHome
+
+:stripClasspath
+if not _%CLASSPATH:~-1%==_\ goto findAntHome
+set CLASSPATH=%CLASSPATH:~0,-1%
+goto stripClasspath
+
+:findAntHome
+rem find ANT_HOME if it does not exist due to either an invalid value passed
+rem by the user or the %0 problem on Windows 9x
+if exist "%ANT_HOME%\lib\ant.jar" goto checkJava
+
+rem check for ant in Program Files
+if not exist "%ProgramFiles%\ant" goto checkSystemDrive
+set ANT_HOME=%ProgramFiles%\ant
+goto checkJava
+
+:checkSystemDrive
+rem check for ant in root directory of system drive
+if not exist %SystemDrive%\ant\lib\ant.jar goto checkCDrive
+set ANT_HOME=%SystemDrive%\ant
+goto checkJava
+
+:checkCDrive
+rem check for ant in C:\ant for Win9X users
+if not exist C:\ant\lib\ant.jar goto noAntHome
+set ANT_HOME=C:\ant
+goto checkJava
+
+:noAntHome
+echo ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
+goto end
+
+:checkJava
+set _JAVACMD=%JAVACMD%
+
+if "%JAVA_HOME%" == "" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
+goto checkJikes
+
+:noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=java.exe
+
+:checkJikes
+if not "%JIKESPATH%"=="" goto runAntWithJikes
+
+:runAnt
+if "%_USE_CLASSPATH%"=="no" goto runAntNoClasspath
+:runAntWithClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:runAntNoClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:runAntWithJikes
+
+if not _%JIKESPATH:~-1%==_\ goto checkJikesAndClasspath
+set JIKESPATH=%JIKESPATH:~0,-1%
+goto runAntWithJikes
+
+:checkJikesAndClasspath
+
+if "%_USE_CLASSPATH%"=="no" goto runAntWithJikesNoClasspath
+
+:runAntWithJikesAndClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% -cp "%CLASSPATH%" %ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:runAntWithJikesNoClasspath
+"%_JAVACMD%" %ANT_OPTS% -classpath "%ANT_HOME%\lib\ant-launcher.jar" "-Dant.home=%ANT_HOME%" "-Djikes.class.path=%JIKESPATH%" org.apache.tools.ant.launch.Launcher %ANT_ARGS% %ANT_CMD_LINE_ARGS%
+rem Check the error code of the Ant build
+if not "%OS%"=="Windows_NT" goto onError
+set ANT_ERROR=%ERRORLEVEL%
+goto end
+
+:onError
+rem Windows 9x way of checking the error code. It matches via brute force.
+for %%i in (1 10 100) do set err%%i=
+for %%i in (0 1 2) do if errorlevel %%i00 set err100=%%i
+if %err100%==2 goto onError200
+if %err100%==0 set err100=
+for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%%i0 set err10=%%i
+if "%err100%"=="" if %err10%==0 set err10=
+:onError1
+for %%i in (0 1 2 3 4 5 6 7 8 9) do if errorlevel %err100%%err10%%%i set err1=%%i
+goto onErrorEnd
+:onError200
+for %%i in (0 1 2 3 4 5) do if errorlevel 2%%i0 set err10=%%i
+if err10==5 for %%i in (0 1 2 3 4 5) do if errorlevel 25%%i set err1=%%i
+if not err10==5 goto onError1
+:onErrorEnd
+set ANT_ERROR=%err100%%err10%%err1%
+for %%i in (1 10 100) do set err%%i=
+
+:end
+rem bug ID 32069: resetting an undefined env variable changes the errorlevel.
+if not "%_JAVACMD%"=="" set _JAVACMD=
+if not "%_ANT_CMD_LINE_ARGS%"=="" set ANT_CMD_LINE_ARGS=
+
+if "%ANT_ERROR%"=="0" goto mainEnd
+
+rem Set the return code if we are not in NT. We can only set
+rem a value of 1, but it's better than nothing.
+if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1
+
+rem Set the ERRORLEVEL if we are running NT.
+if "%OS%"=="Windows_NT" color 00
+
+goto omega
+
+:mainEnd
+
+rem If there were no errors, we run the post script.
+if "%OS%"=="Windows_NT" @endlocal
+if "%OS%"=="WINNT" @endlocal
+
+if "%HOME%"=="" goto homeDrivePathPost
+if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"
+
+:homeDrivePathPost
+if "%HOMEDRIVE%%HOMEPATH%"=="" goto userProfilePost
+if "%HOMEDRIVE%%HOMEPATH%"=="%HOME%" goto userProfilePost
+if exist "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat" call "%HOMEDRIVE%%HOMEPATH%\antrc_post.bat"
+
+:userProfilePost
+if "%USERPROFILE%"=="" goto omega
+if "%USERPROFILE%"=="%HOME%" goto omega
+if "%USERPROFILE%"=="%HOMEDRIVE%%HOMEPATH%" goto omega
+if exist "%USERPROFILE%\antrc_post.bat" call "%USERPROFILE%\antrc_post.bat"
+
+:omega
+
diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/ant.cmd b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/ant.cmd new file mode 100644 index 00000000000..70665c003c6 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/ant.cmd @@ -0,0 +1,93 @@ +/*
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ Run ant
+*/
+
+'@echo off'
+parse arg mode envarg '::' antarg
+
+if mode\='.' & mode\='..' & mode\='/' then do
+ envarg = mode envarg
+ mode = ''
+end
+
+if antarg = '' then do
+ antarg = envarg
+ envarg = ''
+end
+
+x = setlocal()
+
+env="OS2ENVIRONMENT"
+antenv = _getenv_('antenv')
+if _testenv_() = 0 then interpret 'call "' || antenv || '"' '"' || envarg || '"'
+
+if mode = '' then mode = _getenv_('ANT_MODE' '..')
+if mode \= '/' then do
+ runrc = _getenv_('runrc')
+ antrc = _getenv_('antrc' 'antrc.cmd')
+ if mode = '..' then mode = '-r'
+ else mode = ''
+ interpret 'call "' || runrc || '"' antrc '"' || mode || '"'
+end
+
+if _testenv_() = 0 then do
+ say 'Ant environment is not set properly'
+ x = endlocal()
+ exit 16
+end
+
+settings = '-Dant.home=' || ANT_HOME '-Djava.home=' || JAVA_HOME
+
+java = _getenv_('javacmd' 'java')
+opts = value('ANT_OPTS',,env)
+args = value('ANT_ARGS',,env)
+lcp = value('LOCALCLASSPATH',,env)
+cp = value('CLASSPATH',,env)
+if value('ANT_USE_CP',,env) \= '' then do
+ if lcp \= '' & right(lcp, 1) \= ';' then lcp = lcp || ';'
+ lcp = lcp || cp
+ 'SET CLASSPATH='
+end
+if lcp\='' then lcp = '-classpath' lcp
+
+cmd = java opts lcp '-jar' ANT_HOME ||'\lib\ant-launcher.jar' settings args antarg
+launcher = stream(ANT_HOME ||'\lib\ant-launcher.jar', 'C', 'query exists')
+if launcher = '' then entry = 'org.apache.tools.ant.Main'
+else entry = 'org.apache.tools.ant.launch.Launcher'
+java opts lcp entry settings args antarg
+
+x = endlocal()
+
+return rc
+
+_testenv_: procedure expose env ANT_HOME JAVA_HOME
+ANT_HOME = value('ANT_HOME',,env)
+if ANT_HOME = '' then return 0
+JAVA_HOME = value('JAVA_HOME',,env)
+if JAVA_HOME = '' then return 0
+cp = translate(value('CLASSPATH',,env))
+if pos(translate(ANT_HOME), cp) = 0 then return 0
+if pos(translate(JAVA_HOME), cp) = 0 then return 0
+return 1
+
+_getenv_: procedure expose env
+parse arg envar default
+if default = '' then default = envar
+var = value(translate(envar),,env)
+if var = '' then var = default
+return var
diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/antRun b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/antRun new file mode 100644 index 00000000000..8110f86efea --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/antRun @@ -0,0 +1,24 @@ +#! /bin/sh + +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Args: DIR command +cd "$1" +CMD="$2" +shift +shift + +exec "$CMD" "$@" diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/antRun.bat b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/antRun.bat new file mode 100644 index 00000000000..c7d90f03e73 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/antRun.bat @@ -0,0 +1,50 @@ +@echo off
+
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements. See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License. You may obtain a copy of the License at
+REM
+REM http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+
+if "%OS%"=="Windows_NT" @setlocal
+if "%OS%"=="WINNT" @setlocal
+
+if ""%1""=="""" goto runCommand
+
+rem Change drive and directory to %1
+if "%OS%"=="Windows_NT" goto nt_cd
+if "%OS%"=="WINNT" goto nt_cd
+cd ""%1""
+goto end_cd
+:nt_cd
+cd /d ""%1""
+:end_cd
+shift
+
+rem Slurp the command line arguments. This loop allows for an unlimited number
+rem of arguments (up to the command line limit, anyway).
+set ANT_RUN_CMD=%1
+if ""%1""=="""" goto runCommand
+shift
+:loop
+if ""%1""=="""" goto runCommand
+set ANT_RUN_CMD=%ANT_RUN_CMD% %1
+shift
+goto loop
+
+:runCommand
+rem echo %ANT_RUN_CMD%
+%ANT_RUN_CMD%
+
+if "%OS%"=="Windows_NT" @endlocal
+if "%OS%"=="WINNT" @endlocal
+
diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/antenv.cmd b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/antenv.cmd new file mode 100644 index 00000000000..046026657b2 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/antenv.cmd @@ -0,0 +1,98 @@ +/*
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+'@echo off'
+call RxFuncAdd "SysLoadFuncs", "RexxUtil", "SysLoadFuncs"
+call SysLoadFuncs
+
+/* Prepare the parameters for later use */
+parse arg argv
+mode = ''
+args = ''
+opts = ''
+cp = ''
+lcp = ''
+
+do i = 1 to words(argv)
+ param = word(argv, i)
+ select
+ when param='-lcp' then mode = 'l'
+ when param='-cp' | param='-classpath' then mode = 'c'
+ when abbrev('-opts', param, 4) then mode = 'o'
+ when abbrev('-args', param, 4) then mode = 'a'
+ otherwise
+ select
+ when mode = 'a' then args = space(args param, 1)
+ when mode = 'c' then cp = space(cp param, 1)
+ when mode = 'l' then lcp = space(lcp param, 1)
+ when mode = 'o' then opts = space(opts param, 1)
+ otherwise
+ say 'Option' param 'ignored'
+ end
+ end
+end
+
+env="OS2ENVIRONMENT"
+antconf = _getenv_('antconf' 'antconf.cmd')
+runrc = _getenv_('runrc')
+interpret 'call "' || runrc || '"' '"' || antconf || '"' 'ETC'
+ANT_HOME = value('ANT_HOME',,env)
+JAVA_HOME = value('JAVA_HOME',,env)
+classpath = value('CLASSPATH',,env)
+classes = stream(JAVA_HOME || "\lib\classes.zip", "C", "QUERY EXISTS")
+if classes \= '' then classpath = prepend(classpath classes)
+classes = stream(JAVA_HOME || "\lib\tools.jar", "C", "QUERY EXISTS")
+if classes \= '' then classpath = prepend(classpath classes)
+
+classpath = prepend(classpath ANT_HOME || '\lib\ant-launcher.jar')
+'SET CLASSPATH=' || classpath
+
+/* Setting classpathes, options and arguments */
+envset = _getenv_('envset')
+if cp\='' then interpret 'call "' || envset || '"' '"; CLASSPATH"' '"' || cp || '"'
+if lcp\='' then interpret 'call "' || envset || '"' '"; LOCALCLASSPATH"' '"' || lcp || '"'
+if opts\='' then interpret 'call "' || envset || '"' '"-D ANT_OPTS"' '"' || opts || '"'
+if args\='' then interpret 'call "' || envset || '"' '"ANT_ARGS"' '"' || args || '"'
+
+exit 0
+
+addpath: procedure
+parse arg path elem
+if elem = '' then do
+ if path\='' & right(path, 1)\=';' then path = path || ';'
+ return path
+end
+if substr(path, length(path)) = ';' then glue = ''
+else glue = ';'
+if pos(translate(elem), translate(path)) = 0 then path = path || glue || elem || ';'
+return path
+
+prepend: procedure
+parse arg path elem
+if elem = '' then do
+ if path\='' & right(path, 1)\=';' then path = path || ';'
+ return path
+end
+if pos(translate(elem), translate(path)) = 0 then path = elem || ';' || path
+return path
+
+_getenv_: procedure expose env
+parse arg envar default
+if default = '' then default = envar
+var = value(translate(envar),,env)
+if var = '' then var = default
+return var
diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/envset.cmd b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/envset.cmd new file mode 100644 index 00000000000..3149be4ce41 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/envset.cmd @@ -0,0 +1,131 @@ +/*
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+SET environment variables
+First optional parameter:
+ ; parameters are considered parts of a path variable, semicolons are
+ appended to each element if not already present
+ -D parameters are properties for Java or Makefile etc., -D will be
+ prepended and the parameters will be separated by a space
+ =D the same as above but equal sign is not required
+ , parameters should be comma separated in the environment variable
+ - parameters should be separated by the next parameter
+ Other values mean that the first parameter is missing and the environment
+ variable will be set to the space separated parameters
+
+Second parameter: name of the environment variable
+
+Next parameters: values
+; implies that the equal sign is considered a part of the parameter and is
+not interpreted
+
+-D requires parameters in the form name=value. If the equal sign is not found,
+the parameters are changed to name=expanded_name
+
+Other options have optional equal sign. If it is found, only the part after
+the equal sign will be oprionally expanded.
+
+If the parameter is the minus sign, the next parameter will not be expanded.
+If the parameter is a single dot, it will be replaced with the value of the
+environment variable as it existed before envset was invoked.
+
+For other parameters the batch looks for the environment variable with the
+same name (in uppercase). If it is found, it forms the expanded_name. If
+the environment variable with such a name does not exist, the expanded_name
+will hold the parameter name without case conversion.
+*/
+
+parse arg mode envar args
+
+equal = 0
+sep = ' '
+
+/* Parse command line parameters */
+select
+ when mode='-' then do
+ sep = envar
+ parse var args envar args
+ end
+ when mode=';' then do
+ sep = ''
+ equal = -1
+ end
+ when mode='-D' then equal = 1
+ when mode='=D' then mode = '-D'
+ when mode=',' then sep = ','
+otherwise
+ args = envar args
+ envar = mode
+ mode = ''
+end
+
+env = 'OS2ENVIRONMENT'
+envar = translate(envar)
+orig = value(envar,,env)
+newval = ''
+expand = 1
+
+/* for each parameter... */
+do i = 1 to words(args)
+ if expand > 0 & word(args, i) = '-' then expand = 0
+ else call addval word(args, i)
+end
+
+/* Optionally enclose path variable by quotes */
+if mode = ';' & pos(' ', newval) > 0 then newval = '"' || newval || '"'
+
+/* Set the new value, 'SET' cannot be used since it does not allow '=' */
+x = value(envar, newval, env)
+exit 0
+
+addval: procedure expose sep equal orig expand newval mode env
+parse arg var
+
+if var = '.' then expvar = orig
+else do
+ if equal >= 0 then do
+ parse var var name '=' val
+ if val = '' then var = name
+ else var = val
+ end
+ if expand = 0 then expvar = var
+ else expvar = value(translate(var),,env)
+ if expvar = '' then expvar = var
+ if equal >= 0 then do
+ if val = '' then do
+ parse var expvar key '=' val
+ if val <> '' then name = key
+ else do
+ if equal > 0 then val = key
+ else name = key
+ end
+ end
+ else val = expvar
+ if pos(' ', val) > 0 | pos('=', val) > 0 then val = '"' || val || '"'
+ if val = '' then expvar = name
+ else expvar = name || '=' || val
+ end
+ if mode = '-D' then expvar = '-D' || expvar
+ if mode = ';' then do
+ if right(expvar, 1) <> ';' then expvar = expvar || ';'
+ end
+end
+
+if newval = '' then newval = expvar
+else newval = newval || sep || expvar
+expand = 1
+return
diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/lcp.bat b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/lcp.bat new file mode 100644 index 00000000000..dc7e9bf531f --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/lcp.bat @@ -0,0 +1,31 @@ +REM
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements. See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License. You may obtain a copy of the License at
+REM
+REM http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+REM
+REM
+
+set _CLASSPATHCOMPONENT=%1
+if ""%1""=="""" goto gotAllArgs
+shift
+
+:argCheck
+if ""%1""=="""" goto gotAllArgs
+set _CLASSPATHCOMPONENT=%_CLASSPATHCOMPONENT% %1
+shift
+goto argCheck
+
+:gotAllArgs
+set LOCALCLASSPATH=%LOCALCLASSPATH%;%_CLASSPATHCOMPONENT%
+
diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/runrc.cmd b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/runrc.cmd new file mode 100644 index 00000000000..34b4f5d59e5 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/bin/runrc.cmd @@ -0,0 +1,60 @@ +/*
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ Run RC file, name is in the first arg, second arg is either PATH
+ ENV or -r or nothing
+*/
+
+parse arg name path rest
+
+if name = '' then do
+ say 'RC file name is missing'
+ exit 1
+end
+
+if rest \= '' then do
+ say 'Too many parameters'
+ exit 1
+end
+
+call runit name path
+exit 0
+
+runit: procedure
+parse arg name path dir
+
+if path \= '' & path \= '-r' then do
+ dir = value(translate(path),,'OS2ENVIRONMENT')
+ if dir = '' then return
+ dir = translate(dir, '\', '/') /* change UNIX-like path to OS/2 */
+end
+
+if dir = '' then dir = directory()
+
+if path = '-r' then do /* recursive call */
+ subdir = filespec('path', dir)
+ if subdir \= '\' then do
+ subdir = left(subdir, length(subdir)-1)
+ call runit name path filespec('drive', dir) || subdir
+ end
+end
+
+/* Look for the file and run it */
+if right(dir, 1) \= '\' then dir = dir || '\'
+rcfile = stream(dir || name, 'c', 'query exists')
+if rcfile \= '' then interpret 'call "' || rcfile || '"'
+
+return
diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/README b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/README new file mode 100644 index 00000000000..a056be20ed3 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/README @@ -0,0 +1,15 @@ +Please refer to the Ant manual under Installing Ant / Library +Dependencies for a list of the jar requirements for various optional +tasks and features. + +This directory contains xercesImpl.jar from the 2.6.2 release of +Apache Xerces. For more information or newer releases see +<http://xml.apache.org/xerces2-j/>. See the file LICENSE.xerces for +the terms of distribution. + +It also contains xml-apis.jar, an Apache-controlled collection of +standard classes from the 1.0b2 release of the Apache XML-Commons +release. For more information or newer releases see +<http://xml.apache.org/commons/>. See the files LICENSE.dom and +LICENSE.sax for the terms of distribution. + diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/ant-launcher.jar b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/ant-launcher.jar Binary files differnew file mode 100644 index 00000000000..12a1e78d0cb --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/ant-launcher.jar diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/ant.jar b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/ant.jar Binary files differnew file mode 100644 index 00000000000..0a56a58f962 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/ant.jar diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/xercesImpl.jar b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/xercesImpl.jar Binary files differnew file mode 100644 index 00000000000..3b351f6e2b5 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/xercesImpl.jar diff --git a/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/xml-apis.jar b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/xml-apis.jar Binary files differnew file mode 100644 index 00000000000..b338fb66932 --- /dev/null +++ b/sonar-application/src/main/assembly/war/apache-ant-1.7.0/lib/xml-apis.jar diff --git a/sonar-application/src/main/assembly/war/build-war.bat b/sonar-application/src/main/assembly/war/build-war.bat new file mode 100644 index 00000000000..96e1f3f6a62 --- /dev/null +++ b/sonar-application/src/main/assembly/war/build-war.bat @@ -0,0 +1,28 @@ +@echo off
+ +rem Copyright (C) 2009 SonarSource SA +rem mailto:contact AT sonarsource DOT com +rem +rem Sonar is free software; you can redistribute it and/or +rem modify it under the terms of the GNU Lesser General Public +rem License as published by the Free Software Foundation; either +rem version 3 of the License, or (at your option) any later version. +rem +rem Sonar is distributed in the hope that it will be useful, +rem but WITHOUT ANY WARRANTY; without even the implied warranty of +rem MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +rem Lesser General Public License for more details. +rem +rem You should have received a copy of the GNU Lesser General Public +rem License along with Sonar; if not, write to the Free Software +rem Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 +rem +rem Use this DOS script to create a Sonar WAR archive. + +set ORIG_ANT_HOME=%ANT_HOME% +set ANT_HOME=%CD%\apache-ant-1.7.0 + +call apache-ant-1.7.0\bin\ant + +set ANT_HOME=%ORIG_ANT_HOME% +set ORIG_ANT_HOME=
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/war/build-war.sh b/sonar-application/src/main/assembly/war/build-war.sh new file mode 100644 index 00000000000..9e5ec345416 --- /dev/null +++ b/sonar-application/src/main/assembly/war/build-war.sh @@ -0,0 +1,24 @@ +#! /bin/sh + +# Copyright (C) 2009 SonarSource SA +# mailto:contact AT sonarsource DOT com +# +# Sonar is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 3 of the License, or (at your option) any later version. +# +# Sonar is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with Sonar; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 +# +# Use this DOS script to create a Sonar WAR archive. + +ANT_HOME="./apache-ant-1.7.0" + +./apache-ant-1.7.0/bin/ant
\ No newline at end of file diff --git a/sonar-application/src/main/assembly/war/build.xml b/sonar-application/src/main/assembly/war/build.xml new file mode 100644 index 00000000000..32aecf746ce --- /dev/null +++ b/sonar-application/src/main/assembly/war/build.xml @@ -0,0 +1,91 @@ +<!-- +Copyright (C) 2009 SonarSource SA +mailto:contact AT sonarsource DOT com + +Sonar is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 3 of the License, or (at your option) any later version. + +Sonar is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with Sonar; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 +--> +<project name="Sonar WAR builder" basedir="." default="war"> + <pathconvert targetos="unix" property="sonarHome"> + <path location="${basedir}/.."/> + </pathconvert> + + <target name="war" depends="clean"> + <mkdir dir="build/sonar-server"/> + <copy todir="build/sonar-server"> + <fileset dir="sonar-server"/> + </copy> + + <!-- add JDBC driver to classpath --> + <copy todir="build/sonar-server/WEB-INF/lib" flatten="true"> + <fileset dir="../extensions/jdbc-driver" includes="**/*.jar"/> + </copy> + + <!-- sonar properties --> + <copy todir="build/sonar-server/WEB-INF/classes/conf" file="../conf/sonar.properties" overwrite="true" + failonerror="true"/> + + <condition property="sonarhome.found"> + <isfileselected file="build/sonar-server/WEB-INF/classes/conf/sonar.properties"> + <contains text="sonar.home"/> + </isfileselected> + </condition> + + <antcall target="append-sonar-home"/> + + <!-- copy the logback config --> + <copy todir="build/sonar-server/WEB-INF/classes"> + <fileset dir="../conf" includes="logback.xml"/> + </copy> + + <!-- changing the loggers defaut appender to the SONAR_WAR appender --> + <replace file="build/sonar-server/WEB-INF/classes/logback.xml"> + <replacetoken><![CDATA[<appender-ref ref="SONAR_FILE"/>]]></replacetoken> + <replacevalue><![CDATA[<appender-ref ref="SONAR_WAR"/>]]></replacevalue> + </replace> + + <war destfile="sonar.war" webxml="build/sonar-server/WEB-INF/web.xml"> + <fileset dir="build/sonar-server"/> + </war> + + <echo> + ----------------------------------------------------------------------------------------------------------- + sonar.war is ready to be deployed. It is linked to the Sonar home directory: + ${sonarHome} + + IMPORTANT NOTES : + * supported web servers are Jetty and Tomcat 5.x/6.x + * the web application uses the Sonar home directory. For this reason it must be deployed on this host only. + * the war file must be rebuilt when : + - configuration is updated (files in the directory conf/) + - the Sonar home directory is moved to other location + - sonar is upgraded to a new version + It does not have to be rebuilt when a plugin is removed or installed. + ----------------------------------------------------------------------------------------------------------- + </echo> + </target> + + <target name="clean"> + <delete dir="build"/> + <delete file="sonar.war"/> + </target> + + <target name="append-sonar-home" unless="sonarhome.found"> + <echo>Setting home to: ${sonarHome}</echo> + <echo file="build/sonar-server/WEB-INF/classes/conf/sonar.properties" append="yes"> + sonar.home=${sonarHome} + </echo> + </target> + +</project>
\ No newline at end of file diff --git a/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java b/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java new file mode 100644 index 00000000000..423eb04f9d6 --- /dev/null +++ b/sonar-application/src/main/java/org/sonar/application/JettyEmbedder.java @@ -0,0 +1,186 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2009 SonarSource SA + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.application; + +import org.apache.commons.io.FileUtils; +import org.mortbay.jetty.Connector; +import org.mortbay.jetty.NCSARequestLog; +import org.mortbay.jetty.Server; +import org.mortbay.jetty.ajp.Ajp13SocketConnector; +import org.mortbay.jetty.handler.RequestLogHandler; +import org.mortbay.jetty.nio.SelectChannelConnector; +import org.mortbay.jetty.webapp.WebAppContext; +import org.mortbay.thread.QueuedThreadPool; +import org.mortbay.xml.XmlConfiguration; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class JettyEmbedder { + + private Server server; + private String host; + private int port; + private String contextPath; + private int ajp13Port = -1; + + public JettyEmbedder(String host, int port, String contextPath, int ajp13Port, URL configurationURL) throws Exception { + this.host = host.trim(); + this.port = port; + this.contextPath = contextPath; + this.ajp13Port = ajp13Port; + server = new Server(); + + if (configurationURL == null) { + configureProgrammatically(); + + } else { + System.setProperty("jetty.host", this.host); + System.setProperty("jetty.port", String.valueOf(port)); + System.setProperty("jetty.context", contextPath); + if (ajp13Port > 0) { + System.setProperty("jetty.ajp13Port", String.valueOf(ajp13Port)); + } + XmlConfiguration configuration = new XmlConfiguration(configurationURL); + configuration.configure(server); + } + } + + /** + * for tests + */ + JettyEmbedder(String host, int port) throws Exception { + this(host, port, null, 0, null); + } + + public void start() throws Exception { + server.start(); + + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { + try { + server.stop(); + } catch (Exception e) { + LoggerFactory.getLogger(getClass()).error("Can not stop the Jetty server", e); + } + } + }); + LoggerFactory.getLogger("org.sonar.INFO").info("Sonar started: " + toString()); + } + + private Server configureProgrammatically() throws URISyntaxException, IOException { + configureServer(); + WebAppContext context = new WebAppContext(getPath("/war/sonar-server"), contextPath); + server.addHandler(context); + return server; + } + + public void configureRequestLogs(String filenamePattern) { + RequestLogHandler requestLogHandler = new RequestLogHandler(); + NCSARequestLog requestLog = new NCSARequestLog(filenamePattern);//"../../logs/jetty-yyyy_mm_dd.request.log"); + requestLog.setRetainDays(7); + requestLog.setAppend(true); + requestLog.setExtended(true); + requestLog.setLogTimeZone("GMT"); + requestLogHandler.setRequestLog(requestLog); + server.addHandler(requestLogHandler); + } + + private void configureServer() throws URISyntaxException { + QueuedThreadPool threadPool = new QueuedThreadPool(); + threadPool.setMinThreads(5); + threadPool.setMaxThreads(50); + threadPool.setLowThreads(10); + server.setThreadPool(threadPool); + SelectChannelConnector connector = new SelectChannelConnector(); + connector.setHost(host); + connector.setPort(port); + connector.setStatsOn(false); + connector.setAcceptors(2); + connector.setConfidentialPort(8443); + if (ajp13Port > 0) { + LoggerFactory.getLogger("org.sonar.INFO").info("AJP13 connector is on port " + ajp13Port); + Connector ajpConnector = new Ajp13SocketConnector(); + ajpConnector.setPort(ajp13Port); + server.addConnector(ajpConnector); + } + server.addConnector(connector); + server.setStopAtShutdown(true); + server.setSendServerVersion(false); + server.setSendDateHeader(true); + server.setGracefulShutdown(1000); + + } + + final String getPluginsClasspath(String pluginsPathFromClassloader) throws URISyntaxException, IOException { + final URL resource = getClass().getResource(pluginsPathFromClassloader); + if (resource != null) { + File pluginsDir = new File(resource.toURI()); + List<String> paths = new ArrayList<String>(); + paths.add(pluginsDir.getCanonicalPath() + System.getProperty("file.separator")); + + Collection<File> files = FileUtils.listFiles(pluginsDir, new String[]{"jar"}, false); + if (files != null) { + for (File file : files) { + paths.add(file.getCanonicalPath()); + } + } + return join(paths, ","); + } + return null; + } + + private String join(List<String> paths, String separator) { + StringBuilder sb = new StringBuilder(); + boolean first = true; + for (String path : paths) { + if (!first) { + sb.append(separator); + } + sb.append(path); + first = false; + } + return sb.toString(); + } + + private String getPath(String resourcePath) throws URISyntaxException { + URL resource = getClass().getResource(resourcePath); + if (resource != null) { + return resource.toURI().toString(); + } + return null; + } + + protected Server getServer() { + return server; + } + + @Override + public String toString() { + return new StringBuilder().append("http://").append(host).append(":").append(port).append(contextPath).toString(); + } +} diff --git a/sonar-application/src/main/java/org/sonar/application/StartServer.java b/sonar-application/src/main/java/org/sonar/application/StartServer.java new file mode 100644 index 00000000000..fd92dd066c1 --- /dev/null +++ b/sonar-application/src/main/java/org/sonar/application/StartServer.java @@ -0,0 +1,75 @@ +/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2009 SonarSource SA
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.application;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.Properties;
+
+public final class StartServer {
+ private static final String DEFAULT_WEB_HOST = "0.0.0.0";
+ private static final int DEFAULT_WEB_PORT = 9000;
+ private static final String DEFAULT_WEB_CONTEXT = "/";
+ private static final int DEFAULT_AJP13_PORT = -1;
+
+ private StartServer() {
+ }
+
+ public static void main(String[] args) throws Exception {
+ configureLogback();
+ configureHome();
+
+ Properties configuration = getConfiguration();
+ String host = configuration.getProperty("sonar.web.host", DEFAULT_WEB_HOST);
+ int port = Integer.parseInt(configuration.getProperty("sonar.web.port", "" + DEFAULT_WEB_PORT));
+ String context = configuration.getProperty("sonar.web.context", DEFAULT_WEB_CONTEXT);
+ int ajp13Port = Integer.parseInt(configuration.getProperty("sonar.ajp13.port", "" + DEFAULT_AJP13_PORT));
+ JettyEmbedder jetty = new JettyEmbedder(host, port, context, ajp13Port, StartServer.class.getResource("/jetty.xml"));
+ configureRequestLogs(jetty, configuration);
+
+ jetty.start();
+ Thread.currentThread().join();
+ }
+
+ private static void configureRequestLogs(JettyEmbedder jetty, Properties configuration) {
+ String filenamePattern = configuration.getProperty("sonar.web.jettyRequestLogs");
+ if (filenamePattern!=null) {
+ jetty.configureRequestLogs(filenamePattern);
+ }
+ }
+
+ private static Properties getConfiguration() throws IOException {
+ Properties properties = new Properties();
+ properties.load(StartServer.class.getResourceAsStream("/conf/sonar.properties"));
+ return properties;
+ }
+
+ private static void configureHome() throws URISyntaxException {
+ File confFile = new File(StartServer.class.getResource("/conf/sonar.properties").toURI());
+ System.setProperty("sonar.home", confFile.getParentFile().getParentFile().getAbsolutePath());
+ }
+
+ private static void configureLogback() throws URISyntaxException {
+ File confFile = new File(StartServer.class.getResource("/conf/logback.xml").toURI());
+ System.setProperty("logback.configurationFile", confFile.getAbsolutePath());
+ System.setProperty("logback.ContextSelector", "JNDI");
+ }
+}
diff --git a/sonar-application/src/test/java/org/sonar/application/JettyEmbedderTest.java b/sonar-application/src/test/java/org/sonar/application/JettyEmbedderTest.java new file mode 100644 index 00000000000..9f0fcdb93f7 --- /dev/null +++ b/sonar-application/src/test/java/org/sonar/application/JettyEmbedderTest.java @@ -0,0 +1,59 @@ +/* + * Sonar, open source software quality management tool. + * Copyright (C) 2009 SonarSource SA + * mailto:contact AT sonarsource DOT com + * + * Sonar is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * Sonar is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with Sonar; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 + */ +package org.sonar.application; + +import org.apache.commons.lang.StringUtils; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; +import org.junit.Test; + +public class JettyEmbedderTest { + + @Test + public void xmlConfigurationShouldAccessToSomeSystemProperties() throws Exception { + // useful to set the port into the XML file + new JettyEmbedder("127.0.0.1", 9999, "/", 10000, JettyEmbedderTest.class.getResource("/org/sonar/application/jetty-test.xml")); + assertEquals("127.0.0.1", System.getProperty("jetty.host")); + assertEquals("9999", System.getProperty("jetty.port")); + assertEquals("/", System.getProperty("jetty.context")); + assertEquals("10000", System.getProperty("jetty.ajp13Port")); + } + + @Test + public void shouldUseDefaultConfigurationIfNoXml() throws Exception { + JettyEmbedder jetty = new JettyEmbedder("1.2.3.4", 9999); + assertEquals(1, jetty.getServer().getConnectors().length); + assertEquals(9999, jetty.getServer().getConnectors()[0].getPort()); + assertEquals("1.2.3.4", jetty.getServer().getConnectors()[0].getHost()); + } + + @Test + public void shouldLoadPluginsClasspath() throws Exception { + JettyEmbedder jetty = new JettyEmbedder("127.0.0.1", 9999); + String classpath = jetty.getPluginsClasspath("/org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath"); + classpath = StringUtils.replaceChars(classpath, "\\", "/"); + + assertTrue(classpath, classpath.contains("org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/plugin1.jar")); + assertTrue(classpath, classpath.contains("org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/plugin2.jar")); + + // important : directories end with / + assertTrue(classpath, classpath.contains("org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/,")); + } +} diff --git a/sonar-application/src/test/resources/org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/foo.xml b/sonar-application/src/test/resources/org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/foo.xml new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/sonar-application/src/test/resources/org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/foo.xml diff --git a/sonar-application/src/test/resources/org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/plugin1.jar b/sonar-application/src/test/resources/org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/plugin1.jar new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/sonar-application/src/test/resources/org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/plugin1.jar diff --git a/sonar-application/src/test/resources/org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/plugin2.jar b/sonar-application/src/test/resources/org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/plugin2.jar new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/sonar-application/src/test/resources/org/sonar/application/JettyEmbedderTest/shouldLoadPluginsClasspath/plugin2.jar diff --git a/sonar-application/src/test/resources/org/sonar/application/jetty-test.xml b/sonar-application/src/test/resources/org/sonar/application/jetty-test.xml new file mode 100755 index 00000000000..bf0c35af524 --- /dev/null +++ b/sonar-application/src/test/resources/org/sonar/application/jetty-test.xml @@ -0,0 +1,61 @@ +<?xml version="1.0"?> +<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd"> + +<!-- =============================================================== --> +<!-- Configure the Jetty Server --> +<!-- --> +<!-- Documentation of this file format can be found at: --> +<!-- http://docs.codehaus.org/display/JETTY/jetty.xml --> +<!-- --> +<!-- =============================================================== --> + + +<Configure id="Server" class="org.mortbay.jetty.Server"> + + <!-- =========================================================== --> + <!-- Server Thread Pool --> + <!-- =========================================================== --> + <Set name="ThreadPool"> + <!-- Default bounded blocking threadpool + --> + <New class="org.mortbay.thread.BoundedThreadPool"> + <Set name="minThreads">5</Set> + <Set name="maxThreads">50</Set> + <Set name="lowThreads">10</Set> + </New> + + </Set> + + <!-- =========================================================== --> + <!-- Set connectors --> + <!-- =========================================================== --> + <!-- One of each type! --> + <!-- =========================================================== --> + + <!-- Use this connector for many frequently idle connections + and for threadless continuations. + --> + <Call name="addConnector"> + <Arg> + <New class="org.mortbay.jetty.nio.SelectChannelConnector"> + <Set name="host"><SystemProperty name="jetty.host" default="0.0.0.0"/></Set> + <Set name="port"><SystemProperty name="jetty.port" default="9000"/></Set> + <Set name="maxIdleTime">30000</Set> + <Set name="Acceptors">2</Set> + <Set name="statsOn">false</Set> + <Set name="confidentialPort">8443</Set> + <Set name="lowResourcesConnections">5000</Set> + <Set name="lowResourcesMaxIdleTime">5000</Set> + </New> + </Arg> + </Call> + + <!-- =========================================================== --> + <!-- extra options --> + <!-- =========================================================== --> + <Set name="stopAtShutdown">true</Set> + <Set name="sendServerVersion">true</Set> + <Set name="sendDateHeader">true</Set> + <Set name="gracefulShutdown">1000</Set> + +</Configure> diff --git a/sonar-application/src/test/resources/war/sonar-web/deploy/maven/hack_for_classloader b/sonar-application/src/test/resources/war/sonar-web/deploy/maven/hack_for_classloader new file mode 100644 index 00000000000..42d6926dae3 --- /dev/null +++ b/sonar-application/src/test/resources/war/sonar-web/deploy/maven/hack_for_classloader @@ -0,0 +1,163 @@ +<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.codehaus.sonar</groupId>
+ <artifactId>sonar</artifactId>
+ <version>1.3-SNAPSHOT</version>
+ </parent>
+ <artifactId>sonar-application</artifactId>
+ <packaging>jar</packaging>
+ <name>Sonar application</name>
+ <description>Package the standalone distribution</description>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.1</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <finalName>sonar-${project.version}</finalName>
+ <descriptors>
+ <descriptor>assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sonar-server</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sonar-core</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-naming</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <!-- for jetty logging trough logback -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl104-over-slf4j</artifactId>
+ <version>1.4.3</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+ <!-- logback filter needed dependency -->
+ <dependency>
+ <groupId>janino</groupId>
+ <artifactId>janino</artifactId>
+ <version>2.5.10</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.3</version>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>ci-integrate</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <tasks>
+
+ <fail unless="project.build.directory" message="provide a project.build.directory property to indicate where the sonar archive can be found" />
+ <fail unless="ci.deploy.target" message="provide a ci.deploy.target property to indicate where the application will be deployed" />
+ <fail unless="ci.nt.service.name" message="provide a ci.nt.service.name property to indicate the nt service name to start-stop" />
+ <available property="sonar.zip.archive" file="${project.build.directory}/sonar-${project.version}.zip" />
+ <fail unless="sonar.zip.archive" message="sonar archive ${project.build.directory}/sonar-${project.version}.zip not found" />
+
+ <echo message="Java OS Property=${os.name}" />
+ <echo message="Sonar NT service name=${os.name}" />
+ <property name="windows.os.name" value="Windows 2003" />
+
+ <exec executable="net" failonerror="false" os="${windows.os.name}">
+ <arg value="stop" />
+ <arg value="${ci.nt.service.name}" />
+ </exec>
+
+ <mkdir dir="${ci.deploy.target}" />
+ <delete dir="${ci.deploy.target}/ci-tmp" />
+ <delete includeemptydirs="true">
+ <fileset dir="${ci.deploy.target}">
+ <include name="**" />
+ <exclude name="conf/**" />
+ <exclude name="data/**" />
+ <exclude name="extensions/**" />
+ </fileset>
+ </delete>
+
+ <echo message="Deploying ${project.build.directory}/sonar-${project.version}.zip to ${ci.deploy.target}" />
+ <unzip src="${project.build.directory}/sonar-${project.version}.zip" dest="${ci.deploy.target}/ci-tmp" />
+
+ <move todir="${ci.deploy.target}" overwrite="false">
+ <fileset dir="${ci.deploy.target}/ci-tmp/sonar-${project.version}">
+ <include name="**" />
+ <exclude name="conf/**" />
+ <exclude name="data/**" />
+ <exclude name="extensions/**" />
+ </fileset>
+ </move>
+
+ <delete dir="${ci.deploy.target}/ci-tmp" />
+
+ <exec executable="cmd" dir="${ci.deploy.target}/bin" failonerror="false" os="${windows.os.name}">
+ <arg value="/c" />
+ <arg value="UninstallNTService.bat" />
+ </exec>
+ <exec executable="cmd" dir="${ci.deploy.target}/bin" failonerror="true" os="${windows.os.name}">
+ <arg value="/c" />
+ <arg value="InstallNTService.bat" />
+ </exec>
+
+ <exec executable="net" failonerror="true" os="${windows.os.name}">
+ <arg value="start" />
+ <arg value="${ci.nt.service.name}" />
+ </exec>
+
+ </tasks>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file diff --git a/sonar-application/src/test/resources/war/sonar-web/images/hack_for_classloader b/sonar-application/src/test/resources/war/sonar-web/images/hack_for_classloader new file mode 100644 index 00000000000..42d6926dae3 --- /dev/null +++ b/sonar-application/src/test/resources/war/sonar-web/images/hack_for_classloader @@ -0,0 +1,163 @@ +<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.codehaus.sonar</groupId>
+ <artifactId>sonar</artifactId>
+ <version>1.3-SNAPSHOT</version>
+ </parent>
+ <artifactId>sonar-application</artifactId>
+ <packaging>jar</packaging>
+ <name>Sonar application</name>
+ <description>Package the standalone distribution</description>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.1</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <finalName>sonar-${project.version}</finalName>
+ <descriptors>
+ <descriptor>assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sonar-server</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sonar-core</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-naming</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <!-- for jetty logging trough logback -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl104-over-slf4j</artifactId>
+ <version>1.4.3</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+ <!-- logback filter needed dependency -->
+ <dependency>
+ <groupId>janino</groupId>
+ <artifactId>janino</artifactId>
+ <version>2.5.10</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.3</version>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>ci-integrate</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <tasks>
+
+ <fail unless="project.build.directory" message="provide a project.build.directory property to indicate where the sonar archive can be found" />
+ <fail unless="ci.deploy.target" message="provide a ci.deploy.target property to indicate where the application will be deployed" />
+ <fail unless="ci.nt.service.name" message="provide a ci.nt.service.name property to indicate the nt service name to start-stop" />
+ <available property="sonar.zip.archive" file="${project.build.directory}/sonar-${project.version}.zip" />
+ <fail unless="sonar.zip.archive" message="sonar archive ${project.build.directory}/sonar-${project.version}.zip not found" />
+
+ <echo message="Java OS Property=${os.name}" />
+ <echo message="Sonar NT service name=${os.name}" />
+ <property name="windows.os.name" value="Windows 2003" />
+
+ <exec executable="net" failonerror="false" os="${windows.os.name}">
+ <arg value="stop" />
+ <arg value="${ci.nt.service.name}" />
+ </exec>
+
+ <mkdir dir="${ci.deploy.target}" />
+ <delete dir="${ci.deploy.target}/ci-tmp" />
+ <delete includeemptydirs="true">
+ <fileset dir="${ci.deploy.target}">
+ <include name="**" />
+ <exclude name="conf/**" />
+ <exclude name="data/**" />
+ <exclude name="extensions/**" />
+ </fileset>
+ </delete>
+
+ <echo message="Deploying ${project.build.directory}/sonar-${project.version}.zip to ${ci.deploy.target}" />
+ <unzip src="${project.build.directory}/sonar-${project.version}.zip" dest="${ci.deploy.target}/ci-tmp" />
+
+ <move todir="${ci.deploy.target}" overwrite="false">
+ <fileset dir="${ci.deploy.target}/ci-tmp/sonar-${project.version}">
+ <include name="**" />
+ <exclude name="conf/**" />
+ <exclude name="data/**" />
+ <exclude name="extensions/**" />
+ </fileset>
+ </move>
+
+ <delete dir="${ci.deploy.target}/ci-tmp" />
+
+ <exec executable="cmd" dir="${ci.deploy.target}/bin" failonerror="false" os="${windows.os.name}">
+ <arg value="/c" />
+ <arg value="UninstallNTService.bat" />
+ </exec>
+ <exec executable="cmd" dir="${ci.deploy.target}/bin" failonerror="true" os="${windows.os.name}">
+ <arg value="/c" />
+ <arg value="InstallNTService.bat" />
+ </exec>
+
+ <exec executable="net" failonerror="true" os="${windows.os.name}">
+ <arg value="start" />
+ <arg value="${ci.nt.service.name}" />
+ </exec>
+
+ </tasks>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file diff --git a/sonar-application/src/test/resources/war/sonar-web/javascripts/hack_for_classloader b/sonar-application/src/test/resources/war/sonar-web/javascripts/hack_for_classloader new file mode 100644 index 00000000000..42d6926dae3 --- /dev/null +++ b/sonar-application/src/test/resources/war/sonar-web/javascripts/hack_for_classloader @@ -0,0 +1,163 @@ +<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.codehaus.sonar</groupId>
+ <artifactId>sonar</artifactId>
+ <version>1.3-SNAPSHOT</version>
+ </parent>
+ <artifactId>sonar-application</artifactId>
+ <packaging>jar</packaging>
+ <name>Sonar application</name>
+ <description>Package the standalone distribution</description>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.1</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <finalName>sonar-${project.version}</finalName>
+ <descriptors>
+ <descriptor>assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sonar-server</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sonar-core</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-naming</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <!-- for jetty logging trough logback -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl104-over-slf4j</artifactId>
+ <version>1.4.3</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+ <!-- logback filter needed dependency -->
+ <dependency>
+ <groupId>janino</groupId>
+ <artifactId>janino</artifactId>
+ <version>2.5.10</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.3</version>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>ci-integrate</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <tasks>
+
+ <fail unless="project.build.directory" message="provide a project.build.directory property to indicate where the sonar archive can be found" />
+ <fail unless="ci.deploy.target" message="provide a ci.deploy.target property to indicate where the application will be deployed" />
+ <fail unless="ci.nt.service.name" message="provide a ci.nt.service.name property to indicate the nt service name to start-stop" />
+ <available property="sonar.zip.archive" file="${project.build.directory}/sonar-${project.version}.zip" />
+ <fail unless="sonar.zip.archive" message="sonar archive ${project.build.directory}/sonar-${project.version}.zip not found" />
+
+ <echo message="Java OS Property=${os.name}" />
+ <echo message="Sonar NT service name=${os.name}" />
+ <property name="windows.os.name" value="Windows 2003" />
+
+ <exec executable="net" failonerror="false" os="${windows.os.name}">
+ <arg value="stop" />
+ <arg value="${ci.nt.service.name}" />
+ </exec>
+
+ <mkdir dir="${ci.deploy.target}" />
+ <delete dir="${ci.deploy.target}/ci-tmp" />
+ <delete includeemptydirs="true">
+ <fileset dir="${ci.deploy.target}">
+ <include name="**" />
+ <exclude name="conf/**" />
+ <exclude name="data/**" />
+ <exclude name="extensions/**" />
+ </fileset>
+ </delete>
+
+ <echo message="Deploying ${project.build.directory}/sonar-${project.version}.zip to ${ci.deploy.target}" />
+ <unzip src="${project.build.directory}/sonar-${project.version}.zip" dest="${ci.deploy.target}/ci-tmp" />
+
+ <move todir="${ci.deploy.target}" overwrite="false">
+ <fileset dir="${ci.deploy.target}/ci-tmp/sonar-${project.version}">
+ <include name="**" />
+ <exclude name="conf/**" />
+ <exclude name="data/**" />
+ <exclude name="extensions/**" />
+ </fileset>
+ </move>
+
+ <delete dir="${ci.deploy.target}/ci-tmp" />
+
+ <exec executable="cmd" dir="${ci.deploy.target}/bin" failonerror="false" os="${windows.os.name}">
+ <arg value="/c" />
+ <arg value="UninstallNTService.bat" />
+ </exec>
+ <exec executable="cmd" dir="${ci.deploy.target}/bin" failonerror="true" os="${windows.os.name}">
+ <arg value="/c" />
+ <arg value="InstallNTService.bat" />
+ </exec>
+
+ <exec executable="net" failonerror="true" os="${windows.os.name}">
+ <arg value="start" />
+ <arg value="${ci.nt.service.name}" />
+ </exec>
+
+ </tasks>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file diff --git a/sonar-application/src/test/resources/war/sonar-web/stylesheets/hack_for_classloader b/sonar-application/src/test/resources/war/sonar-web/stylesheets/hack_for_classloader new file mode 100644 index 00000000000..42d6926dae3 --- /dev/null +++ b/sonar-application/src/test/resources/war/sonar-web/stylesheets/hack_for_classloader @@ -0,0 +1,163 @@ +<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.codehaus.sonar</groupId>
+ <artifactId>sonar</artifactId>
+ <version>1.3-SNAPSHOT</version>
+ </parent>
+ <artifactId>sonar-application</artifactId>
+ <packaging>jar</packaging>
+ <name>Sonar application</name>
+ <description>Package the standalone distribution</description>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.1</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <finalName>sonar-${project.version}</finalName>
+ <descriptors>
+ <descriptor>assembly.xml</descriptor>
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sonar-server</artifactId>
+ <version>${project.version}</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>sonar-core</artifactId>
+ <version>${project.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-plus</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-naming</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty</artifactId>
+ <version>${jetty.version}</version>
+ </dependency>
+ <!-- for jetty logging trough logback -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>jcl104-over-slf4j</artifactId>
+ <version>1.4.3</version>
+ </dependency>
+ <dependency>
+ <groupId>ch.qos.logback</groupId>
+ <artifactId>logback-classic</artifactId>
+ <version>${logback.version}</version>
+ </dependency>
+ <!-- logback filter needed dependency -->
+ <dependency>
+ <groupId>janino</groupId>
+ <artifactId>janino</artifactId>
+ <version>2.5.10</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-configuration</groupId>
+ <artifactId>commons-configuration</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.3</version>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>ci-integrate</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <tasks>
+
+ <fail unless="project.build.directory" message="provide a project.build.directory property to indicate where the sonar archive can be found" />
+ <fail unless="ci.deploy.target" message="provide a ci.deploy.target property to indicate where the application will be deployed" />
+ <fail unless="ci.nt.service.name" message="provide a ci.nt.service.name property to indicate the nt service name to start-stop" />
+ <available property="sonar.zip.archive" file="${project.build.directory}/sonar-${project.version}.zip" />
+ <fail unless="sonar.zip.archive" message="sonar archive ${project.build.directory}/sonar-${project.version}.zip not found" />
+
+ <echo message="Java OS Property=${os.name}" />
+ <echo message="Sonar NT service name=${os.name}" />
+ <property name="windows.os.name" value="Windows 2003" />
+
+ <exec executable="net" failonerror="false" os="${windows.os.name}">
+ <arg value="stop" />
+ <arg value="${ci.nt.service.name}" />
+ </exec>
+
+ <mkdir dir="${ci.deploy.target}" />
+ <delete dir="${ci.deploy.target}/ci-tmp" />
+ <delete includeemptydirs="true">
+ <fileset dir="${ci.deploy.target}">
+ <include name="**" />
+ <exclude name="conf/**" />
+ <exclude name="data/**" />
+ <exclude name="extensions/**" />
+ </fileset>
+ </delete>
+
+ <echo message="Deploying ${project.build.directory}/sonar-${project.version}.zip to ${ci.deploy.target}" />
+ <unzip src="${project.build.directory}/sonar-${project.version}.zip" dest="${ci.deploy.target}/ci-tmp" />
+
+ <move todir="${ci.deploy.target}" overwrite="false">
+ <fileset dir="${ci.deploy.target}/ci-tmp/sonar-${project.version}">
+ <include name="**" />
+ <exclude name="conf/**" />
+ <exclude name="data/**" />
+ <exclude name="extensions/**" />
+ </fileset>
+ </move>
+
+ <delete dir="${ci.deploy.target}/ci-tmp" />
+
+ <exec executable="cmd" dir="${ci.deploy.target}/bin" failonerror="false" os="${windows.os.name}">
+ <arg value="/c" />
+ <arg value="UninstallNTService.bat" />
+ </exec>
+ <exec executable="cmd" dir="${ci.deploy.target}/bin" failonerror="true" os="${windows.os.name}">
+ <arg value="/c" />
+ <arg value="InstallNTService.bat" />
+ </exec>
+
+ <exec executable="net" failonerror="true" os="${windows.os.name}">
+ <arg value="start" />
+ <arg value="${ci.nt.service.name}" />
+ </exec>
+
+ </tasks>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file |