IntelliJ IDEA SSM 框架搭建

SSM框架集由Spring+Mybatis两个开源框架组成,Spring mvc是Spring中的内容。常用于web项目的框架

项目准备:Intellj idea + Maven + JDK1.8 +  Tomcat8  + Apache http   + MySql

1.创建Maven web项目


maven home directory选择自己的maven安装目录


选择项目路径 点击finish


创建好的目录 (需自己添加 Java  Resource源目录,webapp相关也须添加)

2.引入spring相关依赖  (dependencies,plugin相关复制即可)

  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0

org.example

SSMDemo

1.0-SNAPSHOT

war

SSMDemo Maven Webapp

  http://www.example.com

UTF-8

1.7

1.7

4.3.2.RELEASE

3.4.2

1.3.1

1.0.9

5.1.39

2.8.2

 


     

org.springframework

spring-context

${spring.version}

org.springframework

spring-beans

${spring.version}

org.springframework

spring-webmvc

${spring.version}

org.springframework

spring-jdbc

${spring.version}

org.springframework

spring-aspects

${spring.version}

org.springframework

spring-jms

${spring.version}

org.springframework

spring-context-support

${spring.version}


     

org.mybatis

mybatis

${mybatis.version}

org.mybatis

mybatis-spring

${mybatis.spring.version}

     

com.alibaba

druid

${druid.version}


     

mysql

mysql-connector-java

${mysql.version}

com.fasterxml.jackson.core

jackson-core

${jackson.version}

com.fasterxml.jackson.core

jackson-annotations

${jackson.version}

com.fasterxml.jackson.core

jackson-databind

${jackson.version}

junit

junit

4.11

test


   

org.springframework

spring-context

org.springframework

spring-beans

org.springframework

spring-webmvc

org.springframework

spring-jdbc

org.springframework

spring-aspects

org.springframework

spring-jms

org.springframework

spring-context-support


   

org.mybatis

mybatis

org.mybatis

mybatis-spring

   

com.alibaba

druid

 

mysql

mysql-connector-java

com.fasterxml.jackson.core

jackson-core

com.fasterxml.jackson.core

jackson-annotations

com.fasterxml.jackson.core

jackson-databind

ssm

     

       

org.apache.maven.plugins

maven-compiler-plugin

3.2

1.8

1.8

UTF-8

maven-clean-plugin

3.1.0

 

maven-resources-plugin

3.0.2

maven-compiler-plugin

3.8.0

maven-surefire-plugin

2.22.1

maven-war-plugin

3.2.2

maven-install-plugin

2.5.2

maven-deploy-plugin

2.8.2

     

src/main/java

**/*.xml

false

src/main/resources

**/*.properties

**/*.xml

false

3.配置spring相关配置文件 目录如下

4.配置applicationContext.xml(包括数据库连接信息,mybatis配置信息,事务)

5.配置spring-mvc.xml配置文件(注解扫描,包扫描,视图解析器)

6.配置mybatis.xml信息(扫描model下面的类将其第一个字母小写变成其别名)

7.配置web.xml信息(前端拦截器,注入spring核心配置文件applicationContext.xml)

8.配置tomcat,Apache,host文件(前端配置host配置给本地添加二级域名)

9.启动tomcat访问(附有controller代码截图以及目录信息)


你可能感兴趣的:(IntelliJ IDEA SSM 框架搭建)