SSM环境搭建(一)---pom.xml和jdbcConfig.properties

完整项目地址:https://gitee.com/wdhcode/ssmEnvironment.git

一、pom.xml版本锁定


    UTF-8
    1.8
    1.8
    5.0.2.RELEASE
    1.6.6
    1.2.12
    8.0.15
    3.4.5

二、pom.xml导入依赖

①spring及springmvc相关依赖

    
    
      org.aspectj
      aspectjweaver
      1.6.8
    

    
      org.springframework
      spring-aop
      ${spring.version}
    

    
      org.springframework
      spring-context
      ${spring.version}
    

    
      org.springframework
      spring-web
      ${spring.version}
    

    
      org.springframework
      spring-webmvc
      ${spring.version}
    

    
      org.springframework
      spring-test
      ${spring.version}
    

    
      org.springframework
      spring-tx
      ${spring.version}
    

    
      org.springframework
      spring-jdbc
      ${spring.version}
    
    
    
      org.springframework
      spring-aspects
      ${spring.version}
    

②mybatis相关依赖

    
    
      org.mybatis.generator
      mybatis-generator-core
      1.3.5
    
    
    
      org.mybatis
      mybatis
      ${mybatis.version}
    
    
    
      org.mybatis
      mybatis-spring
      1.3.1
    
    
    
      c3p0
      c3p0
      0.9.1
    
    
    
      mysql
      mysql-connector-java
      ${mysql.version}
    

③数据库连接支持

    
    
      c3p0
      c3p0
      0.9.1
    
    
    
      mysql
      mysql-connector-java
      ${mysql.version}
    

④Junit测试

    
    
      junit
      junit
      4.12
      compile
    

⑤json字符串转换

    
    
      com.fasterxml.jackson.core
      jackson-databind
      2.9.8
    

⑥jstl,servlet-api支持

    
    
      jstl
      jstl
      1.2
    

    
      javax.servlet
      javax.servlet-api
      3.0.1
      provided
    

    
      javax.servlet
      jsp-api
      2.0
      provided
    

⑦log日志支持

    
    
      log4j
      log4j
      ${log4j.version}
    

    
      org.slf4j
      slf4j-api
      ${slf4j.version}
    

    
      org.slf4j
      slf4j-log4j12
      ${slf4j.version}
    
    

⑧pageHelper分页

    
    
      com.github.pagehelper
      pagehelper
      5.0.0
    

三、pom.xml添加插件

①mybatis-generator自动生成代码插件

        
        
          org.mybatis.generator
          mybatis-generator-maven-plugin
          1.3.6
          
            ${basedir}/src/main/resources/generatorConfig.xml
            true
            true
          
           
          
            
              mysql
              mysql-connector-java
              ${mysql.version}
            
          
        

pom.xml完整代码




  4.0.0

  com.wdh
  ssmEnvironment
  1.0-SNAPSHOT
  war

  ssmEnvironment Maven Webapp
  
  http://www.example.com

  
    UTF-8
    1.8
    1.8
    5.0.2.RELEASE
    1.6.6
    1.2.12
    8.0.15
    3.4.5
  

  
    
    
      org.aspectj
      aspectjweaver
      1.6.8
    

    
      org.springframework
      spring-aop
      ${spring.version}
    

    
      org.springframework
      spring-context
      ${spring.version}
    

    
      org.springframework
      spring-web
      ${spring.version}
    

    
      org.springframework
      spring-webmvc
      ${spring.version}
    

    
      org.springframework
      spring-test
      ${spring.version}
    

    
      org.springframework
      spring-tx
      ${spring.version}
    

    
      org.springframework
      spring-jdbc
      ${spring.version}
    

    
    
      org.springframework
      spring-aspects
      ${spring.version}
    



    
    
      org.mybatis.generator
      mybatis-generator-core
      1.3.5
    
    
    
      org.mybatis
      mybatis
      ${mybatis.version}
    
    
    
      org.mybatis
      mybatis-spring
      1.3.1
    
    
    
      c3p0
      c3p0
      0.9.1
    
    
    
      mysql
      mysql-connector-java
      ${mysql.version}
    

    
    
      junit
      junit
      4.12
      compile
    

    
    
      com.fasterxml.jackson.core
      jackson-databind
      2.9.8
    


    
    
      log4j
      log4j
      ${log4j.version}
    

    
      org.slf4j
      slf4j-api
      ${slf4j.version}
    

    
      org.slf4j
      slf4j-log4j12
      ${slf4j.version}
    
    

    
    
      jstl
      jstl
      1.2
    

    
      javax.servlet
      javax.servlet-api
      3.0.1
      provided
    

    
      javax.servlet
      jsp-api
      2.0
      provided
    
    
    
		
			com.github.pagehelper
			pagehelper
			5.0.0
		


  

  
    ssmEnvironment
    
      
        
          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
        

        
        
          org.mybatis.generator
          mybatis-generator-maven-plugin
          1.3.6
          
            ${basedir}/src/main/resources/generatorConfig.xml
            true
            true
          
          
          
            
              mysql
              mysql-connector-java
              ${mysql.version}
            
          
        
      
    
  

jdbcConfig.properties完整代码

jdbc.driver=com.mysql.cj.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/ssm ? serverTimezone=Asia/Shanghai&characterEncoding=utf-8&useSSL=false
jdbc.username=root
jdbc.password=12344321

你可能感兴趣的:(SSM环境搭建)