@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  intersection-service-deploy startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%..

@rem Add default JVM options here. You can also use JAVA_OPTS and INTERSECTION_SERVICE_DEPLOY_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\lib\intersection-service-0.1.0.jar;%APP_HOME%\lib\intersection-service-common-1.0.0-SNAPSHOT.jar;%APP_HOME%\lib\intersection-service-biz-1.0.0-SNAPSHOT.jar;%APP_HOME%\lib\intersection-service-api-1.0.0-SNAPSHOT.jar;%APP_HOME%\lib\zkclient-0.5.jar;%APP_HOME%\lib\spring-boot-starter-web-1.2.6.RELEASE.jar;%APP_HOME%\lib\spring-boot-starter-jdbc-1.2.6.RELEASE.jar;%APP_HOME%\lib\spring-boot-starter-test-1.2.6.RELEASE.jar;%APP_HOME%\lib\commons-dbcp-1.4.jar;%APP_HOME%\lib\aspectjweaver-1.8.9.jar;%APP_HOME%\lib\disconf-client-2.6.33.jar;%APP_HOME%\lib\log4j-over-slf4j-1.7.5.jar;%APP_HOME%\lib\slf4j-api-1.7.5.jar;%APP_HOME%\lib\commons-lang3-3.4.jar;%APP_HOME%\lib\wolf-1.3.2.activity-SNAPSHOT.jar;%APP_HOME%\lib\guava-18.0.jar;%APP_HOME%\lib\dcommons-base-0.0.11-SNAPSHOT.jar;%APP_HOME%\lib\xmemcached-1.4.3.jar;%APP_HOME%\lib\spymemcached-2.8.4.jar;%APP_HOME%\lib\mybatis-3.3.1.jar;%APP_HOME%\lib\mybatis-spring-1.2.3.jar;%APP_HOME%\lib\mysql-connector-java-5.1.9.jar;%APP_HOME%\lib\spring-context-4.1.5.RELEASE.jar;%APP_HOME%\lib\spring-context-support-4.1.5.RELEASE.jar;%APP_HOME%\lib\spring-orm-4.1.5.RELEASE.jar;%APP_HOME%\lib\spring-beans-4.1.5.RELEASE.jar;%APP_HOME%\lib\spring-core-4.1.5.RELEASE.jar;%APP_HOME%\lib\spring-web-4.1.5.RELEASE.jar;%APP_HOME%\lib\commons-dbcp2-2.0.1.jar;%APP_HOME%\lib\commons-io-2.4.jar;%APP_HOME%\lib\commons-collections4-4.1.jar;%APP_HOME%\lib\cglib-2.2.2.jar;%APP_HOME%\lib\dubbo-2.4.10.jar;%APP_HOME%\lib\elastic-job-core-1.0.6.jar;%APP_HOME%\lib\elastic-job-spring-1.0.6.jar;%APP_HOME%\lib\javassist-3.20.0-GA.jar;%APP_HOME%\lib\asm-all-3.3.1.jar;%APP_HOME%\lib\jboss-logging-3.3.0.Final.jar;%APP_HOME%\lib\validation-api-1.1.0.Final.jar;%APP_HOME%\lib\resteasy-jaxrs-3.0.7.Final.jar;%APP_HOME%\lib\resteasy-client-3.0.7.Final.jar;%APP_HOME%\lib\resteasy-jackson-provider-3.0.7.Final.jar;%APP_HOME%\lib\resteasy-netty-3.0.7.Final.jar;%APP_HOME%\lib\kafka-clients-0.9.0.1.jar;%APP_HOME%\lib\fastjson-1.2.6.jar;%APP_HOME%\lib\commons-lang-2.6.jar;%APP_HOME%\lib\commons-beanutils-1.8.3.jar;%APP_HOME%\lib\log4j-1.2.17.jar;%APP_HOME%\lib\zookeeper-3.4.8.jar;%APP_HOME%\lib\spring-boot-starter-1.2.6.RELEASE.jar;%APP_HOME%\lib\spring-boot-starter-tomcat-1.2.6.RELEASE.jar;%APP_HOME%\lib\jackson-databind-2.4.6.jar;%APP_HOME%\lib\hibernate-validator-5.1.3.Final.jar;%APP_HOME%\lib\spring-webmvc-4.1.5.RELEASE.jar;%APP_HOME%\lib\spring-jdbc-4.1.5.RELEASE.jar;%APP_HOME%\lib\tomcat-jdbc-8.0.26.jar;%APP_HOME%\lib\spring-tx-4.1.5.RELEASE.jar;%APP_HOME%\lib\junit-4.12.jar;%APP_HOME%\lib\mockito-core-1.10.19.jar;%APP_HOME%\lib\hamcrest-core-1.3.jar;%APP_HOME%\lib\hamcrest-library-1.3.jar;%APP_HOME%\lib\spring-test-4.1.5.RELEASE.jar;%APP_HOME%\lib\commons-pool-1.6.jar;%APP_HOME%\lib\disconf-core-2.6.33.jar;%APP_HOME%\lib\gson-2.3.1.jar;%APP_HOME%\lib\reflections-0.9.9-RC1.jar;%APP_HOME%\lib\aspectjtools-1.8.6.jar;%APP_HOME%\lib\spring-expression-4.1.5.RELEASE.jar;%APP_HOME%\lib\spring-aop-4.1.5.RELEASE.jar;%APP_HOME%\lib\activation-1.1.1.jar;%APP_HOME%\lib\antlr-3.4.jar;%APP_HOME%\lib\aopalliance-1.0.jar;%APP_HOME%\lib\bsh-2.0b1.jar;%APP_HOME%\lib\commons-cli-1.2.jar;%APP_HOME%\lib\commons-codec-1.6.jar;%APP_HOME%\lib\commons-collections-3.2.jar;%APP_HOME%\lib\commons-logging-1.1.2.jar;%APP_HOME%\lib\commons-math3-3.6.1.jar;%APP_HOME%\lib\joda-time-2.9.3.jar;%APP_HOME%\lib\logback-core-1.0.13.jar;%APP_HOME%\lib\logback-classic-1.0.13.jar;%APP_HOME%\lib\velocity-1.7.jar;%APP_HOME%\lib\velocity-tools-2.0.jar;%APP_HOME%\lib\jedis-2.8.1.jar;%APP_HOME%\lib\httpclient-4.3.6.jar;%APP_HOME%\lib\httpasyncclient-4.0.2.jar;%APP_HOME%\lib\javax.servlet-api-3.1.0.jar;%APP_HOME%\lib\commons-pool2-2.2.jar;%APP_HOME%\lib\asm-3.3.1.jar;%APP_HOME%\lib\netty-3.2.5.Final.jar;%APP_HOME%\lib\lombok-1.16.4.jar;%APP_HOME%\lib\quartz-2.2.1.jar;%APP_HOME%\lib\curator-framework-2.10.0.jar;%APP_HOME%\lib\curator-client-2.10.0.jar;%APP_HOME%\lib\curator-recipes-2.10.0.jar;%APP_HOME%\lib\curator-test-2.10.0.jar;%APP_HOME%\lib\jaxrs-api-3.0.7.Final.jar;%APP_HOME%\lib\jboss-annotations-api_1.1_spec-1.0.1.Final.jar;%APP_HOME%\lib\jcip-annotations-1.0.jar;%APP_HOME%\lib\jackson-core-asl-1.9.12.jar;%APP_HOME%\lib\jackson-mapper-asl-1.9.12.jar;%APP_HOME%\lib\jackson-jaxrs-1.9.12.jar;%APP_HOME%\lib\jackson-xc-1.9.12.jar;%APP_HOME%\lib\snappy-java-1.1.1.7.jar;%APP_HOME%\lib\lz4-1.2.0.jar;%APP_HOME%\lib\jline-0.9.94.jar;%APP_HOME%\lib\spring-boot-1.2.6.RELEASE.jar;%APP_HOME%\lib\spring-boot-autoconfigure-1.2.6.RELEASE.jar;%APP_HOME%\lib\spring-boot-starter-logging-1.2.6.RELEASE.jar;%APP_HOME%\lib\snakeyaml-1.14.jar;%APP_HOME%\lib\tomcat-embed-core-8.0.26.jar;%APP_HOME%\lib\tomcat-embed-el-8.0.26.jar;%APP_HOME%\lib\tomcat-embed-logging-juli-8.0.26.jar;%APP_HOME%\lib\tomcat-embed-websocket-8.0.26.jar;%APP_HOME%\lib\jackson-annotations-2.4.6.jar;%APP_HOME%\lib\jackson-core-2.4.6.jar;%APP_HOME%\lib\classmate-1.0.0.jar;%APP_HOME%\lib\tomcat-juli-8.0.26.jar;%APP_HOME%\lib\objenesis-2.1.jar;%APP_HOME%\lib\dom4j-1.6.1.jar;%APP_HOME%\lib\antlr-runtime-3.4.jar;%APP_HOME%\lib\ST4-4.0.4.jar;%APP_HOME%\lib\commons-digester-2.1.jar;%APP_HOME%\lib\commons-chain-1.1.jar;%APP_HOME%\lib\commons-validator-1.3.1.jar;%APP_HOME%\lib\oro-2.0.8.jar;%APP_HOME%\lib\sslext-1.2-0.jar;%APP_HOME%\lib\struts-core-1.3.8.jar;%APP_HOME%\lib\struts-taglib-1.3.8.jar;%APP_HOME%\lib\struts-tiles-1.3.8.jar;%APP_HOME%\lib\httpcore-4.3.3.jar;%APP_HOME%\lib\httpcore-nio-4.3.2.jar;%APP_HOME%\lib\c3p0-0.9.1.2.jar;%APP_HOME%\lib\commons-math-2.2.jar;%APP_HOME%\lib\jcl-over-slf4j-1.7.12.jar;%APP_HOME%\lib\jul-to-slf4j-1.7.12.jar;%APP_HOME%\lib\stringtemplate-3.2.1.jar;%APP_HOME%\lib\antlr-2.7.7.jar;%APP_HOME%\lib\netty-3.7.0.Final.jar;%APP_HOME%\lib\xml-apis-1.0.b2.jar

@rem Execute intersection-service-deploy
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %INTERSECTION_SERVICE_DEPLOY_OPTS%  -classpath "%CLASSPATH%" cn.com.duiba.Application %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable INTERSECTION_SERVICE_DEPLOY_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%INTERSECTION_SERVICE_DEPLOY_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
