【1】maven来管理我的SSM项目

时间:2024-01-13 10:55:50

  新建个maven项目,第一步当然是配置好自己需要的jar包,maven使用pom.xml管理

  并不是每一个都有用,但是都是常见jar,方便以后自己调用来查找

 <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.</modelVersion>
<groupId>com.hub</groupId>
<artifactId>csc</artifactId>
<packaging>war</packaging>
<version>0.0.-SNAPSHOT</version>
<name>csc Maven Webapp</name>
<url>http://maven.apache.org</url>
<!-- ============================================================================= -->
<!-- 设置版本号 -->
<!-- 配置完该属性,下面的以来配置就可以直接引用 -->
<properties>
<spring.version>4.0..RELEASE</spring.version>
<mybatis.version>3.2.</mybatis.version>
<slf4j.version>1.7.</slf4j.version>
<log4j.version>1.2.</log4j.version>
</properties>
<!-- ============================================================================= -->
<!-- 依赖jar包 -->
<dependencies>
<!-- 单元测试 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<!-- test表示测试的时候引入,发布的时候不会引用此包 -->
<scope>test</scope>
</dependency>
<!-- .日志 -->
<!-- 实现slf4j接口并整合 -->
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.</version>
</dependency>
<!-- ============================================================================= -->
<!-- spring框架包 start -->
<!-- Spring Core:Spring的核心工具包 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring test:对JUNIT等测试框架的简单封装 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring Beans:Spring IOC的基础实现,包含访问配置文件、创建和管理bean等。 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>4.0..RELEASE</version>
</dependency>
<!-- Spring oxm:Spring对于object/xml映射的支持,可以让JAVA与XML之间来回切换 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring tx:为JDBC、Hibernate、JDO、JPA等提供的一致的声明式和编程式事务管理。 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring JDBC:对JDBC 的简单封装 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring AOP:Spring的面向切面编程,提供AOP(面向切面编程)的实现 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring Context:在基础IOC功能上提供扩展服务,此外还提供许多企业级服务的支持,
有邮件服务、任务调度、JNDI定位,EJB集成、远程访问、缓存以及多种视图层框架的支持。 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring Context Support:Spring context的扩展支持,用于MVC方面。 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring expression:Spring表达式语言 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring orm:整合第三方的orm实现,如hibernate,ibatis,jdo以及spring 的jpa实现 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring web:包含Web应用开发时,用到Spring框架时所需的核心类,包括自动载入WebApplicationContext
特性的类、Struts与JSF集成类、文件上传的支持类、Filter类和大量工具辅助类。 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Spring webmvc:包含SpringMVC框架相关的所有类。包含国际化、标签、Theme、视图展现的
FreeMarker、JasperReports、 Tiles、Velocity、XSLT相关类。当然,
如果你的应用使用了独立的MVC框架,则无需这个JAR文件里的任何类。 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- 后续需要使用(暂时未用):Spring websocket:提供 Socket通信, web端的推送功能 -->
<!-- spring框架包 end -->
<!-- ============================================================================= -->
<!-- mybatis框架包 start -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>${mybatis.version}</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.</version>
</dependency>
<!-- mybatis框架包 end -->
<!-- ============================================================================= -->
<!-- 数据库驱动 -->
<!--mysql配置:
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.</version>
</dependency> -->
<!-- sqlserver配置: -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency> <!-- 导入c3p0的jar包 -->
<dependency>
<groupId>c3p0</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.1.2</version>
</dependency>
<!-- jstl标签类 -->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>standard</artifactId>
<version>1.1.</version>
</dependency>
<!-- ============================================================================= -->
<!-- log start -->
<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 END -->
<!-- ============================================================================= -->
<!-- Json -->
<!-- 格式化对象,方便输出日志 -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.5.</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.</version>
</dependency>
<!-- 上传组件包 start -->
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3.</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.10</version>
</dependency> </dependencies>
<build>
<finalName>mavendemo</finalName>
</build>
</project>