trunk --------------------------------------------------------- 代码库
|- sql -------------------------------------------------------- 数据库建表语句以及初始化
|- src -------------------------------------------------------- 项目源码
|- main --------------------------------------------------- 主代码
|- java ----------------------------------------------- 代码
| |- com
| |- baidu -------------------------------------- 百度编辑器
| |- pengzu
| |— config --------------------------------- 系统配置
| |- controller ----------------------------- 控制层
| | |- manage ----------------------------- 后台控制层
| | |- view ------------------------------- 前台控制层
| |- dao ------------------------------------ 数据库dao 接口
| |- entity --------------------------------- 实体
| | |-result ------------------------------ 响应及分页
| | |- vo --------------------------------- 页面传输实体
| |- filter --------------------------------- 请求拦截器
| |- job ------------------------------------ quartz 定时执行类
| |- schedule ------------------------------- quartz 定时配置
| |- service -------------------------------- Service层接口
| | |- impl ------------------------------- Service 接口实现层
| |- shiro ---------------------------------- shiro realm 配置
| |- utils ---------------------------------- 工具类
| |- ServletInitializer --------------------- 外置Tomcat运行必须类
| |- CmsApplication ------------------------- 系统启动类
|- resources ------------------------------------------ 资源文件夹
|- mybatis ---------------------------------------- mybatis 配置以及Mapper文件
|- static ----------------------------------------- 系统静态资源文件夹
|- templates -------------------------------------- 系统模板页面文件夹
1. 修改项目里 trunk > src > main > resources 里的配置文件:application-xxx.yml和quartz-xxx.properties 为不同环境配置文件
application-xxx.yml:
spring:
mail: #Mailbox sending configuration host: smtp.xxxx.com #Mail server SMTP address username: [email protected] #Mail sender configuration password: xxxxx #Mail sender password properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
datasource:
name: test
url: jdbc:mysql://localhost:3306?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
username: root
password: xxxx #Database password
file:
root: E:filesystem #file storage location
email:
username: [email protected] #Sender’s email address
quartz-xxx.properties:
org.quartz.scheduler.instanceName = MyScheduler
org.quartz.threadPool.threadCount = 5
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.dataSource = myDSorg.quartz.dataSource.myDS.driver = com.mysql.jdbc.Driver
org.quartz.dataSource.myDS.URL = jdbc:mysql://localhost:3306/quartz?characterEncoding=utf-8&useSSL=false
org.quartz.dataSource.myDS.user = root
org.quartz.dataSource.myDS.password = xxxxx
org.quartz.dataSource.myDS.maxConnections = 5
2. 在工程下trunk目录里打开cmd命令窗口,输入:
mvn clean package -Pxxx -Dmaven.test.skip=true #xxx: Project deployment environment configuration file
3. 打包文件在 target下..名字为 cms-1.0.0.war
1. 上传war包到服务器;
2. 放在Tomcat的webapps目录下
3. 配置Tomcat的server.xml,加入
4. 加入 <Context path="" docBase="cms-1.0.0" reloadable="true"/> 到host节点下
5. 启动Tomcat
6. 前台访问地址: ip:port
7. 后台访问地址: ip:port/adminManager/login.html
8. 正常情况下访问是没有图片资源的,需配置Nginx反向代理静态资源