maven项目pom.xml需要的一些配置

<build>
<!--使用maven进行clean,install时默认版本不支持,需指定版本、编码方式 -->
 <finalName>***</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>

<!--编译后的项目dao目录下没有.xml文件,需要手动配置 -->

<resources>
<resource>
<directory>${basedir}/src/main/java</directory>
<includes>
<!--无法加载.properties文件也是如此-->
<!-- <include>**/*.properties</include>  -->
     <include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>

Maven 打包时有标题中警告,
Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
需要添加
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties

posted @ 2020-03-11 19:20  Valivvali  阅读(317)  评论(0编辑  收藏  举报