WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit daf66bf1 authored by John Zhang's avatar John Zhang
Browse files

Merge branch 'version-bump-tomcat'

parents 439d6cc9 a3947585
Pipeline #1743 failed with stage
in 23 minutes and 59 seconds
......@@ -11,9 +11,9 @@
<property file="dacapo.properties"/>
<property name="bm-name" value="tomcat"/>
<property name="bm-major-version" value="6"/>
<property name="bm-version" value="${bm-major-version}.0.20"/>
<property name="bm-url" value="${apache.dl.url}/${bm-name}/${bm-name}-6/v${bm-version}/src"/>
<property name="bm-major-version" value="9"/>
<property name="bm-version" value="${bm-major-version}.0.2"/>
<property name="bm-url" value="${apache.dl.url}/${bm-name}/${bm-name}-9/v${bm-version}/src"/>
<property name="bm-src-basename" value="apache-${bm-name}-${bm-version}-src"/>
<property name="bm-src" value="${bm-src-basename}.tar.gz"/>
......@@ -26,23 +26,18 @@
<target name="unpack" depends="untar,patch"/>
<target name="bm-build" depends="build-properties,commons-httpclient,dacapo-digest">
<exec executable="${ant.home}/bin/ant" dir="${bm-build-top}" failonerror="yes">
<env key="JAVA_HOME" value="${jdk16home}"/>
<arg line="download"/>
<arg line="-Dbase.path=${bm-downloads}"/>
</exec>
<exec executable="${ant.home}/bin/ant" dir="${bm-build-top}" failonerror="yes">
<env key="JAVA_HOME" value="${jdk16home}"/>
<arg line="deploy"/>
<arg line="-Dbase.path=${bm-downloads}"/>
</exec>
<ant antfile="dist.xml" inheritall="false" dir="${bm-build-top}">
<ant dir="${bm-build-top}" target="download-compile">
<property name="base.path" value="${bm-downloads}"/>
</ant>
<ant dir="${bm-build-top}" target="deploy">
<property name="base.path" value="${bm-downloads}"/>
</ant>
<ant dir="${bm-build-top}" target="dist-static" inheritAll="false">
<property name="base.path" value="${bm-downloads}"/>
<target name="dist-static"/>
</ant>
<mkdir dir="${bm-build-dir}/benchmark"/>
<javac srcdir="${bm-src-dir}" destdir="${bm-build-dir}/benchmark"
source="1.5" target="1.5"
source="1.8" target="1.8"
includes="org/dacapo/tomcat/*"
debug="true" debuglevel="lines,vars,source">
<classpath>
......
......@@ -21,13 +21,17 @@
-->
<Server port="7005" shutdown="SHUTDOWN">
<!--Listener className="org.apache.catalina.startup.VersionLoggerListener" />-->
<!-- Security listener. Documentation at /docs/config/listeners.html
<Listener className="org.apache.catalina.security.SecurityListener" />
-->
<!--APR library loader. Documentation at /docs/apr.html -->
<!-- <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> -->
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -->
<!-- <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> -->
<!-- <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> -->
<!--Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /-->
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<!--Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /-->
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<!--Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" /-->
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
......@@ -64,7 +68,7 @@
APR (HTTP/AJP) Connector: /docs/apr.html
Define a non-SSL HTTP/1.1 Connector on port 8080
-->
<Connector port="7080" protocol="org.apache.coyote.http11.Http11NioProtocol"
<Connector port="7080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="7443" />
<!-- A "Connector" using the shared thread pool-->
......@@ -113,6 +117,10 @@
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->
<!-- Use the LockOutRealm to prevent attempts to guess user passwords
via a brute-force attack -->
<Realm className="org.apache.catalina.realm.LockOutRealm">
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
......@@ -120,12 +128,12 @@
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="false"
xmlValidation="false" xmlNamespaceAware="false">
unpackWARs="true" autoDeploy="true">
<!-- SingleSignOn valve, share authentication between web applications
Documentation at: /docs/config/valve.html -->
......
......@@ -37,27 +37,27 @@ public class Client implements Runnable {
* The pages to iterate through
*/
private final List<Page> pages = Arrays.asList(
new HttpGet("/examples/jsp/jsp2/el/basic-arithmetic.jsp","396eaab04e83090b4d4b259eeca17a5990b7fd73"),
new HttpGet("/examples/jsp/jsp2/el/basic-comparisons.jsp","2b8b76a06d5b9d3be2ed4c80efcab2adaaad880c"),
new HttpGet("/examples/jsp/jsp2/el/implicit-objects.jsp?foo=bar","e799ace810ab35a0b56627ddd276e4ad35dbaff4"),
new HttpGet("/examples/jsp/jsp2/el/functions.jsp?foo=JSP+2.0","c30b0bc98277ad4c2ce48388b3017873f9ca6c9b"),
new HttpGet("/examples/jsp/jsp2/simpletag/hello.jsp","b741884a658f677c7223296c6138089043030024"),
new HttpGet("/examples/jsp/jsp2/simpletag/repeat.jsp","a171bec81dbabd3ad22f4694e54c79d82c5286b9"),
new HttpGet("/examples/jsp/jsp2/simpletag/book.jsp","56044c60aa6744e100033ac7ee1d7e8a11f7d803"),
new HttpGet("/examples/jsp/jsp2/tagfiles/hello.jsp","5117780dcff2717856acf34424a37bea277e6d48"),
new HttpGet("/examples/jsp/jsp2/tagfiles/panel.jsp","dc67adddb6a2b1f97f0d0991034a88bec8a02009"),
new HttpGet("/examples/jsp/jsp2/tagfiles/products.jsp","96d0f521b94868a2450735a453de19753ce4df6e"),
new HttpGet("/examples/jsp/jsp2/el/basic-arithmetic.jsp","dc3db1fb460a427ad6aef0b71d42319213a81f67"),
new HttpGet("/examples/jsp/jsp2/el/basic-comparisons.jsp","7ea08cc03fe9ff5d3cdd7cec7ae5dc1badc2da60"),
new HttpGet("/examples/jsp/jsp2/el/implicit-objects.jsp?foo=bar","fe7fb232248ecc93f5991cfc1b71c55f99ca4d2e"),
new HttpGet("/examples/jsp/jsp2/el/functions.jsp?foo=JSP+2.0","880dab5554db41d30c52c86ad016b3e7b4fc25ff"),
new HttpGet("/examples/jsp/jsp2/simpletag/hello.jsp","fa2cc0fd8bf403beb0e2b55b282b2a9c1e1d8f01"),
new HttpGet("/examples/jsp/jsp2/simpletag/repeat.jsp","5f7c6a02f0307f082015d35ed03cf6ff55bc88e3"),
new HttpGet("/examples/jsp/jsp2/simpletag/book.jsp","070c930c7c21b2a9ebd56c4e2eb529859e58f0bb"),
new HttpGet("/examples/jsp/jsp2/tagfiles/hello.jsp","997ebe20a346b21ce59550d05220ef90dd7d892e"),
new HttpGet("/examples/jsp/jsp2/tagfiles/panel.jsp","cd34787cd5ee0f8c526a65f51851b6441ab8b3d3"),
new HttpGet("/examples/jsp/jsp2/tagfiles/products.jsp","fb9cf67a579e2af4b6b10065102936f64ce86859"),
// Prints the date - don't validate
new HttpGet("/examples/jsp/jsp2/jspx/basic.jspx",200),
new HttpGet("/examples/jsp/jsp2/jspx/svgexample.html",200,"2cc0bde1f9dcdbfdbd2a26ccd7addfce5c332a45"),
new HttpGet("/examples/jsp/jsp2/jspx/svgexample.html",200,"c32e91590a3e031b94cd992fd6fd458960ffb191"),
new HttpGet("/examples/jsp/jsp2/jspx/textRotate.jspx?name=JSPX",200,"62d28df98503af07933c280c991d2742edc5f9f9"),
new HttpGet("/examples/jsp/jsp2/jspattribute/jspattribute.jsp","deafbfc6b6d74013c8684af4ff6caf0f713fcb82"),
new HttpGet("/examples/jsp/jsp2/jspattribute/jspattribute.jsp","b04951dbbbaef1976f0d0bb31bee982c03a2c212"),
// Shuffle is by definition dynamic
new HttpGet("/examples/jsp/jsp2/jspattribute/shuffle.jsp",200),
new HttpGet("/examples/jsp/jsp2/misc/dynamicattrs.jsp","30d42a712e2d336fb6ea84e550d592a38879dde2"),
new HttpGet("/examples/jsp/jsp2/misc/config.jsp","549154d36f75580e2ab018d6b67113a39cd67788"),
new HttpGet("/examples/jsp/jsp2/misc/dynamicattrs.jsp","84097bf8eb796a6c6b4c7c0f9ba755955ee1d459"),
new HttpGet("/examples/jsp/jsp2/misc/config.jsp","9c09e106a8d1d737c4ebdcebbecc0b0e55440238"),
// Number guessing game
new NumGuess(),
......@@ -69,8 +69,8 @@ public class Client implements Runnable {
new HttpGet("/examples/jsp/snp/snoop.jsp",200),
new HttpGet("/examples/jsp/error/error.html",200,"7a4eee413a6d4ebc66baca65c1fcf4c2dd1e9904"),
new HttpGet("/examples/jsp/error/err.jsp?name=audi&submit=Submit",500,"7f207b1e98367e0ee43056f5a242421a46d82eb9"),
new HttpGet("/examples/jsp/error/err.jsp?name=integra&submit=Submit",200,"13fd4b057c42253a761c0a6499b89d314c09b2c2"),
new HttpGet("/examples/jsp/error/err.jsp?name=audi&submit=Submit",500,"4b5b51a41a2720387c089e6f830684578bc40393"),
new HttpGet("/examples/jsp/error/err.jsp?name=integra&submit=Submit",200,"520431c6f0c3a42c33eff68cf4cf89ceda9c074c"),
/*
* The following group of methods form a adding items to a shopping cart
......@@ -78,13 +78,13 @@ public class Client implements Runnable {
* session across several iterations through this list, we should leave the session
* as we find it.
*/
new HttpGet("/examples/jsp/sessions/carts.html",200,"3754d762eca41dc2eb001f98a4707ea38f2c5433"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=NIN+CD&submit=add",200,"3f78ce05a2e8f07aa4f94f19538c28971695d86d"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=JSP+Book&submit=add",200,"7ccdb3cec3da190897151937bf3b9c74967d48db"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=Love+life&submit=add",200,"5f3ab0d1a3beea9335efe9145f833f9d2c394bdd"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=NIN+CD&submit=remove",200,"37eebdc94502e7e68c4dba3ad92ebcea1854a8a5"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=JSP+Book&submit=remove",200,"e0ff09f114b563e50348dae09ae51af519318741"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=Love+life&submit=remove",200,"3b21b228c817c58439223e190f780704f20798f1"),
new HttpGet("/examples/jsp/sessions/carts.html",200,"91ec746482c18aa26f6b155ceedc584c917c6f01"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=NIN+CD&submit=add",200,"a21a3e287b1237e7007e6e53d9ec0093b23f1780"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=JSP+Book&submit=add",200,"bad7c7ec9be65562d3f07c395deee01951bba130"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=Love+life&submit=add",200,"9750717cae0d8efd6367867e9d5aa37ddfed0d14"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=NIN+CD&submit=remove",200,"487e47c9090a39298dd1bdd40b8f2cfc1e40890c"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=JSP+Book&submit=remove",200,"8ab2bc0c1a2470b5c4a7fb29e4312117e1336e7b"),
new HttpPost("/examples/jsp/sessions/carts.jsp?item=Love+life&submit=remove",200,"572d089d7d6d2e209e4f82f0297737cefd88ea13"),
/*
* The validation here is exhibiting weirdness - TODO fix before release
......@@ -92,8 +92,8 @@ public class Client implements Runnable {
* Looks so far like a bug in tomcat :-/
*/
new HttpGet("/examples/jsp/checkbox/check.html",200,"7a8cff196197a6ed7562a45c7844ac6bf99b02a7"),
new HttpGet("/examples/jsp/colors/colors.html","9d87b22161bf2849821d81e5e36eb4be18025719"),
new HttpGet("/examples/jsp/cal/login.html","326bcc06b3ffd9343b9651fcba5f83aaa0866c4d"),
new HttpGet("/examples/jsp/colors/colors.html","3f78993d965d6ce5c46663a44771f97d3eeea16a"),
new HttpGet("/examples/jsp/cal/login.html","b1de3498ea083c6df65baf2b76ab8e911594c6d8"),
// Shows the current time, so can't be digested
new HttpGet("/examples/jsp/include/include.jsp",200),
......@@ -102,14 +102,14 @@ public class Client implements Runnable {
new HttpGet("/examples/jsp/forward/forward.jsp",200),
// Just shows the "plugin not accepted' response
new HttpGet("/examples/jsp/plugin/plugin.jsp",200,"6f4fb4e4b400200b1a457d6450009ad1ba2c7c4d"),
new HttpGet("/examples/jsp/jsptoserv/jsptoservlet.jsp",200,"721d04e5831b5e8a4889d08026b6ed101603b74f"),
new HttpGet("/examples/jsp/plugin/plugin.jsp",200,"032d12a8e82f26b1495ff0c7a26876b951b78d3f"),
new HttpGet("/examples/jsp/jsptoserv/jsptoservlet.jsp",200,"e3546b90c41561db4f0fca4ca7115112a11d0506"),
// Writes the date
new HttpGet("/examples/jsp/xml/xml.jsp",200),
new HttpGet("/examples/jsp/tagplugin/if.jsp",200,"ca82f131bbb4a0ce4eb4f56260b0e11644a1a467"),
new HttpGet("/examples/jsp/tagplugin/foreach.jsp",200,"3f4c255def31a491097fcc3047c86fc65cea03e8"),
new HttpGet("/examples/jsp/tagplugin/choose.jsp",200,"6199be21e61e279106a59479f93221d414f2b689")
new HttpGet("/examples/jsp/tagplugin/if.jsp",200,"c35432566834ada8b9362af6307093ae4c2dd185"),
new HttpGet("/examples/jsp/tagplugin/foreach.jsp",200,"7380ee5da006fe29df4baca0e38b6f754cc5303f"),
new HttpGet("/examples/jsp/tagplugin/choose.jsp",200,"e4a24b5eb600085105a532105f104cf0b8cad48d")
);
/**
......
......@@ -20,6 +20,6 @@ public class StartApp extends HttpGet {
* @param path The path to the webapp to start
*/
public StartApp(String path) {
super("/manager/start?path="+path,200,null);
super("/manager/text/start?path="+path,200,null);
}
}
......@@ -20,6 +20,6 @@ public class StopApp extends HttpGet {
* @param path The path to the webapp to stop
*/
public StopApp(String path) {
super("/manager/stop?path=" + path, 200, null);
super("/manager/text/stop?path=" + path, 200, null);
}
}
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager"/>
<user username="tomcat" password="s3cret" roles="manager"/>
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<!--
NOTE: By default, no user is included in the "manager-gui" role required
to operate the "/manager/html" web application. If you wish to use this app,
you must define such a user - the username and password are arbitrary. It is
strongly recommended that you do NOT use one of the users in the commented out
section below since they are intended for use with the examples web
application.
-->
<!--
NOTE: The sample user and role entries below are intended for use with the
examples web application. They are wrapped in a comment and thus are ignored
when reading this file. If you wish to configure these users for use with the
examples web application, do not forget to remove the <!.. ..> that surrounds
them. You will also need to set the passwords to something appropriate.
-->
<role rolename="manager-gui"/>
<role rolename="manager-status"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<user username="tomcat" password="s3cret" roles="manager-gui,manager-status,manager-script,manager-jmx"/>
<!--
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
<user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
<user username="role1" password="<must-be-changed>" roles="role1"/>
-->
</tomcat-users>
--- apache-tomcat-6.0.20-src/build.properties.default 2009-05-14 09:15:15.000000000 +1000
+++ ../build.properties.default 2017-12-15 15:13:11.136320083 +1100
--- build/apache-tomcat-6.0.20-src/build.properties.default 2017-11-24 16:45:54.563087654 +1100
+++ build.properties-new.default 2017-11-24 16:46:55.752018154 +1100
@@ -45,7 +45,7 @@
base-commons.loc=http://archive.apache.org/dist/commons
base-tomcat.loc=http://archive.apache.org/dist/tomcat
-base-sf.loc=http://downloads.sourceforge.net
-base-sf.loc=http://softlayer.dl.sourceforge.net
+base-sf.loc=https://ncu.dl.sourceforge.net
# ----- Commons Logging, version 1.1 or later -----
......
......@@ -3,7 +3,7 @@
#
javacchome=${toolsdir}/javacc-4.2
mvn.version=2.1.0
mvn.version=3.5.2
# URLs
#
......
......@@ -8,10 +8,11 @@
-->
<project name="commons-codec" default="all" basedir="../..">
<description>Jakarta Commons Logging, required by httpclient (and therefore tomcat)</description>
<property file="ant/dacapo.properties"/>
<property file="dacapo.properties"/>
<property environment="env"/>
<property name="lib-name" value="commons-codec"/>
<property name="lib-version" value="1.4"/>
<property name="lib-version" value="1.11"/>
<property name="lib-url" value="${apache.dl.url}/commons/codec/source/"/>
<property name="lib-src" value="${lib-name}-${lib-version}-src.tar.gz"/>
......@@ -19,17 +20,23 @@
<property name="lib-build-top" value="${lib-build-dir}/${lib-name}-${lib-version}-src"/>
<property name="mvn-home" location="${toolsdir}/apache-maven-${mvn.version}/bin"/>
<property name="mvn-exe" value="${mvn-home}/mvn"/>
<condition property="mvn-exe" value="${mvn-home}/mvn.bat">
<os family="windows"/>
</condition>
<target name="unpack" depends="untar"/>
<target name="build">
<!-- oddness in codec build.xml -->
<touch file="${lib-build-dir}/LICENSE"/>
<ant antfile="build.xml" dir="${lib-build-top}" inheritAll="false">
<target name="jar"/>
</ant>
<exec executable="${mvn-exe}" dir="${lib-build-top}">
<env key="MAVEN_OPTS" value="-Xms256m -Xmx512m"/>
<arg value="clean"/>
<arg value="install"/>
</exec>
</target>
<target name="jar">
<copy file="${lib-build-top}/dist/${lib-name}-${lib-version}.jar" tofile="${commons-codec-jar}"/>
<copy file="${lib-build-top}/target/${lib-name}-${lib-version}.jar" tofile="${commons-codec-jar}"/>
</target>
</project>
e5cfa8cca13152d7545fde6b1783c60a commons-logging-1.1.1-src.tar.gz
......@@ -11,7 +11,7 @@
<property file="ant/dacapo.properties"/>
<property name="lib-name" value="commons-logging"/>
<property name="lib-version" value="1.1.1"/>
<property name="lib-version" value="1.2"/>
<property name="lib-url" value="${apache.dl.url}/commons/logging/source/"/>
<property name="lib-src" value="${lib-name}-${lib-version}-src.tar.gz"/>
......@@ -34,6 +34,6 @@
</target>
<target name="jar">
<copy file="${lib-build-top}/target/commons-logging-api-1.1.1-SNAPSHOT.jar" tofile="${commons-logging-jar}"/>
<copy file="${lib-build-top}/target/commons-logging-api-1.2.jar" tofile="${commons-logging-jar}"/>
</target>
</project>
\ No newline at end of file
--- commons-logging-1.1.1-src/build.xml 2007-11-22 10:27:52.000000000 +1100
+++ ../downloads/build.xml 2018-01-01 22:12:48.046871456 +1100
@@ -221,13 +221,14 @@
--- commons-logging-1.2-src/build.xml 2014-07-06 04:11:36.000000000 +1000
+++ ../build-new.xml 2017-12-11 15:05:02.519781973 +1100
@@ -224,13 +224,14 @@
- Running this target will download all the necessary dependencies into the "lib" subdirectory.
-->
<property name="getlibs.base" value="http://repo1.maven.org/maven"/>
......
=========================================================================
== NOTICE file corresponding to the section 4 d of ==
== the Apache License, Version 2.0, ==
== in this case for the Apache Maven distribution. ==
=========================================================================
This product includes software developed by
The Apache Software Foundation (http://www.apache.org/).
This product includes software (Plexus and Classworlds) developed by
The Codehaus Foundation (http://www.codehaus.org/).
#!/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.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven2 Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# ----------------------------------------------------------------------------
QUOTED_ARGS=""
while [ "$1" != "" ] ; do
QUOTED_ARGS="$QUOTED_ARGS \"$1\""
shift
done
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
darwin=false;
mingw=false
case "`uname`" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true;;
Darwin*) darwin=true
if [ -z "$JAVA_VERSION" ] ; then
JAVA_VERSION="CurrentJDK"
else
echo "Using Java version: $JAVA_VERSION"
fi
if [ -z "$JAVA_HOME" ] ; then
JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home
fi
;;
esac
if [ -z "$JAVA_HOME" ] ; then
if [ -r /etc/gentoo-release ] ; then
JAVA_HOME=`java-config --jre-home`
fi
fi
if [ -z "$M2_HOME" ] ; then
## resolve links - $0 may be a link to maven's home
PRG="$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
saveddir=`pwd`
M2_HOME=`dirname "$PRG"`/..
# make it fully qualified
M2_HOME=`cd "$M2_HOME" && pwd`
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin ; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --unix "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
[ -n "$CLASSPATH" ] &&
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
fi
# For Migwn, ensure paths are in UNIX format before anything is touched
if $mingw ; then
[ -n "$M2_HOME" ] &&
M2_HOME="`(cd "$M2_HOME"; pwd)`"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
# TODO classpath?
fi
if [ -z "$JAVACMD" ] ; then
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
fi
fi
if [ ! -x "$JAVACMD" ] ; then
echo "Error: JAVA_HOME is not defined correctly."
echo " We cannot execute $JAVACMD"
exit 1
fi
if [ -z "$JAVA_HOME" ] ; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.classworlds.Launcher
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=`cygpath --path --windows "$M2_HOME"`
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
[ -n "$HOME" ] &&
HOME=`cygpath --path --windows "$HOME"`
fi
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "${M2_HOME}"/boot/classworlds-*.jar \
"-Dclassworlds.conf=${M2_HOME}/bin/m2.conf" \
"-Dmaven.home=${M2_HOME}" \
${CLASSWORLDS_LAUNCHER} $QUOTED_ARGS
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment