SSM整合

文件配置

pom.xml配置


   <dependencies>
       
       <dependency>
           <groupId>junitgroupId>
           <artifactId>junitartifactId>
           <version>4.12version>
       dependency>
       
       <dependency>
           <groupId>mysqlgroupId>
           <artifactId>mysql-connector-javaartifactId>
           <version>5.1.47version>
       dependency>
       
       <dependency>
           <groupId>com.alibabagroupId>
           <artifactId>druidartifactId>
           <version>1.2.4version>
       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>javax.servletgroupId>
           <artifactId>jstlartifactId>
           <version>1.2version>
       dependency>
       
       <dependency>
           <groupId>org.mybatisgroupId>
           <artifactId>mybatisartifactId>
           <version>3.5.2version>
       dependency>
       
       <dependency>
           <groupId>org.mybatisgroupId>
           <artifactId>mybatis-springartifactId>
           <version>2.0.2version>
       dependency>
       
       <dependency>
           <groupId>org.springframeworkgroupId>
           <artifactId>spring-webmvcartifactId>
           <version>5.1.10.RELEASEversion>
       dependency>
       <dependency>
           <groupId>org.springframeworkgroupId>
           <artifactId>spring-jdbcartifactId>
           <version>5.1.10.RELEASEversion>
       dependency>
       
       <dependency>
           <groupId>org.aspectjgroupId>
           <artifactId>aspectjweaverartifactId>
           <version>1.9.4version>
       dependency>
	
       <dependency>
           <groupId>org.projectlombokgroupId>
           <artifactId>lombokartifactId>
           <version>1.18.16version>
       dependency>
   dependencies>

    <build>
        <resources>
            <resource>
                <directory>src/main/javadirectory>
                <includes>
                    <include>**/*.propertiesinclude>
                    <include>**/*.xmlinclude>
                includes>
                <filtering>truefiltering>
            resource>
        resources>
    build>

Spring核心配置文件

applicationContext.xml


<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd">
beans>

Mybatis核心配置文件

mybatis-config.xml



<configuration>

    

    <typeAliases>
    
        <package name="com.peppa.pojo"/>
    typeAliases>

configuration>

database.properties

jdbc.driver=com.mysql.jdbc.Driver
#如果使用的是MySQL8.0+,增加一个时区的配置;&serverTimezone=Asia/Shanghai
jdbc.url=jdbc:mysql://localhost:3306/ssmbuild?useSSL=true&useUnicode=true&characterEncoding=utf8
jdbc.username=root
jdbc.password=123456

Spring配置文件

你可能感兴趣的:(#,框架,maven,mybatis,spring,springmvc)