Created
April 13, 2017 08:42
-
-
Save liweigong/98b002d45fba612672ce5f61fd71e4e8 to your computer and use it in GitHub Desktop.
maven 打包编译时候的警告处理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maven打包编译时后台一直输出警告信息 | |
[WARNING] File encoding has not been set, using platform encoding GBK, i.e. build is platform dependent! | |
找了半天,原来只要在pom.xml文件中增加一个配置项即可 | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
</properties> | |
------------------------------------------ | |
http://stackoverflow.com/questions/3017695/how-to-configure-encoding-in-maven | |
OK, I found the problem. | |
I use some reporting plugins. In the documentation of the failsafe-maven-plugin (http://maven.apache.org/plugins/maven-failsafe-plugin/integration-test-mojo.html) I found, that the <encoding> configuration - of course - uses ${project.reporting.outputEncoding} by default. So I added the property as a child element of the project element and everything is fine now: | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | |
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | |
</properties> | |
See also http://maven.apache.org/general.html#encoding-warning | |
------------------------------------------ | |
[WARNING] Some problems were encountered while building the effective model for com.ldygo:zhuanche_common_config:jar:1.0 | |
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-resources-plugin is missing. @ line 23, column 12 | |
Add a <version> element after the <plugin> <artifactId> in your pom.xml file. Find the following text: | |
<plugin> | |
<artifactId>maven-compiler-plugin</artifactId> | |
Add the version tag to it: | |
<plugin> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<version>2.3.2</version> | |
The warning should be resolved. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment