Maven中指定Java的编译版本和源文件编码方式
来源:互联网 发布:c语言自学步骤 编辑:程序博客网 时间:2024/05/19 09:12
使用Maven编译Java项目,默认的编译版本是1.5.
Default value is: ${project.build.sourceEncoding}.
User property is: encoding.encodingString2.0
2)在pom.xml中指定,例如
参考官网的说明-》https://maven.apache.org/plugins/maven-compiler-plugin/compile-mojo.html
The -source argument for the Java compiler.
Default value is: 1.5.
User property is: maven.compiler.source.
targetString2.1The -encoding argument for the Java compiler.Default value is: ${project.build.sourceEncoding}.
User property is: encoding.encodingString2.0
The -target argument for the Java compiler.
Default value is: 1.5.
User property is: maven.compiler.target.
如果要指定Java编译版本有两种方式
1)在settings.xml中指定,例如
<profiles> <profile> <id>JDK1.7</id> <activation> <activeByDefault>true</activeByDefault> </activation> <properties> <maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.target>1.7</maven.compiler.target><encoding>UTF-8</encoding> </properties> </profile></profiles>
2)在pom.xml中指定,例如
<build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>${maven-compiler-plugin.version}</version><configuration><source>1.7</source><target>1.7</target><encoding>UTF-8</encoding></configuration></plugin></plugins></build>
1 0
- Maven中指定Java的编译版本和源文件编码方式
- 在Ant的javac中指定源文件编码方式,以避免"警告: 编码 GBK 的不可映射字符"的错误
- 在Ant的javac中指定源文件编码方式,以避免"警告: 编码 GBK 的不可映射字符"的错误
- 在Ant的javac中指定源文件编码方式,以避免"警告: 编码 GBK 的不可映射字符"的错误
- maven中指定jdk版本
- Hibernate配置文件中指定MySQL数据库的编码方式
- Hibernate配置文件中指定MySQL数据库的编码方式
- Hibernate配置文件中指定MySQL数据库的编码方式
- Hibernate配置文件中指定MySQL数据库的编码方式
- 指定maven的编译版本和编码
- 抓取网页中指定节点的内容(java版本)
- java编码原理 -- 源文件编译和执行
- java中指定编码操作文本文件
- 在java源文件中指定TextView文本显示内容
- ddk无法编译utf-8编码方式的源文件
- java读取jar中指定的文件
- java取集合中指定的元素
- java中指定小数点后面的位数
- typedef与#define
- android 自定义控件方法以及实例
- 每天一个linux命令(41):ps命令
- android 4.0 USB Camera实例(二)应用层
- EasyUI 出现的问题
- Maven中指定Java的编译版本和源文件编码方式
- muduo库阅读(24)——Net部分:网络地址类
- php 中单引号和双引号的区别
- java反射----类方法提取
- Extjs 远程排序
- jquery选择器
- Android Xutils框架HttpUtil Get请求缓存问题
- 小白学算法1.1——栈
- android4.0 USB Camera实例(三)UVC