From a958e8c36bcc423a70a92dc4a3c562676fa66a37 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 22 Jul 2014 14:07:15 +0200 Subject: added buildTomcat task --- pdf-as-web/src/main/assembly/tomcat/catalina.env | 11 ++++ .../src/main/assembly/tomcat/setVariables.bat | 68 ++++++++++++++++++++++ .../src/main/assembly/tomcat/startTomcat.bat | 5 ++ pdf-as-web/src/main/assembly/tomcat/startTomcat.sh | 9 +++ pdf-as-web/src/main/assembly/tomcat/stopTomcat.bat | 5 ++ pdf-as-web/src/main/assembly/tomcat/stopTomcat.sh | 7 +++ .../main/assembly/tomcat/webapps/ROOT/index.html | 14 +++++ 7 files changed, 119 insertions(+) create mode 100644 pdf-as-web/src/main/assembly/tomcat/catalina.env create mode 100644 pdf-as-web/src/main/assembly/tomcat/setVariables.bat create mode 100644 pdf-as-web/src/main/assembly/tomcat/startTomcat.bat create mode 100755 pdf-as-web/src/main/assembly/tomcat/startTomcat.sh create mode 100644 pdf-as-web/src/main/assembly/tomcat/stopTomcat.bat create mode 100755 pdf-as-web/src/main/assembly/tomcat/stopTomcat.sh create mode 100644 pdf-as-web/src/main/assembly/tomcat/webapps/ROOT/index.html (limited to 'pdf-as-web/src/main/assembly') diff --git a/pdf-as-web/src/main/assembly/tomcat/catalina.env b/pdf-as-web/src/main/assembly/tomcat/catalina.env new file mode 100644 index 00000000..61e37593 --- /dev/null +++ b/pdf-as-web/src/main/assembly/tomcat/catalina.env @@ -0,0 +1,11 @@ +export CATALINA_HOME=`pwd` +export CATALINA_BASE=`pwd` +export CATALINA_OPTS="\ + -Djava.io.tmpdir=$CATALINA_BASE/temp \ + -Dpdf-as-web.conf=$CATALINA_BASE/conf/pdf-as/pdf-as-web.properties \ + -server \ + -Xss1024K \ + -Xms128M \ + -Xmx2048M \ + -XX:MaxPermSize=256m \ +" diff --git a/pdf-as-web/src/main/assembly/tomcat/setVariables.bat b/pdf-as-web/src/main/assembly/tomcat/setVariables.bat new file mode 100644 index 00000000..606f84e1 --- /dev/null +++ b/pdf-as-web/src/main/assembly/tomcat/setVariables.bat @@ -0,0 +1,68 @@ +@echo off + +set SERVICE_NAME=tomcatpdfas +set SERVICE_DESCRIPTION=ports: shutdown=8005, http=8080 +set SERVICE_DISPLAY_NAME=Apache Tomcat - PDF-AS-WEB +set TITLE=%SERVICE_DISPLAY_NAME% + +rem Set Tomcat installation folder, otherwise automatic detection will be performed. +set TOMCAT_DIR=%CD% + +rem Set Java installation folder, otherwise default JRE/JDK will be used. +rem set JAVA_HOME= + +@echo off +IF "%JAVA_HOME%" == "" ( + echo Enter path to JAVA_HOME: + set /p JAVA_HOME= +) ELSE ( + echo %JAVA_HOME% +) + +rem *** do not change settings beyond this point *** + +if exist %TOMCAT_DIR%\webapps\nul goto START +goto FIND_TOMCAT_DIR + +:FIND_TOMCAT_DIR +set TOMCAT_DIR= +if exist webapps\nul set TOMCAT_DIR=%CD% +if exist ..\webapps\nul set TOMCAT_DIR=%CD%\.. +if "%TOMCAT_DIR%"=="" goto TOMCAT_DIR_NOT_FOUND +goto START + +:TOMCAT_DIR_NOT_FOUND +echo. +echo Unable to find Tomcat installation folder. +goto END + +:START +set CATALINA_HOME=%TOMCAT_DIR% +set CATALINA_BASE=%TOMCAT_DIR% +set PDFAS_WORK_DIR=%CATALINA_BASE%\conf\pdf-as\pdf-as-web.properties + +rem PARAMETERS +set PDFAS_WORK_DIR_PARAM=-Dpdf-as-web.conf="%PDFAS_WORK_DIR%" + +rem MEMORY SETTINGS + +rem Thread stack size in KB +set JVM_XSS=1024 + +rem Initial memory pool size in MB +set JVM_XMS=128 + +rem Maximum memory pool size in MB +set JVM_XMX=2048 + +rem Maximum PermGenSize in M +set JVM_MAXPERMSIZE=256 + +rem COMMAND LINE OPTIONS +set JAVA_OPTS=-server -Xss%JVM_XSS%k -Xms%JVM_XMS%m -Xmx%JVM_XMX%m -XX:MaxPermSize=%JVM_MAXPERMSIZE%m +set CATALINA_OPTS=%PDFAS_WORK_DIR_PARAM% + +rem SERVICE OPTIONS +set SERVICE_OPTS=%PDFAS_WORK_DIR_PARAM%;-XX:MaxPermSize=%JVM_MAXPERMSIZE%m + +:END diff --git a/pdf-as-web/src/main/assembly/tomcat/startTomcat.bat b/pdf-as-web/src/main/assembly/tomcat/startTomcat.bat new file mode 100644 index 00000000..8db7b392 --- /dev/null +++ b/pdf-as-web/src/main/assembly/tomcat/startTomcat.bat @@ -0,0 +1,5 @@ +@echo off +call setVariables.bat +echo. +cd /d %CATALINA_HOME% +bin\catalina.bat start diff --git a/pdf-as-web/src/main/assembly/tomcat/startTomcat.sh b/pdf-as-web/src/main/assembly/tomcat/startTomcat.sh new file mode 100755 index 00000000..646f609b --- /dev/null +++ b/pdf-as-web/src/main/assembly/tomcat/startTomcat.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# +DEFAULT=`pwd`/catalina.env +. $DEFAULT + +chmod +x $CATALINA_HOME/bin/catalina.sh + +$CATALINA_HOME/bin/catalina.sh run + diff --git a/pdf-as-web/src/main/assembly/tomcat/stopTomcat.bat b/pdf-as-web/src/main/assembly/tomcat/stopTomcat.bat new file mode 100644 index 00000000..9c59fb50 --- /dev/null +++ b/pdf-as-web/src/main/assembly/tomcat/stopTomcat.bat @@ -0,0 +1,5 @@ +@echo off +call setVariables.bat +echo. +cd %CATALINA_HOME% +bin\catalina.bat stop diff --git a/pdf-as-web/src/main/assembly/tomcat/stopTomcat.sh b/pdf-as-web/src/main/assembly/tomcat/stopTomcat.sh new file mode 100755 index 00000000..c5943ebc --- /dev/null +++ b/pdf-as-web/src/main/assembly/tomcat/stopTomcat.sh @@ -0,0 +1,7 @@ +#!/bin/sh +# +DEFAULT=`pwd`/catalina.env +. $DEFAULT + +$CATALINA_HOME/bin/catalina.sh stop + diff --git a/pdf-as-web/src/main/assembly/tomcat/webapps/ROOT/index.html b/pdf-as-web/src/main/assembly/tomcat/webapps/ROOT/index.html new file mode 100644 index 00000000..e607149c --- /dev/null +++ b/pdf-as-web/src/main/assembly/tomcat/webapps/ROOT/index.html @@ -0,0 +1,14 @@ + + + + + + Apache Tomcat - PDF-AS-WEB + + + +

Apache Tomcat - PDF-AS-WEB

+

PDF-AS

+ + + \ No newline at end of file -- cgit v1.2.3