<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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <!--可以理解为就是项目包目录--> <groupId>com.spring.mvc.demo</groupId> <!--模块唯一标识--> <artifactId>springMvcDemo</artifactId> <!--聚合 : 在父类中明确指定子类--> <!--继承 : 在子类中明确指定父类--> <!--聚合模块为项目目录的最顶层,其他模块作为聚合模块子目录而存在。目的是为一次构建多个项目模块。--> <!--pom继承是为了抽出重复配置,通常配置在父模块中,为子模块提供使用,这样可以做到“一处声明,处处使用”。--> <!--聚合和继承可以同时存在,且packging都是pom--> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <!--子模块--> <modules> <module>intf</module> <module>service</module> <module>web</module> <!--因为当前pom是project所以不用加进来,如果是module,也需要把自己加进来当parent--> </modules> <!-- 统一子模块配置构件的版本号 --> <properties> <!--防止maven build时出现编码问题的警告--> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <!--spring版本号 --> <spring.version>4.3.8.RELEASE</spring.version> <!--spring data-jpa版本号--> <spring_data_jpa.version>1.11.3.RELEASE</spring_data_jpa.version> <!--mybatis版本号 --> <mybatis.version>3.4.4</mybatis.version> <!--mybatis spring版本号--> <mybatis_spring.version>1.3.1</mybatis_spring.version> <!--mybatis破解工具--> <javassist.version>3.17.1-GA</javassist.version> <!--jstl版本号--> <jstl.version>1.2</jstl.version> <mysql.version>6.0.6</mysql.version> <!--junit版本号--> <junit.version>3.8.1</junit.version> <!--servlet--> <servlet.version>3.1.0</servlet.version> <!-- log4j日志文件管理包版本 --> <slf4j.version>1.7.7</slf4j.version> <log4j.version>2.8.2</log4j.version> </properties> <!--多模块统一依赖管理--> <dependencies> <!--intf、service和controller层--> <!--子模块会自动依赖其它两个模块,避免出现循环依赖--> <!--<dependency>--> <!--<groupId>com.spring.mvc.demo</groupId>--> <!--<artifactId>intf</artifactId>--> <!--<version>${project.version}</version>--> <!--</dependency>--> <!--<dependency>--> <!--<groupId>com.spring.mvc.demo</groupId>--> <!--<artifactId>service</artifactId>--> <!--<version>${project.version}</version>--> <!--</dependency>--> <!--<dependency>--> <!--<groupId>com.spring.mvc.demo</groupId>--> <!--<artifactId>web</artifactId>--> <!--<version>1.0-SNAPSHOT</version>--> <!--</dependency>--> <!--springframe start--> <!--spring core--> <!-- https://mvnrepository.com/artifact/org.springframework/spring-core --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <!--spring context--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <!--sprint webmvc--> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>${spring.version}</version> </dependency> <!--spring data-jpa--> <!--java持久层api, Java Persistence API--> <!--Spring 框架对 JPA 提供的支持主要体现在如下几个方面:--> <!--首先,它使得 JPA 配置变得更加灵活。JPA 规范要求,配置文件必须命名为 persistence.xml,并存在于类路径下的 META-INF 目录中。该文件通常包含了初始化 JPA 引擎所需的全部信息。Spring 提供的 LocalContainerEntityManagerFactoryBean 提供了非常灵活的配置,persistence.xml 中的信息都可以在此以属性注入的方式提供。--> <!--其次,Spring 实现了部分在 EJB 容器环境下才具有的功能,比如对 @PersistenceContext、@PersistenceUnit 的容器注入支持。--> <!--第三,也是最具意义的,Spring 将 EntityManager 的创建与销毁、事务管理等代码抽取出来,并由其统一管理,开发者不需要关心这些,业务方法中只剩下操作领域对象的代码,事务管理和 EntityManager 创建、销毁的代码都不再需要开发者关心了。--> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-jpa</artifactId> <version>${spring_data_jpa.version}</version> </dependency> <!--springframe end--> <!--mybatis start--> <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>${mybatis.version}</version> </dependency> <!-- mybatis/spring包 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis-spring</artifactId> <version>${mybatis_spring.version}</version> </dependency> <!-- https://mvnrepository.com/artifact/org.javassist/javassist --> <!--mybatis 插件破解--> <dependency> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> <version>${javassist.version}</version> </dependency> <!--jsp 标准标签库, JSP Standard Tag Library--> <!--https://mvnrepository.com/artifact/javax.servlet.jsp.jstl/jstl--> <dependency> <groupId>javax.servlet.jsp.jstl</groupId> <artifactId>jstl-api</artifactId> <version>${jstl.version}</version> </dependency> <!--mysql驱动--> <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>${mysql.version}</version> </dependency> <!--单元测试--> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${junit.version}</version> <!-- 表示开发的时候引入,发布的时候不会加载此包 --> <scope>test</scope> </dependency> <!-- 日志文件管理包 --> <!-- log start --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>${log4j.version}</version> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId> log4j-core </artifactId> <version>${log4j.version}</version> </dependency> <!-- https://mvnrepository.com/artifact/org.slf4j/slf4j-api --> <!--简单日志门面Simple Logging Facade for Java--> <!--按照官方的说法,SLF4J是一个用于日志系统的简单Facade,允许最终用户在部署其应用时使用其所希望的日志系统。--> <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 --> </dependencies> <build> <finalName>springMvcDemo</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin> </plugins> </build></project>