SSM整合-导包

对整合中用到的包说明

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
    </dependency>

以上对应 其中aop对应基于注解需要的包,jcl是整合了logging

 
 

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-aop</artifactId>
    <version>${spring.version}</version>
</dependency>

以上是aop的,包已经包含在上上面那个xml里面了

 
 

    <dependency>
      <groupId>org.aspectj</groupId>
      <artifactId>aspectjweaver</artifactId>
      <version>1.6.8</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>

以上对应spring jdbcTemplate

 
 

    <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>javax.servlet</groupId>
      <artifactId>servlet-api</artifactId>
      <version>2.5</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>jsp-api</artifactId>
      <version>2.0</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>jstl</groupId>
        <artifactId>jstl</artifactId>
        <version>1.2</version>
    </dependency>

以上是spring mvc的

 
 

    <dependency>
      <groupId>org.springframework</groupId>
      <artifactId>spring-test</artifactId>
      <version>${spring.version}</version>
    </dependency>

对应spring test

 
 

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>compile</scope>
    </dependency>
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>${mysql.version}</version>
    </dependency>

junit和mysql

 
 

    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${slf4j.version}</version>
    </dependency>

对应log的

 
 

    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>${mybatis.version}</version>
    </dependency>
    <dependency>
        <groupId>c3p0</groupId>
        <artifactId>c3p0</artifactId>
        <version>0.9.1.2</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>

对应mybatis和数据库连接池

 
 

    <dependency>
        <groupId>org.mybatis</groupId>
        <artifactId>mybatis-spring</artifactId>
        <version>1.3.0</version>
    </dependency>

对应

 
 

总结

https://www.cnblogs.com/wzk-0000/p/9405399.html
https://blog.csdn.net/a909301740/article/details/78332991

导包会存在版本冲突问题

  • IOC - core:资源访问,类型转换
  • beans:bean工厂
  • expression:${}获取属性
  • context:核心接口ApplicationContext
  • AOP - aop:面向切面编程的实现
  • aspects:对AspectJ的整合
  • DAO - jdbc:通过jdbc模板类访问数据库
  • tx:事务的实现
  • orm:与hibernate,mybatis的集成
  • oxm:对象与xml数据之间的相互转换
  • jms:系统之间发送消息,异步通信
  • Web - web:与web项目的整合
  • webmvc:子模块springMVC
  • Test - test:测试

转:spring常用jar包之间的依赖关系:

  • spring-core:

    可以看出core只依赖commons-logging

  • spring-beans

    beans依赖于core

  • spring-expression

    expression和beans一样依赖于core
    由于context关系相对复杂,所以先查看其它的jar的依赖关系

  • spring-tx

    tx要依赖于beans

  • spring-jdbc

    jdbc要依赖于tx

  • spring-aop

    aop直接依赖于beans,core,aoplliance

  • spring-aspects

    aspects并不依赖beans,它是aspectJ的整合包,只依赖于aspectJ

  • spring-context

    context要依赖于beans,expression和aop

  • spring-web

    记住web依赖于context就好

  • spring-webmvc

    记住webmvc依赖于web就好

posted @ 2020-04-28 23:23  种树人  阅读(251)  评论(0编辑  收藏  举报