echo init the environment parameters call initEnv.cmd IF NOT EXIST %GERONIMOPATH% 7z x geronimo-tomcat6-javaee5-%geronimoVersion%-bin.zip -y -bd SET /a i=1 :loop IF %i%==3 GOTO END echo create and start server %i%. IF NOT EXIST server%i%\etc mkdir server%i% IF NOT EXIST server%i%\etc xcopy %GERONIMOPATH% server%i% /E/R/Q/Y echo cleanup the deployed artifacts. IF EXIST server%i%\repository\%realmGroup% RD server%i%\repository\%realmGroup% /S /Q IF EXIST server%i%\repository\%warGroup% RD server%i%\repository\%warGroup% /S /Q echo cleanup config and use our own config.xml IF EXIST server%i%\var\config RD server%i%\var\config /S /Q IF NOT EXIST server%i%\var\config mkdir server%i%\var\config xcopy %GERONIMOPATH%\var\config server%i%\var\config /E/R copy config%i%.xml server%i%\var\config\config.xml /Y echo use our own log4j configuration file copy server-log4j.properties server%i%\var\log\server-log4j.properties /Y set server=server%i% set portOffset=%i%0 set /A jdwpport=5004+%i% echo START "node - %i% with portOffSet %i%0" %cd%\server%i%\bin\gsh.bat -c "geronimo/start-server -J -Xdebug -J -Xnoagent -J -Djava.compiler=NONE -J -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=%jdwpport% -b -G config.substitution.ServerHostname=%HOST% -G config.substitution.PortOffset=%i%0" START /MIN "node - %i% with portOffSet %i%0" %cd%\server%i%\bin\gsh.bat -c "geronimo/start-server -J -Xdebug -J -Xnoagent -J -Djava.compiler=NONE -J -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=%jdwpport% -b -G config.substitution.ServerHostname=%HOST% -G config.substitution.PortOffset=%i%0" SET /a i=%i%+1 GOTO LOOP :end echo nodes instances started