Skip to content

Instantly share code, notes, and snippets.

@bxb100
Created November 28, 2017 10:40
Show Gist options
  • Save bxb100/eed4475f5d9e473b5c2e2a1723b2ca9a to your computer and use it in GitHub Desktop.
Save bxb100/eed4475f5d9e473b5c2e2a1723b2ca9a to your computer and use it in GitHub Desktop.
idea maven 项目中将java 中配置文件省略, 所以一种解决办法就是设置 pom 文件
<?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">
<parent>
<artifactId>day98_mybatis</artifactId>
<groupId>cn.pers.mybatis</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>mybatis_jdbc</artifactId>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
</dependencies>
<!--配置Maven 对resource文件 过滤 -->
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>
@bxb100
Copy link
Author

bxb100 commented Nov 28, 2017

resources 中设置同级目录比较推荐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment