<?xml version="1.0" encoding="UTF-8"?> <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.zm</groupId> <artifactId>test</artifactId> <version>1.0-SNAPSHOT</version> <packaging>jar</packaging> <dependencies> <!--MyBatis核心依赖--> <!-- https://mvnrepository.com/artifact/org.mybatis/mybatis --> <dependency> <groupId>org.mybatis</groupId> <artifactId>mybatis</artifactId> <version>3.5.1</version> </dependency> <!--MySql驱动依赖--> <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.47</version> </dependency> <!-- junit测试包 --> <!-- https://mvnrepository.com/artifact/junit/junit --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.12</version> <scope>test</scope> </dependency> <!-- log4j日志依赖--> <!-- https://mvnrepository.com/artifact/log4j/log4j --> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.12</version> </dependency> </dependencies> <build> <!-- 找不到xxx.xml的解决方案 --> <resources> <resource> <directory>src/main/resources</directory> <includes> <include>**/*.properties</include><!-- 默认(新添加自定义则失效) --> <include>**/*.xml</include><!-- 新添加 */代表1级目录 **/代表多级目录 --> </includes> <filtering>true</filtering> </resource> <resource> <directory>src/main/java</directory> <includes> <include>**/*.properties</include><!-- 默认(新添加自定义则失效) --> <include>**/*.xml</include><!-- 新添加 */代表1级目录 **/代表多级目录 --> </includes> <filtering>true</filtering> </resource> </resources> </build> </project>
Mybatis pom.xml 文件配置(用于管理子项目,jar包加载、日志管理、编译管理)
最新推荐文章于 2024-04-29 17:24:58 发布
这是一个关于如何配置Maven项目以整合MyBatis、MySQL驱动和JUnit测试的示例。项目中包含了MyBatis核心库、MySQL驱动和JUnit测试框架的依赖,并配置了资源过滤,确保能正确找到XML配置文件。
摘要由CSDN通过智能技术生成