• 基于Maven的SSM配置


    1.创建web骨架

    2.导包

    这个pom.xml是博主整和了学习ssm阶段中常用jar包的依赖,整合时可按需配置,释放你查找的双手

    <?xml version="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.0</modelVersion>
      <!-- author:dingziming ❤ wxr -->
      <groupId>ssm</groupId>
      <artifactId>SSM</artifactId>
      <version>1.0-SNAPSHOT</version>
      <url>http://maven.apache.org</url>
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        
        
        <!-- spring版本号 -->
        <spring.version>5.2.3.RELEASE</spring.version>
    
    
        <!-- mybatis版本号 -->
        <mybatis.version>3.4.1</mybatis.version>
    
    
        <!-- mysql驱动版本号 -->
        <mysql-driver.version>8.0.22</mysql-driver.version>
    
    
        <!-- log4j日志包版本号 -->
        <log4j.version>1.2.17</log4j.version>
    
    
      </properties>
      
      <dependencies>
        <!-- 添加jstl依赖 含stander -->
        <dependency>
          <groupId>jstl</groupId>
          <artifactId>jstl</artifactId>
          <version>1.2</version>
        </dependency>
        <!-- 添加junit4依赖 -->
        <dependency>
          <groupId>junit</groupId>
          <artifactId>junit</artifactId>
          <version>4.11</version>
          <!-- 指定范围,在测试时才会加载 -->
          <scope>test</scope>
        </dependency>
    
    
        <!-- 添加spring核心依赖 -->
        <!-- ioc核心依赖 -->
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-core</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-context-support</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <!-- jdbc核心 -->
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-oxm</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-orm</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-tx</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-jdbc</artifactId>
          <version>${spring.version}</version>
        </dependency>
    
    
        <!-- aop模块(带aop增强包) -->
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-aop</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-aspects</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <dependency>
        <groupId>cglib</groupId>
          <artifactId>cglib</artifactId>
          <version>2.2</version>
        </dependency>
        <dependency>
          <groupId>aopalliance</groupId>
          <artifactId>aopalliance</artifactId>
          <version>1.0</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.aspectj/aspectjweaver -->
        <dependency>
          <groupId>org.aspectj</groupId>
          <artifactId>aspectjweaver</artifactId>
          <version>1.6.8</version>
          <scope>runtime</scope>
        </dependency>
        <!-- springmvc模块 -->
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-web</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-webmvc</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <!-- 测试模块 -->
        <dependency>
          <groupId>org.springframework</groupId>
          <artifactId>spring-test</artifactId>
          <version>${spring.version}</version>
        </dependency>
        <!-- JSR303后端校验核心-->
        <dependency>
          <groupId>org.hibernate.validator</groupId>
          <artifactId>hibernate-validator-annotation-processor</artifactId>
          <version>6.0.2.Final</version>
        </dependency>
        <dependency>
        <groupId>org.hibernate.validator</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>6.0.20.Final</version>
        </dependency>
        <dependency>
          <groupId>com.fasterxml</groupId>
          <artifactId>classmate</artifactId>
          <version>0.8.0</version>
        </dependency>
        <dependency>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
          <version>2.0.1.Final</version>
        </dependency>
        <!-- 添加mybatis依赖 -->
        <dependency>
          <groupId>org.mybatis</groupId>
          <artifactId>mybatis</artifactId>
          <version>${mybatis.version}</version>
        </dependency>
        <!-- 添加mybatis/spring整合包依赖 -->
        <dependency>
          <groupId>org.mybatis</groupId>
          <artifactId>mybatis-spring</artifactId>
          <version>1.3.0</version>
        </dependency>
        <!-- mybatis逆向工程-->
        <dependency>
          <groupId>org.mybatis.generator</groupId>
          <artifactId>mybatis-generator-core</artifactId>
          <version>1.3.2</version>
        </dependency>
        <!-- 分页插件-->
        <dependency>
          <groupId>com.github.pagehelper</groupId>
          <artifactId>pagehelper</artifactId>
          <version>5.1.10</version>
        </dependency>
    
        <!-- 添加mysql驱动依赖 -->
        <dependency>
          <groupId>mysql</groupId>
          <artifactId>mysql-connector-java</artifactId>
          <version>${mysql-driver.version}</version>
        </dependency>
        <!-- 添加数据库连接池依赖 -->
        <dependency>
          <groupId>com.mchange</groupId>
          <artifactId>c3p0</artifactId>
          <version>0.9.5.2</version>
        </dependency>
    
    
        <!-- 添加日志相关jar包 -->
        <dependency>
          <groupId>log4j</groupId>
          <artifactId>log4j</artifactId>
          <version>${log4j.version}</version>
        </dependency>
    
        <!-- log end -->
        <!-- 映入JSON (AJAX)-->
        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
        <dependency>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-core</artifactId>
          <version>2.9.5</version>
        </dependency>
        <dependency>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-annotations</artifactId>
          <version>2.9.5</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
        <dependency>
          <groupId>com.fasterxml.jackson.core</groupId>
          <artifactId>jackson-databind</artifactId>
          <version>2.9.5</version>
        </dependency>
        <!-- 文件上传 -->
        <dependency>
          <groupId>commons-fileupload</groupId>
          <artifactId>commons-fileupload</artifactId>
          <version>1.3.1</version>
        </dependency>
        <dependency>
          <groupId>commons-io</groupId>
          <artifactId>commons-io</artifactId>
          <version>2.4</version>
        </dependency>
      </dependencies>
    
      <build>
        <finalName>ssm</finalName>
      </build>
    
    
    </project>
    

    3.maven载入完成后把包加入到项目中

  • 相关阅读:
    虚拟机安装 ubuntu 后,更新源无效,以及无法联网安装软件的问题
    使用IE滤镜实现css3中rgba让背景色透明的效果
    C# 代理应用
    通过 DynamicLinq 简单实现 N-Tier 部署下的服务端数据库通用分页
    ICMP:internet 控制报文协议
    多模板支持
    C#与Java对比学习:数据类型、集合类、栈与队列、迭达、可变参数、枚举
    IOS中KVO模式的解析与应用
    ASP.NET MVC实现仪表程序
    spring和redis的整合
  • 原文地址:https://www.cnblogs.com/211806210dingziming/p/14433877.html
Copyright © 2020-2023  润新知