首先说明,本篇文章存在问题,无法运行,依然保留的原因是为了说明版权以及告知读者问题出现在哪里。想要看该文章所存在的问题,请看评论区,无问题的版本直接点这里进入 Maven整合SSM依赖pom.xml文件 -无问题版本
导语:使用Maven的过程中,很痛苦的一件事就是配置依赖,本人整合了一个SSM的环境,包含27个依赖性,通用性还算可以,分享pom文件,希望可以帮助有需要的人。
版本说明:使用的Spring版本为3.2.13.RELEASE,使用MyBatis版本为3.2.2,贴出部分为dependencies标签中的依赖,并非全部pom.xml文件
特别说明:本人将每条依赖都打了注释,部分注释内容取自于论坛回复或百度匿名回答,剩余原创,本文标为原创文章,如有侵权,请联系本人删除或注明出处!
<dependencies>
<!--Spring依赖-->
<!--Spring-core.jar-->
<!--这个jar文件包含Spring框架基本的核心工具类,Spring其它组件要都要使用到这个包里的类,是其它组件的基本核心,当然你也可以在自己的应用系统中使用这些工具类。-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<!--spring-beans.jar-->
<!--这个jar文件是所有应用都要用到的,它包含访问配置文件、创建和管理bean以及进行Inversion of Control / Dependency Injection(IoC/DI)操作相关的所有类。如果应用只需基本的IoC/DI支持,引入spring-core.jar及spring-beans.jar文件就可以了。-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<!--spring-aop.jar-->
<!--这个jar文件包含在应用中使用Spring的AOP特性时所需的类。使用基于AOP的Spring特性,如声明型事务管理(Declarative Transaction Management),也要在应用里包含这个jar包。-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<!--spring-context.jar-->
<!--这个jar文件为Spring核心提供了大量扩展。可以找到使用Spring ApplicationContext特性时所需的全部类JDNI所需的全部类,UI方面的用来与模板(Templating)引擎如Velocity、FreeMarker、JasperReports集成的类,以及校验Validation方面的相关类。 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<!--spring-jdbc.jar-->
<!--这个jar文件包含对Spring对JDBC数据访问进行封装的所有类。-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<!--导入Spring-tx 为了使用事务-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<!--spring-web.jar-->
<!--这个jar文件包含Web应用开发时,用到Spring框架时所需的核心类,包括自动载入WebApplicationContext特性的类、Struts与JSF集成类、文件上传的支持类、Filter类和大量工具辅助类。-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<!--spring-webmvc.jar-->
<!--这个jar文件包含Spring MVC框架相关的所有类。包含国际化、标签、Theme、视图展现的FreeMarker、JasperReports、Tiles、Velocity、XSLT相关类。当然,如果你的应用使用了独立的MVC框架,则无需这个JAR文件里的任何类。-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>3.2.13.RELEASE</version>
</dependency>
<!--spring-expression.jar-->
<!--SpEL表达式所需关键JAR包-->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>3.1.3.RELEASE</version>
</dependency>
<!--MyBatis导入依赖-->
<!--mybatis.jar-->
<!--mybatis核心包-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.2.2</version>
</dependency>
<!--导入Spring-Mybatis整合包-->
<!--整合Spring和MyBatis-->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.0</version>
</dependency>
<!--杂项依赖-->
<!--junit.jar-->
<!--Junit单元测试-->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!--log4j.jar-->
<!--Log4j日志-->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<!--commons-dbcp.jar-->
<!--spring-jdbc所依赖jar包-->
<dependency>
<groupId>commons-dbcp</groupId>
<artifactId>commons-dbcp</artifactId>
<version>1.4</version>
</dependency>
<!--aopalliance.jar-->
<!--spring-aop以及spring-context依赖此jar包运行-->
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<!--jstl.jar-->
<!--页面内使用JSTL表达式-->
<dependency>
<groupId>javax.servlet.jsp.jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<!--aspectjweaver.jar-->
<!--spring-aop所依赖的包-->
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.9</version>
<scope>runtime</scope>
</dependency>
<!--hibernate-validator.jar-->
<!--验证组件-->
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>6.0.0.Final</version>
</dependency>
<!--validation-api-->
<!--数据校验包-->
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
<version>1.0.0.GA</version>
</dependency>
<!--mysql-connector-java.jar-->
<!--JDBC数据库连接驱动-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.25</version>
</dependency>
<!--commons-fileupload-->
<!--文件上传所需Jar包-->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
<!--commons-io-->
<!--操作文件所需Jar包-->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<!--commons-logging.jar-->
<!--commons-logging只是一个高层的日志框架,本身没有实现真正的日志能力,它依赖其他的日志系统如log4j或者java本身的java.util.logging。可以通过配置文件来设定最终使用log4j还是java.util.logging。没有配置log4j的时候就会调用java.util.logging包-->
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<!--commons-lang.jar-->
<!--跟java.lang这个包的作用类似,Commons Lang这一组API也是提供一些基础的、通用的操作和处理,如自动生成toString()的结果、自动实现hashCode()和equals()方法、数组操作、枚举、日期和时间的处理等等。-->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<!--commons.jar-->
<!--未知功能-->
<dependency>
<groupId>commons-pool</groupId>
<artifactId>commons-pool</artifactId>
<version>1.0</version>
</dependency>
<!--fastJson.jar-->
<!--阿里巴巴提供的JSON格式化工具-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.13</version>
</dependency>
<!--jboss-logging.jar-->
<!--日志管理-->
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>3.1.0.CR2</version>
</dependency>
<!--standard.jar-->
<!--如果你想在项目中使用JSTL和EL表达式,那么你必须要引入这个standard.jar文件。-->
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.2</version>
</dependency>
</dependencies>
帮助到各位希望点赞支持哈! 欢迎转载转发,转发注明出处标明作者。