Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: BRANCH_2_1_X
Fetching contributors…

Cannot retrieve contributors at this time

195 lines (155 sloc) 8.452 kb
@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 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.
:: -----------------------------------------------------------------------------
:: Cocoon Win32 Shell Script
:: $Id$
:: -----------------------------------------------------------------------------
:: Configuration variables
:: Folder that points to the root of the Cocoon distribution
:: Folder containing all the library files needed by the Cocoon CLI
:: Home of Java installation.
:: Extra options to pass to the JVM
:: The location where the JVM debug server should listen to
:: Override the default port for Jetty
:: The port where the jetty web administration should bind
:: The directory where the webapp that jetty has to execute is located
:: ----- Verify and Set Required Environment Variables -------------------------
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo You must set JAVA_HOME to point at your Java Development Kit installation
goto end
:: ----- Check System Properties -----------------------------------------------
if not "%EXEC%" == "" goto gotExec
if not "%OS%" == "Windows_NT" goto noExecNT
set EXEC=start "Cocoon" /D.
goto gotExec
set EXEC=
if not "%COCOON_HOME%" == "" goto gotHome
if not "%COCOON_LIB%" == "" goto gotLib
set COCOON_LIB=%COCOON_HOME%\build\webapp\WEB-INF\lib
if not "%JETTY_PORT%" == "" goto gotJettyPort
set JETTY_PORT=8888
if not "%JETTY_ADMIN_PORT%" == "" goto gotJettyAdminPort
if not "%JETTY_WEBAPP%" == "" goto gotWebapp
set DEMO_WEBAPP=..\webapp
if not exist %DEMO_WEBAPP% goto standardWebapp
goto gotWebapp
set JETTY_WEBAPP=%COCOON_HOME%\build\webapp
echo cocoon.bat: using %JETTY_WEBAPP% as the webapp directory
if not "%JAVA_DEBUG_PORT%" == "" goto gotDebugPort
:: ----- Ensure desktop.ini is activated ---------------------------------------
attrib +s %COCOON_HOME%
:: ----- Set Up The Classpath --------------------------------------------------
set CP=%COCOON_HOME%\tools\loader
:: ----- Check action ----------------------------------------------------------
if ""%1"" == """" goto doServlet
if ""%1"" == ""cli"" goto doCli
if ""%1"" == ""precompile"" goto doPrecompile
if ""%1"" == ""servlet"" goto doServlet
if ""%1"" == ""servlet-admin"" goto doAdmin
if ""%1"" == ""servlet-debug"" goto doDebug
IF ""%1"" == ""servlet-profile"" goto doProfile
IF ""%1"" == ""yourkit-profile"" goto doYourkitProfile
echo Usage: cocoon (action)
echo actions:
echo cli Run Cocoon from command line
echo precompile Crawl your webapp to compile all XSP files (requires the xsp block)
echo servlet Run Cocoon in a servlet container (default)
echo servlet-admin Run Cocoon in a servlet container and turn container web administration on
echo servlet-debug Run Cocoon in a servlet container and turn on remote JVM debug
echo servlet-profile Run Cocoon in a servlet container and turn on JVM profiling
echo yourkit-profile Run Cocoon in a servlet container and turn on Yourkit JVM profiling
goto end
:: ----- Cli -------------------------------------------------------------------
set param=
if "%1"=="" goto cliLoopEnd
if not "%1"=="" set param=%param% %1
goto cliLoop
"%JAVA_HOME%\bin\java.exe" %JAVA_OPTIONS% -classpath "%CP%" -Djava.endorsed.dirs=lib\endorsed "-Dloader.jar.repositories=%COCOON_LIB%" "-Dloader.class.path=lib\core\servlet-2.3.jar;%COCOON_HOME%\build\webapp\WEB-INF\classes" -Dloader.verbose=false -Dloader.main.class=org.apache.cocoon.Main Loader %param%
goto end
:: ----- Precompile ------------------------------------------------------------
set param=
if "%1"=="" goto PrecompileLoopEnd
if not "%1"=="" set param=%param% %1
goto PrecompileLoop
"%JAVA_HOME%\bin\java.exe" %JAVA_OPTIONS% -classpath "%CP%" -Djava.endorsed.dirs=lib\endorsed "-Dloader.jar.repositories=%COCOON_LIB%" "-Dloader.class.path=lib\core\servlet-2.3.jar;%COCOON_HOME%\build\webapp\WEB-INF\classes" -Dloader.verbose=false -Dloader.main.class=org.apache.cocoon.bean.XSPPrecompileWrapper Loader %param%
goto end
:: ----- Servlet ---------------------------------------------------------------
%EXEC% "%JAVA_HOME%\bin\java.exe" %JAVA_OPTIONS% -classpath "%CP%" "-Dloader.class.path=lib\core\servlet-2.3.jar" "-Djava.endorsed.dirs=%COCOON_HOME%\lib\endorsed" "-Dwebapp=%JETTY_WEBAPP%" -Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser -Djetty.port=%JETTY_PORT% -Djetty.admin.port=%JETTY_ADMIN_PORT% "-Dhome=%COCOON_HOME%" "-Dloader.jar.repositories=%COCOON_HOME%\tools\jetty\lib;%COCOON_HOME%\lib\endorsed" -Dloader.main.class=org.mortbay.jetty.Server Loader "%COCOON_HOME%\tools\jetty\conf\main.xml"
goto end
:: ----- Servlet with Administration Web Interface -----------------------------
%EXEC% "%JAVA_HOME%\bin\java.exe" %JAVA_OPTIONS% -classpath "%CP%" "-Djava.endorsed.dirs=%COCOON_HOME%\lib\endorsed" "-Dwebapp=%JETTY_WEBAPP%" -Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser -Djetty.port=%JETTY_PORT% -Djetty.admin.port=%JETTY_ADMIN_PORT% "-Dhome=%COCOON_HOME%" "-Dloader.jar.repositories=%COCOON_HOME%\tools\jetty\lib;%COCOON_HOME%\lib\endorsed" -Dloader.main.class=org.mortbay.jetty.Server Loader "%COCOON_HOME%\tools\jetty\conf\main.xml" "%COCOON_HOME%\tools\jetty\conf\admin.xml"
goto end
:: ----- Servlet Debug ---------------------------------------------------------
%EXEC% "%JAVA_HOME%\bin\java.exe" %JAVA_OPTIONS% -Xdebug -Xrunjdwp:transport=dt_socket,address=%JAVA_DEBUG_PORT%,server=y,suspend=n -classpath "%CP%" "-Djava.endorsed.dirs=%COCOON_HOME%\lib\endorsed" "-Dwebapp=%JETTY_WEBAPP%" "-Dhome=%COCOON_HOME%" -Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser -Djetty.port=%JETTY_PORT% -Djetty.admin.port=%JETTY_ADMIN_PORT% "-Dloader.jar.repositories=%COCOON_HOME%\tools\jetty\lib;%COCOON_HOME%\lib\endorsed" -Dloader.main.class=org.mortbay.jetty.Server Loader "%COCOON_HOME%\tools\jetty\conf\main.xml"
goto end
:: ----- Servlet Profile ---------------------------------------------------------
%EXEC% "%JAVA_HOME%\bin\java.exe" %JAVA_OPTIONS% -Xrunhprof:heap=all,cpu=samples,thread=y,depth=3 -classpath "%CP%" "-Djava.endorsed.dirs=%COCOON_HOME%\lib\endorsed" "-Dwebapp=%JETTY_WEBAPP%" "-Dhome=%COCOON_HOME%" -Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser -Djetty.port=%JETTY_PORT% -Djetty.admin.port=%JETTY_ADMIN_PORT% "-Dloader.jar.repositories=%COCOON_HOME%\tools\jetty\lib;%COCOON_HOME%\lib\endorsed" -Dloader.main.class=org.mortbay.jetty.Server Loader "%COCOON_HOME%\tools\jetty\conf\main.xml"
:: ----- Yourkit Profile --------------------------------------------------------
echo x
%EXEC% "%JAVA_HOME%\bin\java.exe" %JAVA_OPTIONS% -Xrunyjpagent:port=10000 -classpath "%CP%" "-Djava.endorsed.dirs=%COCOON_HOME%\lib\endorsed" "-Dwebapp=%JETTY_WEBAPP%" "-Dhome=%COCOON_HOME%" -Dorg.xml.sax.parser=org.apache.xerces.parsers.SAXParser -Djetty.port=%JETTY_PORT% -Djetty.admin.port=%JETTY_ADMIN_PORT% "-Dloader.jar.repositories=%COCOON_HOME%\tools\jetty\lib;%COCOON_HOME%\lib\endorsed" -Dloader.main.class=org.mortbay.jetty.Server Loader "%COCOON_HOME%\tools\jetty\conf\main.xml"
goto end
:: ----- End -------------------------------------------------------------------
set CP=
set EXEC=
Jump to Line
Something went wrong with that request. Please try again.