大家好,我是不写代码不会凸的小刘!
下面是我快速搭建SSM框架的整个过程以及自己在整个过程中遇到的问题的描述,当然其中还有许多问题没有搞清楚,还请大家批评指正!此次的学习过程来自b站的一位up主。


设置为自己的仓库地址也可以不进行更改,使用idea自带的maven

①在main下创建java文件夹并标为root目录
②在main下创建resources文件并标为resources目录
③在main下创建test文件并标为test目录
④在java文件夹下创建com.aaa.ssm包
⑤在com.aaa.ssm包下创建controller、service、
⑥在resources下创建config文件
⑦在config文件下创建mybatis和spring文件
⑧在webapp下创建statics文件夹(用于存放静态资源css,js,images)和views文件夹(用于存放页面jsp)

3、在pom文件中添加依赖(在此要说明,在后面的调试运行中,发现依赖之间存在冲突问题,此外还用到了别的依赖,因此与视频中的依赖略有不同)
pom.xml文件为:
- "1.0" encoding="UTF-8"?>
-
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0modelVersion>
-
- <groupId>com.aaagroupId>
- <artifactId>ssmartifactId>
- <version>1.0-SNAPSHOTversion>
- <packaging>warpackaging>
-
- <name>ssm Maven Webappname>
-
- <url>http://www.example.comurl>
-
- <properties>
- <project.build.sourceEncoding>UTF-8project.build.sourceEncoding>
- <maven.compiler.source>1.7maven.compiler.source>
- <maven.compiler.target>1.7maven.compiler.target>
- properties>
-
- <dependencies>
-
- <dependency>
- <groupId>junitgroupId>
- <artifactId>junitartifactId>
- <version>4.11version>
- <scope>testscope>
- dependency>
-
-
- <dependency>
- <groupId>log4jgroupId>
- <artifactId>log4jartifactId>
- <version>1.2.17version>
- dependency>
-
- <dependency>
- <groupId>javax.servletgroupId>
- <artifactId>servlet-apiartifactId>
- <version>2.5version>
- dependency>
- <dependency>
- <groupId>javax.servlet.jspgroupId>
- <artifactId>jsp-apiartifactId>
- <version>2.2version>
- dependency>
- <dependency>
- <groupId>jstlgroupId>
- <artifactId>jstlartifactId>
- <version>1.2version>
- dependency>
-
-
- <dependency>
- <groupId>org.springframeworkgroupId>
- <artifactId>spring-webmvcartifactId>
- <version>5.2.4.RELEASEversion>
- dependency>
- <dependency>
- <groupId>org.springframeworkgroupId>
- <artifactId>spring-ormartifactId>
- <version>4.3.3.RELEASEversion>
- dependency>
-
-
- <dependency>
- <groupId>org.springframeworkgroupId>
- <artifactId>spring-aspectsartifactId>
- <version>4.3.12.RELEASEversion>
- dependency>
-
- <dependency>
- <groupId>org.springframeworkgroupId>
- <artifactId>spring-aopartifactId>
- <version>4.3.12.RELEASEversion>
- dependency>
-
-
-
- <dependency>
- <groupId>org.mybatisgroupId>
- <artifactId>mybatisartifactId>
- <version>3.4.5version>
- dependency>
- <dependency>
- <groupId>org.mybatisgroupId>
- <artifactId>mybatis-springartifactId>
- <version>2.0.4version>
- dependency>
-
-
- <dependency>
- <groupId>mysqlgroupId>
- <artifactId>mysql-connector-javaartifactId>
- <version>8.0.19version>
- dependency>
- <dependency>
- <groupId>com.alibabagroupId>
- <artifactId>druidartifactId>
- <version>1.1.6version>
- dependency>
-
-
- dependencies>
-
- <build>
- <finalName>ssmfinalName>
-
- <plugins>
- <plugin>
- <groupId>org.mybatis.generatorgroupId>
- <artifactId>mybatis-generator-maven-pluginartifactId>
- <version>1.3.2version>
- <configuration>
- <configurationFile>src/main/resources/generatorConfig.xmlconfigurationFile>
-
- <verbose>trueverbose>
- <overwrite>trueoverwrite>
- configuration>
- plugin>
- plugins>
-
- build>
- project>
后续在同一个专栏的下篇文章中继续描述!
万物明朗,可可爱爱!
愿你天天有个好心情,热爱每一段代码!
ଘ(੭ˊᵕˋ)੭ (开心) ଘ(੭ˊᵕˋ)੭ (开心)ଘ(੭ˊᵕˋ)੭ (开心)ଘ(੭ˊᵕˋ)੭ (开心)ଘ(੭ˊᵕˋ)੭ (开心)
------不写代码不会凸的小刘