From 9fbb219d391c99e4876cd1f86200b82533c212ac Mon Sep 17 00:00:00 2001 From: Calvin Date: Tue, 7 Oct 2014 14:29:22 +0800 Subject: [PATCH] update archetype --- .../META-INF/maven/archetype-metadata.xml | 1 + .../archetype-resources/bin/jetty.bat | 20 +- .../archetype-resources/bin/jetty.sh | 11 + .../archetype-resources/bin/package.bat | 14 +- .../archetype-resources/bin/package.sh | 9 + .../archetype-resources/bin/refresh-db.bat | 18 +- .../archetype-resources/bin/refresh-db.sh | 9 + .../archetype-resources/bin/smoke-test.bat | 20 +- .../archetype-resources/bin/smoke-test.sh | 11 + .../resources/archetype-resources/pom.xml | 77 +++---- .../main/resources/ehcache/ehcache-shiro.xml | 22 +- .../resources/sql/h2/schema-with-oracle.sql | 48 ++--- .../src/main/resources/sql/h2/schema.sql | 40 ++-- .../src/main/resources/sql/mysql/schema.sql | 40 ++-- .../src/main/webapp/WEB-INF/decorators.xml | 22 +- .../main/webapp/WEB-INF/layouts/footer.jsp | 10 +- .../main/webapp/WEB-INF/tags/pagination.tag | 96 ++++----- .../src/main/webapp/WEB-INF/tags/sort.tag | 24 +-- .../WEB-INF/views/account/adminUserList.jsp | 64 +++--- .../webapp/WEB-INF/views/account/register.jsp | 130 ++++++------ .../main/webapp/WEB-INF/views/api/list.jsp | 10 +- .../main/webapp/WEB-INF/views/error/404.jsp | 30 +-- .../webapp/WEB-INF/views/task/taskList.jsp | 82 +++---- .../src/main/webapp/WEB-INF/web.xml | 200 +++++++++--------- 24 files changed, 527 insertions(+), 481 deletions(-) create mode 100644 support/maven-archetype/src/main/resources/archetype-resources/bin/jetty.sh create mode 100644 support/maven-archetype/src/main/resources/archetype-resources/bin/package.sh create mode 100644 support/maven-archetype/src/main/resources/archetype-resources/bin/refresh-db.sh create mode 100644 support/maven-archetype/src/main/resources/archetype-resources/bin/smoke-test.sh diff --git a/support/maven-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/support/maven-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml index 3ea71ac0a..e9233fbc3 100644 --- a/support/maven-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml +++ b/support/maven-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml @@ -61,6 +61,7 @@ bin **/*.bat + **/*.sh diff --git a/support/maven-archetype/src/main/resources/archetype-resources/bin/jetty.bat b/support/maven-archetype/src/main/resources/archetype-resources/bin/jetty.bat index 3a5ad698c..306038fec 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/bin/jetty.bat +++ b/support/maven-archetype/src/main/resources/archetype-resources/bin/jetty.bat @@ -1,11 +1,11 @@ -@echo off -echo [INFO] Use maven jetty-plugin run the project. - -cd %~dp0 -cd .. - -set MAVEN_OPTS=%MAVEN_OPTS% -XX:MaxPermSize=128m -call mvn jetty:run -Djetty.port=8080 - -cd bin +@echo off +echo [INFO] Use maven jetty-plugin run the project. + +cd %~dp0 +cd .. + +set MAVEN_OPTS=%MAVEN_OPTS% -XX:MaxPermSize=128m +call mvn jetty:run -Djetty.port=8080 + +cd bin pause \ No newline at end of file diff --git a/support/maven-archetype/src/main/resources/archetype-resources/bin/jetty.sh b/support/maven-archetype/src/main/resources/archetype-resources/bin/jetty.sh new file mode 100644 index 000000000..4ef48fc6d --- /dev/null +++ b/support/maven-archetype/src/main/resources/archetype-resources/bin/jetty.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "[INFO] Use maven jetty-plugin run the project." + +cd .. + +set MAVEN_OPTS=%MAVEN_OPTS% -XX:MaxPermSize=128m + +mvn jetty:run -Djetty.port=8080 + +cd bin diff --git a/support/maven-archetype/src/main/resources/archetype-resources/bin/package.bat b/support/maven-archetype/src/main/resources/archetype-resources/bin/package.bat index 6640661ab..a9b5ddbae 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/bin/package.bat +++ b/support/maven-archetype/src/main/resources/archetype-resources/bin/package.bat @@ -1,8 +1,8 @@ -@echo off -echo [INFO] Package the war in target dir. - -cd %~dp0 -cd .. -call mvn clean package -Dmaven.test.skip=true -cd bin +@echo off +echo [INFO] Package the war in target dir. + +cd %~dp0 +cd .. +call mvn clean package -Dmaven.test.skip=true +cd bin pause \ No newline at end of file diff --git a/support/maven-archetype/src/main/resources/archetype-resources/bin/package.sh b/support/maven-archetype/src/main/resources/archetype-resources/bin/package.sh new file mode 100644 index 000000000..deec33752 --- /dev/null +++ b/support/maven-archetype/src/main/resources/archetype-resources/bin/package.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "[INFO] Package the war in target dir." + +cd .. + +mvn clean package -Dmaven.test.skip=true + +cd bin diff --git a/support/maven-archetype/src/main/resources/archetype-resources/bin/refresh-db.bat b/support/maven-archetype/src/main/resources/archetype-resources/bin/refresh-db.bat index 1cc6db507..6a63ae5de 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/bin/refresh-db.bat +++ b/support/maven-archetype/src/main/resources/archetype-resources/bin/refresh-db.bat @@ -1,10 +1,10 @@ -@echo off -echo [INFO] Re-create the schema and provision the sample data. - -cd %~dp0 -cd .. - -call mvn antrun:run -Prefresh-db - -cd bin +@echo off +echo [INFO] Re-create the schema and provision the sample data. + +cd %~dp0 +cd .. + +call mvn antrun:run -Prefresh-db + +cd bin pause \ No newline at end of file diff --git a/support/maven-archetype/src/main/resources/archetype-resources/bin/refresh-db.sh b/support/maven-archetype/src/main/resources/archetype-resources/bin/refresh-db.sh new file mode 100644 index 000000000..f8d578f9d --- /dev/null +++ b/support/maven-archetype/src/main/resources/archetype-resources/bin/refresh-db.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +echo "[INFO] Re-create the schema and provision the sample data." + +cd .. + +mvn antrun:run -Prefresh-db + +cd bin diff --git a/support/maven-archetype/src/main/resources/archetype-resources/bin/smoke-test.bat b/support/maven-archetype/src/main/resources/archetype-resources/bin/smoke-test.bat index 72ad12347..6b3ea76b8 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/bin/smoke-test.bat +++ b/support/maven-archetype/src/main/resources/archetype-resources/bin/smoke-test.bat @@ -1,11 +1,11 @@ -@echo off -echo [INFO] run smoking functional test. - -cd %~dp0 -cd .. - -set MAVEN_OPTS=%MAVEN_OPTS% -XX:MaxPermSize=128m -call mvn clean test -Pfunctional-test,run-smoke - -cd bin +@echo off +echo [INFO] run smoking functional test. + +cd %~dp0 +cd .. + +set MAVEN_OPTS=%MAVEN_OPTS% -XX:MaxPermSize=128m +call mvn clean test -Pfunctional-test,run-smoke + +cd bin pause \ No newline at end of file diff --git a/support/maven-archetype/src/main/resources/archetype-resources/bin/smoke-test.sh b/support/maven-archetype/src/main/resources/archetype-resources/bin/smoke-test.sh new file mode 100644 index 000000000..ac5ab7a2b --- /dev/null +++ b/support/maven-archetype/src/main/resources/archetype-resources/bin/smoke-test.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "[INFO] run smoking functional test." + +cd .. + +set MAVEN_OPTS=%MAVEN_OPTS% -XX:MaxPermSize=128m + +mvn clean test -Pfunctional-test,run-smoke + +cd bin diff --git a/support/maven-archetype/src/main/resources/archetype-resources/pom.xml b/support/maven-archetype/src/main/resources/archetype-resources/pom.xml index 069b08ede..71c1b4d0e 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/pom.xml +++ b/support/maven-archetype/src/main/resources/archetype-resources/pom.xml @@ -10,25 +10,25 @@ 4.2.3-GA - 4.0.2.RELEASE - 4.3.1.Final - 1.4.4.RELEASE - 7.0.52 + 4.0.5.RELEASE + 4.3.5.Final + 1.6.0.RELEASE + 7.0.53 2.4.2 - 1.2.2 + 1.2.3 5.0.3.Final - 2.3.1 + 2.4.0 1.7.4 - 1.7.6 - 1.1.1 - 3.2.1 - 16.0.1 + 1.7.7 + 1.1.2 + 3.3.2 + 17.0 4.11 - 1.5.0 + 1.6.1 1.9.5 - 2.40.0 - 7.6.14.v20131031 - 1.3.175 + 2.42.2 + 7.6.15.v20140411 + 1.3.176 UTF-8 @@ -38,10 +38,10 @@ com.h2database h2 ${h2.version} - @@ -49,17 +49,17 @@ 3.0.0 - @@ -154,6 +154,11 @@ shiro-ehcache ${shiro.version} + + commons-codec + commons-codec + 1.9 + @@ -315,12 +320,12 @@ - @@ -351,7 +356,7 @@ net.sf.ehcache ehcache-core - 2.6.8 + 2.6.9 diff --git a/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/ehcache/ehcache-shiro.xml b/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/ehcache/ehcache-shiro.xml index 09fc764ca..8748372f3 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/ehcache/ehcache-shiro.xml +++ b/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/ehcache/ehcache-shiro.xml @@ -1,15 +1,15 @@ #set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) - - - + + + \ No newline at end of file diff --git a/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/h2/schema-with-oracle.sql b/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/h2/schema-with-oracle.sql index 1eabdc107..f7561568e 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/h2/schema-with-oracle.sql +++ b/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/h2/schema-with-oracle.sql @@ -1,28 +1,28 @@ #set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) -drop table if exists ${tablePrefix}task; -drop table if exists ${tablePrefix}user; - -create table ${tablePrefix}task ( - id bigint, - title varchar(128) not null, - description varchar(255), - user_id bigint not null, - primary key (id) -); - -create table ${tablePrefix}user ( - id bigint, - login_name varchar(64) not null unique, - name varchar(64) not null, - password varchar(255) not null, - salt varchar(64) not null, - roles varchar(255) not null, - register_date timestamp not null, - primary key (id) -); - - -create sequence ${tablePrefix}seq_task start with 100 increment by 20; +drop table if exists ${tablePrefix}task; +drop table if exists ${tablePrefix}user; + +create table ${tablePrefix}task ( + id bigint, + title varchar(128) not null, + description varchar(255), + user_id bigint not null, + primary key (id) +); + +create table ${tablePrefix}user ( + id bigint, + login_name varchar(64) not null unique, + name varchar(64) not null, + password varchar(255) not null, + salt varchar(64) not null, + roles varchar(255) not null, + register_date timestamp not null, + primary key (id) +); + + +create sequence ${tablePrefix}seq_task start with 100 increment by 20; create sequence ${tablePrefix}seq_user start with 100 increment by 20; \ No newline at end of file diff --git a/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/h2/schema.sql b/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/h2/schema.sql index 8709220b9..b00be8fdc 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/h2/schema.sql +++ b/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/h2/schema.sql @@ -1,24 +1,24 @@ #set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) -drop table if exists ${tablePrefix}task; -drop table if exists ${tablePrefix}user; - -create table ${tablePrefix}task ( - id bigint generated by default as identity, - title varchar(128) not null, - description varchar(255), - user_id bigint not null, - primary key (id) -); - -create table ${tablePrefix}user ( - id bigint generated by default as identity, - login_name varchar(64) not null unique, - name varchar(64) not null, - password varchar(255) not null, - salt varchar(64) not null, - roles varchar(255) not null, - register_date timestamp not null, - primary key (id) +drop table if exists ${tablePrefix}task; +drop table if exists ${tablePrefix}user; + +create table ${tablePrefix}task ( + id bigint generated by default as identity, + title varchar(128) not null, + description varchar(255), + user_id bigint not null, + primary key (id) +); + +create table ${tablePrefix}user ( + id bigint generated by default as identity, + login_name varchar(64) not null unique, + name varchar(64) not null, + password varchar(255) not null, + salt varchar(64) not null, + roles varchar(255) not null, + register_date timestamp not null, + primary key (id) ); \ No newline at end of file diff --git a/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/mysql/schema.sql b/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/mysql/schema.sql index 393ae4955..a7e8faec9 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/mysql/schema.sql +++ b/support/maven-archetype/src/main/resources/archetype-resources/src/main/resources/sql/mysql/schema.sql @@ -1,24 +1,24 @@ #set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) -drop table if exists ${tablePrefix}task; -drop table if exists ${tablePrefix}user; - -create table ${tablePrefix}task ( - id bigint auto_increment, - title varchar(128) not null, - description varchar(255), - user_id bigint not null, - primary key (id) -) engine=InnoDB; - -create table ${tablePrefix}user ( - id bigint auto_increment, - login_name varchar(64) not null unique, - name varchar(64) not null, - password varchar(255) not null, - salt varchar(64) not null, - roles varchar(255) not null, - register_date timestamp not null default 0, - primary key (id) +drop table if exists ${tablePrefix}task; +drop table if exists ${tablePrefix}user; + +create table ${tablePrefix}task ( + id bigint auto_increment, + title varchar(128) not null, + description varchar(255), + user_id bigint not null, + primary key (id) +) engine=InnoDB; + +create table ${tablePrefix}user ( + id bigint auto_increment, + login_name varchar(64) not null unique, + name varchar(64) not null, + password varchar(255) not null, + salt varchar(64) not null, + roles varchar(255) not null, + register_date timestamp not null default 0, + primary key (id) ) engine=InnoDB; \ No newline at end of file diff --git a/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/decorators.xml b/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/decorators.xml index 670cfc86b..a53efd082 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/decorators.xml +++ b/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/decorators.xml @@ -1,14 +1,14 @@ #set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) - - - - /static/* - /api/* - - - - /* - - + + + + /static/* + /api/* + + + + /* + + diff --git a/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/layouts/footer.jsp b/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/layouts/footer.jsp index 6ceee6388..9d29fa989 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/layouts/footer.jsp +++ b/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/layouts/footer.jsp @@ -1,8 +1,8 @@ #set( $symbol_pound = '#' ) #set( $symbol_dollar = '$' ) #set( $symbol_escape = '\' ) -<%@ page language="java" pageEncoding="UTF-8" %> - - +<%@ page language="java" pageEncoding="UTF-8" %> + + diff --git a/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/tags/pagination.tag b/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/tags/pagination.tag index 568e74f4f..4e3ad4eb9 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/tags/pagination.tag +++ b/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/tags/pagination.tag @@ -1,48 +1,48 @@ -<%@tag pageEncoding="UTF-8"%> -<%@ attribute name="page" type="org.springframework.data.domain.Page" required="true"%> -<%@ attribute name="paginationSize" type="java.lang.Integer" required="true"%> - -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - -<% -int current = page.getNumber() + 1; -int begin = Math.max(1, current - paginationSize/2); -int end = Math.min(begin + (paginationSize - 1), page.getTotalPages()); - -request.setAttribute("current", current); -request.setAttribute("begin", begin); -request.setAttribute("end", end); -%> - - - +<%@tag pageEncoding="UTF-8"%> +<%@ attribute name="page" type="org.springframework.data.domain.Page" required="true"%> +<%@ attribute name="paginationSize" type="java.lang.Integer" required="true"%> + +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> + +<% +int current = page.getNumber() + 1; +int begin = Math.max(1, current - paginationSize/2); +int end = Math.min(begin + (paginationSize - 1), page.getTotalPages()); + +request.setAttribute("current", current); +request.setAttribute("begin", begin); +request.setAttribute("end", end); +%> + + + diff --git a/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/tags/sort.tag b/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/tags/sort.tag index 3e0d276b1..5f2838dbb 100644 --- a/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/tags/sort.tag +++ b/support/maven-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/tags/sort.tag @@ -1,13 +1,13 @@ -<%@tag pageEncoding="UTF-8"%> - -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> -