- 准备技能
开发语言:JAVA/J2EE
项目构建管理:Maven
持续集成方案:Jenkins
SOA服务: Dubbo、zookeeper、Restful
SSO单点登录:Redis、JWT、Restful
分布式缓存:Redis
分布式消息中间件:zookeeper+kafka
分布式文件:FastDFS
数据库连接池:Alibaba Druid
核心框架:Spring framework、Spring MVC、Apache Shiro、MyBatis
前端框架:Bootstrap + html5 + CSS3
- 创建maven基础项目,其中只需要配置pom.xml文件和打包的文件即可,代码如下:
4.0.0
com.sml.sz
ant-project
1.0.0
pom
ant-project
http://maven.apache.org
2015-2016
4.2.2.RELEASE
5.1.1.Final
3.2.8
1.2.2
1.2.3
1.0.11
2.6.9
2.0.4
2.4.2
5.15.1
1.4
3.2.1
1.7.7
3.3.2
2.4
1.9
1.3.1
1.9.1
2.2.3
1.1.40
1.4.7
17.0
5.5.1
1.4.7
3.9
2.3.20
1.6
2.2
UTF-8
true
5.1.30
junit
junit
4.11
test
javax.servlet
servlet-api
2.5
provided
javax.servlet.jsp
jsp-api
2.1
provided
com.sml.sz
ant-utils
${project.version}
com.sml.sz
ant-config
${project.version}
com.sml.sz
ant-framework
${project.version}
com.sml.sz
ant-core-gen
${project.version}
com.sml.sz
ant-core-member
${project.version}
com.sml.sz
ant-web-service
${project.version}
com.sml.sz
ant-web-admin
${project.version}
com.sml.sz
ant-member-facade
${project.version}
com.sml.sz
ant-member-service
${project.version}
org.apache.maven.plugins
maven-antrun-plugin
1.7
org.apache.maven.plugins
maven-compiler-plugin
2.3.2
1.5
**/*.keep
**/*.keep.*
*.bak
*.contrib
true
-Xlint:unchecked,deprecation,fallthrough,finally
true
${project.build.sourceEncoding}
org.apache.maven.plugins
maven-jar-plugin
2.3.1
test-jar
true
true
org.apache.maven.plugins
maven-release-plugin
2.1
org.apache.maven.plugins
maven-resources-plugin
2.4.3
**/*.keep
**/*.keep.*
*.bak
*.contrib
org.apache.maven.plugins
maven-site-plugin
2.1.1
${project.build.sourceEncoding}
${project.build.sourceEncoding}
org.apache.maven.plugins
maven-source-plugin
2.1.2
attach-sources
jar
test-jar
false
true
org.apache.maven.plugins
maven-war-plugin
2.4
org.apache.maven.plugins
maven-ear-plugin
2.9
5
org.apache.maven.plugins
maven-surefire-plugin
2.6
true
org.apache.maven.plugins
maven-surefire-report-plugin
2.6
both
com.google.code.maven-replacer-plugin
replacer
1.5.1
prepare-package
replace
org.kuali.maven.plugins
properties-maven-plugin
2.0.1
${basedir}/../project_${profile}.properties
prepare-package
read-project-properties
dev
true
dev
sit
environment.type
sit
sit
uat
environment.type
uat
uat
performance
environment.type
performance
performance
production
environment.type
production
production
ant-utils
ant-config
ant-framework
ant-core-gen
ant-core-member
ant-web-admin
ant-web-service
ant-member-facade
ant-member-service
ant平台的super工程,定义了整合ant项目群的基本信息,以及依赖项和插件信息、maven的自定义信息
- 创建打包脚本:测试、生成等
build_SIT-no
set MAVEN_OPTS= -Xms128 -Xmx256m
mvn clean package --define maven.test.skip=true --define environment.type=sit
build_UAT-no-test.bat
set MAVEN_OPTS= -Xms128 -Xmx256m
mvn clean package --define maven.test.skip=true --define environment.type=uat
build_PROD-no-test.bat
set MAVEN_OPTS= -Xms128 -Xmx256m
mvn clean package --define maven.test.skip=true --define environment.type=pro
- 创建打包的properties文件:
project_sit.properties
解释: 里面可以配置打包的信息,比如:ip、域名、包名等
-
代码结构如下: