3.x 和 4.x 的最新版本
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.3.30.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>3.2.18.RELEASE</version> </dependency>
在pom.xml文件中加入以下内容:
版本号:
<properties> <springframework.version>4.3.30.RELEASE</springframework.version> </properties>
引入的jar包:
<!--++++++++++++++++++++++++++++++++++++++++++++++++++++--> <!-- Spring依赖 --> <!--++++++++++++++++++++++++++++++++++++++++++++++++++++--> <!-- 1.Spring核心依赖:IOC/DI--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${springframework.version}</version> </dependency> <!-- 2.AOP依赖 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>${springframework.version}</version> </dependency> <!-- 3.Spring dao依赖 --> <!-- spring-jdbc包括了一些如jdbcTemplate的工具类 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${springframework.version}</version> </dependency> <!-- 4.Spring web依赖 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${springframework.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${springframework.version}</version> </dependency> <!-- 5.Spring test依赖:方便做单元测试和集成测试 --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${springframework.version}</version> </dependency>