基于SSM的单点登陆01

使用SSM的Maven聚合项目

建立父项目market的pom文件

  1 <?xml version="1.0" encoding="UTF-8"?>
  2 <project xmlns="http://maven.apache.org/POM/4.0.0"
  3          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  5     <modelVersion>4.0.0</modelVersion>
  6 
  7     <!--项目坐标-->
  8     <groupId>io.guangsoft</groupId>
  9     <artifactId>market</artifactId>
 10     <version>1.0</version>
 11     <packaging>pom</packaging>
 12 
 13     <!-- 项目创立信息 -->
 14     <inceptionYear>20180616</inceptionYear>
 15     <organization>
 16         <url>www.cnblogs.com/guanghe</url>
 17         <name>guanghe</name>
 18     </organization>
 19 
 20     <!--模块(有时称作子项目)被构建成项目的一部分。列出的每个模块元素是指向该模块的目录的相对路径-->
 21     <modules>
 22         <module>market-utils</module>
 23         <module>market-dao</module>
 24         <module>market-service</module>
 25         <module>market-controller</module>
 26     </modules>
 27 
 28     <!--定义依赖的jar包版本,以值替代名称,Properties可以在整个POM中使用,也可以作为触发条件-->
 29     <properties>
 30         <!-- java源文件编码格式 -->
 31         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 32         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 33         <!-- MariaDB驱动 -->
 34         <mariadb-java-client.version>2.2.5</mariadb-java-client.version>
 35         <!-- 数据库连接池 -->
 36         <druid.version>1.1.10</druid.version>
 37         <!-- Mybatis -->
 38         <mybatis.version>3.4.6</mybatis.version>
 39         <mybatis.spring.version>1.3.2</mybatis.spring.version>
 40         <pagehelper.version>5.1.4</pagehelper.version>
 41         <mybatis.paginator.version>1.2.17</mybatis.paginator.version>
 42         <mybatis-generator-core.version>1.3.6</mybatis-generator-core.version>
 43         <!-- Spring -->
 44         <spring.version>5.0.7.RELEASE</spring.version>
 45         <!-- Apache工具组件 -->
 46         <commons-lang3.version>3.7</commons-lang3.version>
 47         <commons-beanutils.version>1.9.3</commons-beanutils.version>
 48         <commons-io.version>2.6</commons-io.version>
 49         <commons-net.version>3.6</commons-net.version>
 50         <commons-fileupload.version>1.3.3</commons-fileupload.version>
 51         <!-- 时间操作组件 -->
 52         <joda-time.version>2.10</joda-time.version>
 53         <!-- Json处理工具包 -->
 54         <jackson-databind.version>2.9.6</jackson-databind.version>
 55         <fastjson.version>1.2.47</fastjson.version>
 56         <!-- httpclient -->
 57         <httpclient.version>4.5.5</httpclient.version>
 58         <!-- Redis客户端 -->
 59         <jedis.version>2.9.0</jedis.version>
 60         <!-- solr客户端 -->
 61         <solrj.version>7.3.1</solrj.version>
 62         <!-- 日志处理 -->
 63         <slf4j-log4j12>1.7.25</slf4j-log4j12>
 64         <!-- 单元测试 -->
 65         <junit.version>4.12</junit.version>
 66         <!-- Servet jsp api -->
 67         <javax.servlet-api.version>3.1.0</javax.servlet-api.version>
 68         <jsp-api.version>2.0</jsp-api.version>
 69     </properties>
 70 
 71     <!-- 继承自该项目的所有子项目的默认依赖信息。这部分的依赖信息不会被立即解析(不会真正向项目中注入jar包),
 72         而是当子项目声明一个依赖(必须描述相同group ID和 artifact ID信息),则默认使用这里的依赖信息。-->
 73     <dependencyManagement>
 74         <dependencies>
 75             <!-- MariaDB驱动 -->
 76             <dependency>
 77                 <groupId>org.mariadb.jdbc</groupId>
 78                 <artifactId>mariadb-java-client</artifactId>
 79                 <version>${mariadb-java-client.version}</version>
 80             </dependency>
 81             <!-- 数据库连接池 -->
 82             <dependency>
 83                 <groupId>com.alibaba</groupId>
 84                 <artifactId>druid</artifactId>
 85                 <version>${druid.version}</version>
 86             </dependency>
 87             <!-- Mybatis -->
 88             <dependency>
 89                 <groupId>org.mybatis</groupId>
 90                 <artifactId>mybatis</artifactId>
 91                 <version>${mybatis.version}</version>
 92             </dependency>
 93             <dependency>
 94                 <groupId>org.mybatis</groupId>
 95                 <artifactId>mybatis-spring</artifactId>
 96                 <version>${mybatis.spring.version}</version>
 97             </dependency>
 98             <dependency>
 99                 <groupId>com.github.pagehelper</groupId>
100                 <artifactId>pagehelper</artifactId>
101                 <version>${pagehelper.version}</version>
102             </dependency>
103             <dependency>
104                 <groupId>com.github.miemiedev</groupId>
105                 <artifactId>mybatis-paginator</artifactId>
106                 <version>${mybatis.paginator.version}</version>
107             </dependency>
108             <dependency>
109                 <groupId>org.mybatis.generator</groupId>
110                 <artifactId>mybatis-generator-core</artifactId>
111                 <version>${mybatis-generator-core.version}</version>
112             </dependency>
113             <!-- Spring -->
114             <dependency>
115                 <groupId>org.springframework</groupId>
116                 <artifactId>spring-context</artifactId>
117                 <version>${spring.version}</version>
118             </dependency>
119             <dependency>
120                 <groupId>org.springframework</groupId>
121                 <artifactId>spring-beans</artifactId>
122                 <version>${spring.version}</version>
123             </dependency>
124             <dependency>
125                 <groupId>org.springframework</groupId>
126                 <artifactId>spring-webmvc</artifactId>
127                 <version>${spring.version}</version>
128             </dependency>
129             <dependency>
130                 <groupId>org.springframework</groupId>
131                 <artifactId>spring-jdbc</artifactId>
132                 <version>${spring.version}</version>
133             </dependency>
134             <dependency>
135                 <groupId>org.springframework</groupId>
136                 <artifactId>spring-aspects</artifactId>
137                 <version>${spring.version}</version>
138             </dependency>
139             <!-- Apache工具组件 -->
140             <dependency>
141                 <groupId>org.apache.commons</groupId>
142                 <artifactId>commons-lang3</artifactId>
143                 <version>${commons-lang3.version}</version>
144             </dependency>
145             <dependency>
146                 <groupId>commons-beanutils</groupId>
147                 <artifactId>commons-beanutils</artifactId>
148                 <version>${commons-beanutils.version}</version>
149             </dependency>
150             <dependency>
151                 <groupId>commons-io</groupId>
152                 <artifactId>commons-io</artifactId>
153                 <version>${commons-io.version}</version>
154             </dependency>
155             <dependency>
156                 <groupId>commons-net</groupId>
157                 <artifactId>commons-net</artifactId>
158                 <version>${commons-net.version}</version>
159             </dependency>
160             <dependency>
161                 <groupId>commons-fileupload</groupId>
162                 <artifactId>commons-fileupload</artifactId>
163                 <version>${commons-fileupload.version}</version>
164             </dependency>
165             <!-- 时间操作组件 -->
166             <dependency>
167                 <groupId>joda-time</groupId>
168                 <artifactId>joda-time</artifactId>
169                 <version>${joda-time.version}</version>
170             </dependency>
171             <!-- Json处理工具包 -->
172             <dependency>
173                 <groupId>com.fasterxml.jackson.core</groupId>
174                 <artifactId>jackson-databind</artifactId>
175                 <version>${jackson-databind.version}</version>
176             </dependency>
177             <dependency>
178                 <groupId>com.alibaba</groupId>
179                 <artifactId>fastjson</artifactId>
180                 <version>${fastjson.version}</version>
181             </dependency>
182             <!-- httpclient -->
183             <dependency>
184                 <groupId>org.apache.httpcomponents</groupId>
185                 <artifactId>httpclient</artifactId>
186                 <version>${httpclient.version}</version>
187             </dependency>
188             <!-- Redis客户端 -->
189             <dependency>
190                 <groupId>redis.clients</groupId>
191                 <artifactId>jedis</artifactId>
192                 <version>${jedis.version}</version>
193             </dependency>
194             <!-- solr客户端 -->
195             <dependency>
196                 <groupId>org.apache.solr</groupId>
197                 <artifactId>solr-solrj</artifactId>
198                 <version>${solrj.version}</version>
199             </dependency>
200             <!-- 日志处理 -->
201             <dependency>
202                 <groupId>org.slf4j</groupId>
203                 <artifactId>slf4j-log4j12</artifactId>
204                 <version>${slf4j-log4j12.version}</version>
205             </dependency>
206             <!-- 单元测试 -->
207             <dependency>
208                 <groupId>junit</groupId>
209                 <artifactId>junit</artifactId>
210                 <version>${junit.version}</version>
211                 <scope>test</scope>
212             </dependency>
213             <!-- Servet jsp api -->
214             <dependency>
215                 <groupId>javax.servlet</groupId>
216                 <artifactId>javax.servlet-api</artifactId>
217                 <version>${javax.servlet-api.version}</version>
218                 <scope>provided</scope>
219             </dependency>
220             <dependency>
221                 <groupId>javax.servlet</groupId>
222                 <artifactId>jsp-api</artifactId>
223                 <version>${jsp-api.version}</version>
224                 <scope>provided</scope>
225             </dependency>
226         </dependencies>
227     </dependencyManagement>
228 
229     <!--构建项目需要的信息-->
230     <build>
231         <!--子项目可以引用的默认插件信息。该插件配置项直到被引用时才会被解析或绑定到生命周期。给定插件的任何本地配置都会覆盖这里的配置-->
232         <pluginManagement>
233             <plugins>
234                 <!-- java编译插件 -->
235                 <plugin>
236                     <groupId>org.apache.maven.plugins</groupId>
237                     <artifactId>maven-compiler-plugin</artifactId>
238                     <version>3.7.0</version>
239                     <configuration>
240                         <source>1.8</source>
241                         <target>1.8</target>
242                         <encoding>UTF-8</encoding>
243                     </configuration>
244                 </plugin>
245                 <!-- 资源文件拷贝插件 -->
246                 <plugin>
247                     <groupId>org.apache.maven.plugins</groupId>
248                     <artifactId>maven-resources-plugin</artifactId>
249                     <version>3.1.0</version>
250                 </plugin>
251                 <!-- mvn mybatis-generator:generate -->
252                 <plugin>
253                     <groupId>org.mybatis.generator</groupId>
254                     <artifactId>mybatis-generator-maven-plugin</artifactId>
255                     <version>1.3.6</version>
256                 </plugin>
257             </plugins>
258         </pluginManagement>
259     </build>
260 
261 </project>

sql

 1 -- ----------------------------
 2 -- Table structure for tb_user
 3 -- ----------------------------
 4 DROP TABLE IF EXISTS `tb_user`;
 5 CREATE TABLE `tb_user` (
 6   `id` bigint(20) NOT NULL AUTO_INCREMENT,
 7   `username` varchar(50) NOT NULL COMMENT '用户名',
 8   `password` varchar(32) NOT NULL COMMENT '密码,加密存储',
 9   `phone` varchar(20) DEFAULT NULL COMMENT '注册手机号',
10   `email` varchar(50) DEFAULT NULL COMMENT '注册邮箱',
11   `created` datetime NOT NULL,
12   `updated` datetime NOT NULL,
13   PRIMARY KEY (`id`),
14   UNIQUE KEY `username` (`username`) USING BTREE,
15   UNIQUE KEY `phone` (`phone`) USING BTREE,
16   UNIQUE KEY `email` (`email`) USING BTREE
17 ) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COMMENT='用户表';
18 
19 -- ----------------------------
20 -- Records of tb_user
21 -- ----------------------------
22 INSERT INTO `tb_user` VALUES ('7', 'zhangsan', 'e10adc3949ba59abbe56e057f20f883e', '13488888888', 'aa@a', '2015-04-06 17:03:55', '2015-04-06 17:03:55');
原文地址:https://www.cnblogs.com/guanghe/p/9195915.html