This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/master by this push: new 7aa93cf Add command line scripts. Improve docs. 7aa93cf is described below commit 7aa93cf8869d68843bb95682df6fc0d4daf5f88a Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Feb 19 09:43:11 2021 +0000 Add command line scripts. Improve docs. --- bin/migrate.bat | 58 ++++++++++++++++++++++++++++++++++++++++++ bin/migrate.sh | 60 ++++++++++++++++++++++++++++++++++++++++++++ webapps/docs/changelog.xml | 8 +++--- webapps/docs/config/host.xml | 19 ++++++++++++++ 4 files changed, 141 insertions(+), 4 deletions(-) diff --git a/bin/migrate.bat b/bin/migrate.bat new file mode 100755 index 0000000..62c2854 --- /dev/null +++ b/bin/migrate.bat @@ -0,0 +1,58 @@ +@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 --------------------------------------------------------------------------- +rem Script call Apache Tomcat Migration Tool for Jakarta EE +rem --------------------------------------------------------------------------- + +setlocal + +rem Guess CATALINA_HOME if not defined +set "CURRENT_DIR=%cd%" +if not "%CATALINA_HOME%" == "" goto gotHome +set "CATALINA_HOME=%CURRENT_DIR%" +if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome +cd .. +set "CATALINA_HOME=%cd%" +cd "%CURRENT_DIR%" +:gotHome +if exist "%CATALINA_HOME%\bin\tool-wrapper.bat" goto okHome +echo The CATALINA_HOME environment variable is not defined correctly +echo This environment variable is needed to run this program +goto end +:okHome + +set "EXECUTABLE=%CATALINA_HOME%\bin\tool-wrapper.bat" + +rem Check that target executable exists +if exist "%EXECUTABLE%" goto okExec +echo Cannot find "%EXECUTABLE%" +echo This file is needed to run this program +goto end +:okExec + +rem Get remaining unshifted command line arguments and save them in the +set CMD_LINE_ARGS= +:setArgs +if ""%1""=="""" goto doneSetArgs +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 +shift +goto setArgs +:doneSetArgs + +call "%EXECUTABLE%" -server org.apache.tomcat.jakartaee.MigrationCLI %CMD_LINE_ARGS% + +:end diff --git a/bin/migrate.sh b/bin/migrate.sh new file mode 100755 index 0000000..d454207 --- /dev/null +++ b/bin/migrate.sh @@ -0,0 +1,60 @@ +#!/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. + +# ----------------------------------------------------------------------------- +# Script call Apache Tomcat Migration Tool for Jakarta EE +# ----------------------------------------------------------------------------- + +# Better OS/400 detection: see Bugzilla 31132 +os400=false +case "`uname`" in +OS400*) os400=true;; +esac + +# resolve links - $0 may be a softlink +PRG="$0" + +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 + +PRGDIR=`dirname "$PRG"` +EXECUTABLE=tool-wrapper.sh + +# Check that target executable exists +if $os400; then + # -x will Only work on the os400 if the files are: + # 1. owned by the user + # 2. owned by the PRIMARY group of the user + # this will not work if the user belongs in secondary groups + eval +else + if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then + echo "Cannot find $PRGDIR/$EXECUTABLE" + echo "The file is absent or does not have execute permission" + echo "This file is needed to run this program" + exit 1 + fi +fi + +exec "$PRGDIR"/"$EXECUTABLE" -server org.apache.tomcat.jakartaee.MigrationCLI "$@" diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 0d19158..653c66e 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -129,10 +129,10 @@ </update> <add> Integrate the Tomcat Migration Tool for JakartaEE at deployment time. - Java EE web applications placed in the <code>webapps-ee</code> directory - will be migrated to Jakarta EE 9 and placed in the <code>webapps</code> - where it will be deployed (or not) based on the current settings for - automatic deployment. (markt) + Java EE web applications placed in the <code>webapps-javaee</code> + directory will be migrated to Jakarta EE 9 and placed in the + <code>webapps</code> where it will be deployed (or not) based on the + current settings for automatic deployment. (markt) </add> </changelog> </subsection> diff --git a/webapps/docs/config/host.xml b/webapps/docs/config/host.xml index 56b18eb..3e981a6 100644 --- a/webapps/docs/config/host.xml +++ b/webapps/docs/config/host.xml @@ -184,6 +184,25 @@ used.</p> </attribute> + <attribute name="legacyAppBase" required="false"> + <p>The legacy Application Base directory for this virtual host. This is + the pathname of a directory that may contain Java EE web applications to + be converted to Jakarta EE before deployment. Java EE applications + packaged as WAR files or directories placed in this directory will be + converted to Jakarta EE using the Apache Tomcart Migration Tool for + Jakarta EE. The conversion will be performed using default settings. The + resulting WAR or directory will be placed in the <code>appBase</code> + confiugured for this virtual host.</p> + <p>If the default settings are not appropriate for the migration of an + application, the full range of migration options may be accessed by + performing the migration manually. The <code>migrate.[sh|bat]</code> + scripts are provided in the <code>$CATALINA_HOME/bin</code> directory + for this purpose.</p> + <p>You may specify an absolute pathname, or a pathname that is + relative to the <code>$CATALINA_BASE</code> directory. If not specified, + the default of <code>webapps-javaee</code> will be used.</p> + </attribute> + <attribute name="name" required="true"> <p>Usually the network name of this virtual host, as registered in your <em>Domain Name Service</em> server. Regardless of the case used to --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org