欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

用Maven创建SSM项目需要添加的依赖

程序员文章站 2022-07-15 11:14:50
...
1.首先设置总的版本规定
2.javaee 的jdk包
3.mybatis-spring整合包
4.mybatis的包
5.spring的核心包
    spring-core
    spring-web
    spring-oxm
    spring-tx
    spring-jdbc
    spring-webmvc
    spring-aop
    spring-context-support
    spring-test
6.连接mysql的jar包
7.数据库连接池的jar包
8.测试的jar包
9.记录日志的jar包
10.jackson的jar包
11.cglib包
12.aspectjweaver包
13.aspectjrt包

示例:

<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/maven-v4_0_0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>cn.sdut.maven</groupId>
	<artifactId>MavenDemo</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<name>MavenDemo Maven Webapp</name>
	<url>http://maven.apache.org</url>

	<properties>
		<!-- java ee jar包 -->
		<javaee.version>7.0</javaee.version>
		<!-- jstl jar包 -->
		<jstl.version>1.2</jstl.version>
		<!-- mysql-connector包 -->
		<mysql.version>5.1.30</mysql.version>
		<!-- commons-dbcp -->
		<dbcp.version>1.4</dbcp.version>
		<!-- mybatis-spring整合包 -->
		<mybatis-spring.version>1.3.0</mybatis-spring.version>
		<!-- spring版本号 -->
		<spring.version>4.2.5.RELEASE</spring.version>
		<!-- mybatis版本号 -->
		<mybatis.version>3.4.0</mybatis.version>
		<!-- jackson版本号 -->
		<jackson.verson>2.8.9</jackson.verson>
		<!-- junit -->
		<junit-version>4.12</junit-version>
		<!-- cglib -->
		<cglib-version>3.2.2</cglib-version>
		<!-- log4j日志文件管理包版本 -->
		<slf4j.version>1.7.21</slf4j.version>
		<log4j.version>1.2.17</log4j.version>
	</properties>

	<dependencies>
		<!-- 导入java ee jar 包 -->
		<dependency>
			<groupId>javax</groupId>
			<artifactId>javaee-api</artifactId>
			<version>${javaee.version}</version>
		</dependency>
		<!-- jstl包 -->
		<!-- JSTL标签类 -->
		<dependency>
			<groupId>jstl</groupId>
			<artifactId>jstl</artifactId>
			<version>${jstl.version}</version>
		</dependency>
		<!-- 导入Mysql数据库链接jar包 -->
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>${mysql.version}</version>
		</dependency>
		<!-- dbcp数据库连接池包 -->
		<dependency>
			<groupId>commons-dbcp</groupId>
			<artifactId>commons-dbcp</artifactId>
			<version>${dbcp.version}</version>
		</dependency>
		<!--mybatis-spring整合包 -->
		<dependency>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis-spring</artifactId>
			<version>${mybatis-spring.version}</version>
		</dependency>
		<!-- mybatis-核心包 -->
		<dependency>
			<groupId>org.mybatis</groupId>
			<artifactId>mybatis</artifactId>
			<version>${mybatis.version}</version>
		</dependency>

		<!--spring-核心包 -->
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-core</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-web</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-oxm</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>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-aop</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-context-support</artifactId>
			<version>${spring.version}</version>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-test</artifactId>
			<version>${spring.version}</version>
		</dependency>

		<!-- jackson包 -->
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>${jackson.verson}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>${jackson.verson}</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
			<version>${jackson.verson}</version>
		</dependency>

		<!-- 测试包 -->
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>${junit-version}</version>
			<scope>test</scope>
		</dependency>
		<!-- cglib包 -->
		<dependency>
			<groupId>cglib</groupId>
			<artifactId>cglib</artifactId>
			<version>${cglib-version}</version>
		</dependency>
		<!--日志记录的jar包 -->
		<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>
		<!-- aspectjweaver包 -->
		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjweaver</artifactId>
			<version>1.8.10</version>
		</dependency>
		<!-- aspectjrt 包-->
		<dependency>
			<groupId>aspectj</groupId>
			<artifactId>aspectjrt</artifactId>
			<version>1.5.3</version>
		</dependency>
	</dependencies>
	<build>
		<finalName>MavenDemo</finalName>
	</build>
</project>


相关标签: Maven SSM 依赖