benjobs 7 lat temu
rodzic
commit
265afb300a

+ 9 - 12
build.sh

@@ -53,13 +53,13 @@ PRGDIR=`dirname "$PRG"`
 
 WORKDIR="`readlink -f ${PRGDIR}`"
 
-MAVEN_URL="http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.0/binaries/apache-maven-3.5.0-bin.tar.gz";
+MAVEN_URL="http://mirror.bit.edu.cn/apache/maven/maven-3/3.5.2/binaries/apache-maven-3.5.2-bin.tar.gz";
 
-MAVEN_NAME="apache-maven-3.5.0-bin"
+MAVEN_NAME="apache-maven-3.5.2-bin"
 
-UNPKG_MAVEN_NAME="apache-maven-3.5.0";
+UNPKG_MAVEN_NAME="apache-maven-3.5.2";
 
-OPENCRON_VERSION="1.1.0-RELEASE";
+OPENCRON_VERSION="1.2.0-RELEASE";
 
 BUILD_HOME=${WORKDIR}/build
 
@@ -115,7 +115,7 @@ if [ $? -ne 1 ]; then
 
     if [ -x "${BUILD_HOME}/${UNPKG_MAVEN_NAME}" ] ; then
         echo_w "maven is already download,now config setting...";
-        OPENCRON_MAVEN=${BUILD_HOME}/${UNPKG_MAVEN_NAME}/bin/mvn
+        MVN=${BUILD_HOME}/${UNPKG_MAVEN_NAME}/bin/mvn
     else
         echo_w "download maven Starting..."
         echo_w "checking network connectivity ... "
@@ -123,14 +123,13 @@ if [ $? -ne 1 ]; then
         ping_count=2
         ping -c ${ping_count} ${net_check_ip} >/dev/null
         retval=$?
-
         if [ ${retval} -eq 0 ] ; then
             echo_w "network is connectioned,download maven Starting... "
             wget -P ${BUILD_HOME} $MAVEN_URL && {
                 echo_g "download maven successful!";
                 echo_w "install maven Starting"
                 tar -xzvf ${BUILD_HOME}/${MAVEN_NAME}.tar.gz -C ${BUILD_HOME}
-                OPENCRON_MAVEN=${BUILD_HOME}/${UNPKG_MAVEN_NAME}/bin/mvn
+                MVN=${BUILD_HOME}/${UNPKG_MAVEN_NAME}/bin/mvn
             }
         elif [ ${retval} -ne 0 ]; then
             echo_r "ERROR:network is blocked! download maven failed,please check your network!build error! bye!"
@@ -138,15 +137,13 @@ if [ $? -ne 1 ]; then
         fi
     fi
 
-elif [ "$OPENCRON_MAVEN"x = ""x ]; then
-
-    OPENCRON_MAVEN="mvn";
-
+elif [ "$MVN"x = ""x ]; then
+    MVN="mvn";
 fi
 
 echo_w "build opencron Starting...";
 
-$OPENCRON_MAVEN clean install -Dmaven.test.skip=true;
+$MVN clean install -Dmaven.test.skip=true;
 
 retval=$?
 

+ 0 - 83
opencron-server/src/main/resources/applicationContext-datasource.xml

@@ -1,83 +0,0 @@
-<beans xmlns="http://www.springframework.org/schema/beans"
-	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	   xmlns:tx="http://www.springframework.org/schema/tx"
-	   xmlns:aop="http://www.springframework.org/schema/aop"
-	   xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans.xsd
-           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
-           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd"
-	   default-lazy-init="true">
-
-	<bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
-		<!-- 基本属性 url、user、password -->
-		<property name="driverClassName" value="${jdbc.driver}"/>
-		<property name="url" value="${jdbc.url}" />
-		<property name="username" value="${jdbc.username}" />
-		<property name="password" value="${jdbc.password}" />
-
-		<!-- 配置初始化大小、最小、最大 -->
-		<property name="initialSize" value="3" />
-		<property name="minIdle" value="2" />
-		<property name="maxActive" value="20" />
-
-		<!-- 配置获取连接等待超时的时间 -->
-		<property name="maxWait" value="60000" />
-
-		<!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
-		<property name="timeBetweenEvictionRunsMillis" value="60000" />
-
-		<!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
-		<property name="minEvictableIdleTimeMillis" value="300000" />
-
-		<property name="validationQuery" value="SELECT 'x'" />
-		<property name="testWhileIdle" value="true" />
-		<property name="testOnBorrow" value="false" />
-		<property name="testOnReturn" value="false" />
-
-		<!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
-		<property name="poolPreparedStatements" value="true" />
-		<property name="maxPoolPreparedStatementPerConnectionSize" value="20" />
-
-		<!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
-		<property name="filters" value="stat" />
-	</bean>
-
-	<!-- Hibernate配置 -->
-	<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
-		<property name="dataSource" ref="dataSource" />
-		<property name="namingStrategy">
-			<bean class="org.hibernate.cfg.DefaultNamingStrategy" />
-		</property>
-		<property name="hibernateProperties">
-			<props>
-				<prop key="hibernate.dialect">${hibernate.dialect}</prop>
-				<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
-				<prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
-				<prop key="hibernate.current_session_context_class">${hibernate.current_session_context_class}</prop>
-				<prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
-				<prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop>
-				<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
-				<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
-				<prop key="jdbc.use_scrollable_resultset">${jdbc.use_scrollable_resultset}</prop>
-				<prop key="hibernate.c3p0.preferredTestQuery">select 1;</prop>
-				<prop key="hibernate.connectio.useUnicode">true</prop>
-				<prop key="hibernate.connection.characterEncoding">utf-8</prop>
-				<prop key="hibernate.autoReconnect">true</prop>
-				<prop key="hibernate.hbm2ddl.auto">update</prop>
-			</props>
-		</property>
-		<property name="packagesToScan" value="org.opencron.server.domain" />
-	</bean>
-
-	<!-- 事务配置 -->
-	<bean id="transactionManager"  class="org.springframework.orm.hibernate4.HibernateTransactionManager">
-		<property name="sessionFactory">
-			<ref bean="sessionFactory" />
-		</property>
-	</bean>
-
-	<!-- 使用annotation定义事务 -->
-	<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />
-	<aop:aspectj-autoproxy proxy-target-class="true" />
-
-</beans>

+ 0 - 71
opencron-server/src/main/resources/applicationContext-mvc.xml

@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:mvc="http://www.springframework.org/schema/mvc"
-       xmlns:context="http://www.springframework.org/schema/context"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
-        http://www.springframework.org/schema/mvc
-        http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
-        http://www.springframework.org/schema/context
-        http://www.springframework.org/schema/context/spring-context-3.2.xsd">
-
-
-    <context:component-scan base-package="org.opencron.server.controller"/>
-
-    <!--防止 @ResponseBody 中文乱码 此配置必须放在 注解驱动 前面-->
-    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
-        <property name="messageConverters">
-            <list>
-                <ref bean="stringHttpMessageConverter"/>
-                <ref bean="jsonHttpMessageConverter"/>
-            </list>
-        </property>
-    </bean>
-
-    <!--字符串试图,解决ResponseBody 乱码-->
-    <bean id="stringHttpMessageConverter" class="org.springframework.http.converter.StringHttpMessageConverter">
-        <property name="supportedMediaTypes">
-            <list>
-                <value>text/plain;charset=UTF-8</value>
-            </list>
-        </property>
-    </bean>
-    <!--Json 视图-->
-    <bean id="jsonHttpMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
-
-    <mvc:annotation-driven/>
-    <mvc:resources mapping="/static/**" location="/static/"/>
-    <mvc:resources mapping="/favicon.ico" location="/favicon.ico"/>
-    <mvc:default-servlet-handler/>
-
-    <mvc:interceptors>
-        <mvc:interceptor>
-            <mvc:mapping path="/**" />
-            <bean class="org.opencron.server.handler.SecurityHandlerInterceptor" />
-        </mvc:interceptor>
-    </mvc:interceptors>
-
-
-    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
-        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
-        <property name="prefix" value="/WEB-INF/view/" />
-        <property name="suffix" value=".jsp" />
-    </bean>
-
-    <bean id="multipartResolver"  class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
-        <!-- set the max upload size 100M -->
-        <property name="maxUploadSize">
-            <value>104857600</value>
-        </property>
-        <property name="maxInMemorySize">
-            <value>4096</value>
-        </property>
-        <property name="resolveLazily" value="true"/>
-    </bean>
-
-    <!-- 全局异常配置 -->
-    <bean id="exceptionHandler" class="org.opencron.server.handler.ExceptionHandler" />
-
-
-</beans>

+ 0 - 36
opencron-server/src/main/resources/applicationContext-place.xml

@@ -1,36 +0,0 @@
-<beans xmlns="http://www.springframework.org/schema/beans"
-	   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	   xmlns:context="http://www.springframework.org/schema/context"
-	   xmlns:task="http://www.springframework.org/schema/task"
-	   xsi:schemaLocation="http://www.springframework.org/schema/beans
-           http://www.springframework.org/schema/beans/spring-beans.xsd
-           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
-           http://www.springframework.org/schema/task
-			http://www.springframework.org/schema/task/spring-task-4.2.xsd"
-	   default-lazy-init="true">
-
-	<description>Spring公共配置文件</description>
-
-	<!-- 定义受环境影响易变的变量 -->
-	<bean id="config" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
-		<property name="locations">
-			<list>
-				<value>classpath:*.properties</value>
-			</list>
-		</property>
-	</bean>
-
-	<bean id="propertyConfigurer" class="org.opencron.common.utils.PropertyPlaceholder">
-		<property name="properties" ref="config" />
-		<property name="ignoreResourceNotFound" value="true"/>
-	</bean>
-
-	<context:annotation-config />
-
-	<task:annotation-driven/>
-
-	<context:component-scan base-package="org.opencron.server.service,org.opencron.server.dao,org.opencron.server.job,org.opencron.server.websocket" scoped-proxy="targetClass" use-default-filters="true"/>
-
-	<bean class="org.opencron.server.job.OpencronTask" lazy-init="false"/>
-
-</beans>

+ 0 - 28
opencron-server/src/main/resources/applicationContext-websocket.xml

@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:websocket="http://www.springframework.org/schema/websocket"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
-        http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
-        http://www.springframework.org/schema/websocket
-        http://www.springframework.org/schema/websocket/spring-websocket.xsd">
-
-    <bean id="terminalHandler" class="org.opencron.server.websocket.TerminalHandler"/>
-    <bean id="webSocketHandShaker" class="org.opencron.server.websocket.TerminalHandShaker"/>
-
-    <websocket:handlers>
-        <websocket:mapping path="/terminal.ws" handler="terminalHandler" />
-        <websocket:handshake-interceptors>
-            <ref bean="webSocketHandShaker"/>
-        </websocket:handshake-interceptors>
-    </websocket:handlers>
-
-    <websocket:handlers>
-        <websocket:mapping path="/terminal.js" handler="terminalHandler" />
-        <websocket:handshake-interceptors>
-            <ref bean="webSocketHandShaker"/>
-        </websocket:handshake-interceptors>
-        <websocket:sockjs/>
-    </websocket:handlers>
-
-</beans>

+ 195 - 0
opencron-server/src/main/resources/opencron.xml

@@ -0,0 +1,195 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xmlns:mvc="http://www.springframework.org/schema/mvc"
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xmlns:aop="http://www.springframework.org/schema/aop"
+       xmlns:websocket="http://www.springframework.org/schema/websocket"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+			http://www.springframework.org/schema/beans/spring-beans.xsd
+			http://www.springframework.org/schema/context
+			http://www.springframework.org/schema/context/spring-context.xsd
+			http://www.springframework.org/schema/mvc
+			http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
+			http://www.springframework.org/schema/tx
+			http://www.springframework.org/schema/tx/spring-tx.xsd
+			http://www.springframework.org/schema/aop
+			http://www.springframework.org/schema/aop/spring-aop.xsd
+			http://www.springframework.org/schema/websocket
+			http://www.springframework.org/schema/websocket/spring-websocket.xsd" default-lazy-init="true">
+
+    <description>opencron server</description>
+
+    <bean id="config" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+        <property name="locations">
+            <list>
+                <value>classpath:*.properties</value>
+            </list>
+        </property>
+    </bean>
+
+    <bean id="propertyConfigurer" class="org.opencron.common.utils.PropertyPlaceholder">
+        <property name="properties" ref="config"/>
+        <property name="ignoreResourceNotFound" value="true"/>
+    </bean>
+
+    <context:annotation-config/>
+
+    <context:component-scan base-package="org.opencron" scoped-proxy="targetClass"/>
+
+
+    <!-- dataSource -->
+    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
+        <!-- 基本属性 url、user、password -->
+        <property name="driverClassName" value="${jdbc.driver}"/>
+        <property name="url" value="${jdbc.url}"/>
+        <property name="username" value="${jdbc.username}"/>
+        <property name="password" value="${jdbc.password}"/>
+
+        <!-- 配置初始化大小、最小、最大 -->
+        <property name="initialSize" value="3"/>
+        <property name="minIdle" value="2"/>
+        <property name="maxActive" value="20"/>
+
+        <!-- 配置获取连接等待超时的时间 -->
+        <property name="maxWait" value="60000"/>
+
+        <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 -->
+        <property name="timeBetweenEvictionRunsMillis" value="60000"/>
+
+        <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 -->
+        <property name="minEvictableIdleTimeMillis" value="300000"/>
+
+        <property name="validationQuery" value="SELECT 'x'"/>
+        <property name="testWhileIdle" value="true"/>
+        <property name="testOnBorrow" value="false"/>
+        <property name="testOnReturn" value="false"/>
+
+        <!-- 打开PSCache,并且指定每个连接上PSCache的大小 -->
+        <property name="poolPreparedStatements" value="true"/>
+        <property name="maxPoolPreparedStatementPerConnectionSize" value="20"/>
+
+        <!-- 配置监控统计拦截的filters,去掉后监控界面sql无法统计 -->
+        <property name="filters" value="stat"/>
+    </bean>
+
+    <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
+        <property name="dataSource" ref="dataSource"/>
+        <property name="namingStrategy">
+            <bean class="org.hibernate.cfg.DefaultNamingStrategy"/>
+        </property>
+        <property name="hibernateProperties">
+            <props>
+                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
+                <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
+                <prop key="hibernate.format_sql">${hibernate.format_sql}</prop>
+                <prop key="hibernate.current_session_context_class">${hibernate.current_session_context_class}</prop>
+                <prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
+                <prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory_class}</prop>
+                <prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}</prop>
+                <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
+                <prop key="jdbc.use_scrollable_resultset">${jdbc.use_scrollable_resultset}</prop>
+                <prop key="hibernate.c3p0.preferredTestQuery">select 1;</prop>
+                <prop key="hibernate.connectio.useUnicode">true</prop>
+                <prop key="hibernate.connection.characterEncoding">utf-8</prop>
+                <prop key="hibernate.autoReconnect">true</prop>
+                <prop key="hibernate.hbm2ddl.auto">update</prop>
+            </props>
+        </property>
+        <property name="packagesToScan" value="org.opencron.server.domain"/>
+    </bean>
+
+    <!-- 事务配置 -->
+    <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager">
+        <property name="sessionFactory">
+            <ref bean="sessionFactory"/>
+        </property>
+    </bean>
+
+    <!-- 使用annotation定义事务 -->
+    <tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true"/>
+    <aop:aspectj-autoproxy proxy-target-class="true"/>
+
+    <!-- dataSource end -->
+
+    <!-- MVC -->
+    <!-- 全局异常配置 -->
+    <bean id="exceptionHandler" class="org.opencron.server.handler.ExceptionHandler"/>
+
+    <!--防止 @ResponseBody 中文乱码 此配置必须放在 注解驱动 前面-->
+    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
+        <property name="messageConverters">
+            <list>
+                <ref bean="stringHttpMessageConverter"/>
+                <ref bean="jsonHttpMessageConverter"/>
+            </list>
+        </property>
+    </bean>
+
+    <!--字符串试图,解决ResponseBody 乱码-->
+    <bean id="stringHttpMessageConverter" class="org.springframework.http.converter.StringHttpMessageConverter">
+        <property name="supportedMediaTypes">
+            <list>
+                <value>text/plain;charset=UTF-8</value>
+            </list>
+        </property>
+    </bean>
+    <!--Json 视图-->
+    <bean id="jsonHttpMessageConverter"
+          class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
+
+    <mvc:annotation-driven/>
+    <mvc:resources mapping="/static/**" location="/static/"/>
+    <mvc:resources mapping="/favicon.ico" location="/favicon.ico"/>
+    <mvc:default-servlet-handler/>
+
+    <mvc:interceptors>
+        <mvc:interceptor>
+            <mvc:mapping path="/**"/>
+            <bean class="org.opencron.server.handler.SecurityHandlerInterceptor"/>
+        </mvc:interceptor>
+    </mvc:interceptors>
+
+    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+        <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
+        <property name="prefix" value="/WEB-INF/view/"/>
+        <property name="suffix" value=".jsp"/>
+    </bean>
+
+    <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
+        <!-- set the max upload size 100M -->
+        <property name="maxUploadSize">
+            <value>104857600</value>
+        </property>
+        <property name="maxInMemorySize">
+            <value>4096</value>
+        </property>
+        <property name="resolveLazily" value="true"/>
+    </bean>
+
+    <!-- MVC end -->
+
+    <!-- websocket -->
+    <bean id="terminalHandler" class="org.opencron.server.websocket.TerminalHandler"/>
+    <bean id="webSocketHandShaker" class="org.opencron.server.websocket.TerminalHandShaker"/>
+
+    <websocket:handlers>
+        <websocket:mapping path="/terminal.ws" handler="terminalHandler"/>
+        <websocket:handshake-interceptors>
+            <ref bean="webSocketHandShaker"/>
+        </websocket:handshake-interceptors>
+    </websocket:handlers>
+
+    <websocket:handlers>
+        <websocket:mapping path="/terminal.js" handler="terminalHandler"/>
+        <websocket:handshake-interceptors>
+            <ref bean="webSocketHandShaker"/>
+        </websocket:handshake-interceptors>
+        <websocket:sockjs/>
+    </websocket:handlers>
+    <!-- websocket end -->
+
+    <!--task-->
+    <bean class="org.opencron.server.job.OpencronTask" lazy-init="false"/>
+
+</beans>

+ 1 - 1
opencron-server/src/main/webapp/WEB-INF/web.xml

@@ -13,7 +13,7 @@
 
     <context-param>
         <param-name>contextConfigLocation</param-name>
-        <param-value>classpath*:applicationContext-*.xml</param-value>
+        <param-value>classpath*:opencron.xml</param-value>
     </context-param>
     <listener>
         <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>

+ 189 - 0
server.sh

@@ -0,0 +1,189 @@
+#!/bin/bash
+
+#echo color
+WHITE_COLOR="\E[1;37m";
+RED_COLOR="\E[1;31m";
+BLUE_COLOR='\E[1;34m';
+GREEN_COLOR="\E[1;32m";
+YELLOW_COLOR="\E[1;33m";
+RES="\E[0m";
+
+echo_r () {
+    # Color red: Error, Failed
+    [ $# -ne 1 ] && return 1
+    echo -e "[${GREEN_COLOR}opencron${RES}] ${RED_COLOR}$1${RES}"
+}
+
+echo_g () {
+    # Color green: Success
+    [ $# -ne 1 ] && return 1
+    echo -e "[${GREEN_COLOR}opencron${RES}] ${GREEN_COLOR}$1${RES}"
+}
+
+echo_y () {
+    # Color yellow: Warning
+    [ $# -ne 1 ] && return 1
+    echo -e "[${GREEN_COLOR}opencron${RES}] ${YELLOW_COLOR}$1${RES}"
+}
+
+echo_w () {
+    # Color yellow: White
+    [ $# -ne 1 ] && return 1
+    echo -e "[${GREEN_COLOR}opencron${RES}] ${WHITE_COLOR}$1${RES}"
+}
+
+echo -ne "${GREEN_COLOR}"
+cat<<EOT
+
+      --------------------------------------------
+    /                                              \\
+   /   ___  _ __   ___ _ __   ___ _ __ ___  _ __    \\
+  /   / _ \| '_ \ / _ \ '_ \ / __| '__/ _ \| '_ \\    \\
+ /   | (_) | |_) |  __/ | | | (__| | | (_) | | | |    \\
+ \\    \___/| .__/ \___|_| |_|\___|_|  \___/|_| |_|    /
+  \\        |_|                                       /
+   \\                                                /
+    \\       --opencron,Let's crontab easy!         /
+      --------------------------------------------
+
+EOT
+echo -ne "${RES}";
+
+# Make sure prerequisite environment variables are set
+if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
+  if $darwin; then
+    # Bugzilla 54390
+    if [ -x '/usr/libexec/java_home' ] ; then
+      export JAVA_HOME=`/usr/libexec/java_home`
+    # Bugzilla 37284 (reviewed).
+    elif [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" ]; then
+      export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home"
+    fi
+  else
+    JAVA_PATH=`which java 2>/dev/null`
+    if [ "x$JAVA_PATH" != "x" ]; then
+      JAVA_PATH=`dirname $JAVA_PATH 2>/dev/null`
+      JRE_HOME=`dirname $JAVA_PATH 2>/dev/null`
+    fi
+    if [ "x$JRE_HOME" = "x" ]; then
+      # XXX: Should we try other locations?
+      if [ -x /usr/bin/java ]; then
+        JRE_HOME=/usr
+      fi
+    fi
+  fi
+  if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then
+    echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined"
+    echo "At least one of these environment variable is needed to run this program"
+    exit 1
+  fi
+fi
+if [ -z "$JAVA_HOME" -a "$1" = "debug" ]; then
+  echo "JAVA_HOME should point to a JDK in order to run in debug mode."
+  exit 1
+fi
+if [ -z "$JRE_HOME" ]; then
+  JRE_HOME="$JAVA_HOME"
+fi
+
+# If we're running under jdb, we need a full jdk.
+if [ "$1" = "debug" ] ; then
+  if [ "$os400" = "true" ]; then
+    if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/javac ]; then
+      echo "The JAVA_HOME environment variable is not defined correctly"
+      echo "This environment variable is needed to run this program"
+      echo "NB: JAVA_HOME should point to a JDK not a JRE"
+      exit 1
+    fi
+  else
+    if [ ! -x "$JAVA_HOME"/bin/java -o ! -x "$JAVA_HOME"/bin/jdb -o ! -x "$JAVA_HOME"/bin/javac ]; then
+      echo "The JAVA_HOME environment variable is not defined correctly"
+      echo "This environment variable is needed to run this program"
+      echo "NB: JAVA_HOME should point to a JDK not a JRE"
+      exit 1
+    fi
+  fi
+fi
+
+# Don't override the endorsed dir if the user has set it previously
+if [ -z "$JAVA_ENDORSED_DIRS" ]; then
+  # Set the default -Djava.endorsed.dirs argument
+  JAVA_ENDORSED_DIRS="$OPENCRON_HOME"/endorsed
+fi
+
+# Set standard commands for invoking Java, if not already set.
+if [ -z "$RUNJAVA" ]; then
+  RUNJAVA="$JRE_HOME"/bin/java
+fi
+if [ "$os400" != "true" ]; then
+  if [ -z "$_RUNJDB" ]; then
+    _RUNJDB="$JAVA_HOME"/bin/jdb
+  fi
+fi
+
+#check java exists.
+$RUNJAVA >/dev/null 2>&1
+
+if [ $? -ne 1 ];then
+  echo_r "ERROR: java is not install,please install java first!"
+  exit 1;
+fi
+
+
+# OS specific support.  $var _must_ be set to either true or false.
+cygwin=false
+darwin=false
+os400=false
+case "`uname`" in
+CYGWIN*) cygwin=true;;
+Darwin*) darwin=true;;
+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
+
+# Get standard environment variables
+PRGDIR=`dirname "$PRG"`
+
+WORKDIR=`cd "$PRGDIR" >/dev/null; pwd`;
+
+APP_VERSION="1.1.0-RELEASE";
+
+APP_NAME=opencron-server-$APP_VERSION
+
+APP_PATH="$WORKDIR"/opencron-server/target/${APP_NAME}
+
+if [ ! -d $APP_PATH ];then
+   echo_r "[opencron] please build project first!"
+   exit 1;
+fi
+
+LIB_PATH="${APP_PATH}"/WEB-INF/lib
+
+# Add jars to classpath
+if [ ! -z "$CLASSPATH" ] ; then
+  CLASSPATH="$CLASSPATH":
+fi
+CLASSPATH="$CLASSPATH""${APP_PATH}"/WEB-INF/classes
+
+for jar in ${LIB_PATH}/*
+do
+  CLASSPATH="$CLASSPATH":"$jar"
+done
+
+#start JettyServer....
+echo_g "[opencron] server Starting...."
+eval "\"$RUNJAVA\"" \
+        -classpath "\"$CLASSPATH\"" \
+        org.opencron.server.bootstrap.Startup $1