maven 的编译插件的配置
--------------------------------------------------------------------------------------------------------
WHY IT HAPPENS
The problem arises because
[...] at present the default source setting is 1.5 and the default target setting is 1.5, independently of the JDK you run Maven with. If you want to change these defaults, you should set source and target as described in Setting the -source and -target of the Java Compiler.
That's why changing the JDK has no effect on the source level. So you have a couple of way to tell Maven what source level to use.
SOLUTIONS
- Configure the Maven compiler plugin in the pom.xml
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
...
- OR Set these properties (always in the pom)
<properties>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
JDK VERSION TO USE?
If you set a target 1.7 like in this example be sure that the mvn command is actually launched with a jdk7 (or higher)
LANGUAGE LEVEL ON THE IDE
Usually IDEs use maven pom.xml file as a source of project configuration. Changing the compiler settings in the IDE not always has effect on the maven build. That's why, the best way to keep a project always manageable with maven (and interoperable with other IDEs) is edit the pom.xml files and instruct the IDE to sync with maven.
maven 的编译插件的配置的更多相关文章
- Maven中常用插件的配置
在Maven项目的pom.xml文件中配置插件信息,使用<build></build>标签 1.配置JDK版本插件和Tomcat版本插件 <build> <! ...
- Eclipse Class Decompiler——Java反编译插件手工配置方法
最近在eclipse上配置了java反编译插件,但是不好用,原因是我的eclipse之前有手动配置过一些类似的java反编译插件,当我将原来的插件完全卸载后重新配置才正常配置上去,自动配置java反编 ...
- maven编译插件版本配置案例
<!-- Build Settings 构建设置 --> <build> <finalName>${project.artifactId}</finalNam ...
- 到底如何配置 maven 编译插件的 JDK 版本
千言万语不及官方文档,详情请阅读 compiler:compile 文档 配置 maven 编译插件的 JDK 版本 maven 编译插件(maven-compiler-plugin)有默认编译 JD ...
- maven中jetty插件配置
maven中jetty插件的配置,可用于项目在内置jetty服务器中的部署. <plugin> <groupId>org.mortbay.jetty</groupId&g ...
- Maven 添加 Tomcat 插件
若想在 Maven 中使用 Tomcat 服务器,需要在 pom.xml 文件中的 <build></build> 标签中添加以下代码 <!-- Maven项目编译插件 ...
- maven常用插件pom配置
一.问题描述: 部署一个maven打包项目时,jar包,依赖lib包全部手动上传至服务器,然后用maven部署报错:Exception in thread "main" java. ...
- Maven常用插件简单配置
好久不见,甚是想念.一日不见,如隔三秋. 从春节到现在已经很久没有回归博客园了,今天回来温习一下maven常用的一些插件的配置,学东西一个很简单的诀窍就是重复重复再重复,这样一定能把知识掌握的很牢靠. ...
- 1.Maven+SpringMVC+Eclipse软件安装配置,Maven报插件错误,Eclipse总是卡死的解决办法,导入一个maven工程后 一直显示importing maven project
使用Maven+SpringMVC+Eclipse软件安装配置过程中的问题: 1.Eclipse总是卡死的解决办法: 一:内存不足所以会卡死,配置一下eclipse.ini修改这几个值就好了-X ...
随机推荐
- 原生JS--各种兼容性写法总结
<script> var oEvent = evt || event; ========================================================== ...
- 穷举(四):POJ上的两道穷举例题POJ 1411和POJ 1753
下面给出两道POJ上的问题,看如何用穷举法解决. [例9]Calling Extraterrestrial Intelligence Again(POJ 1411) Description A mes ...
- Android开发案例 - 淘宝商品详情【转】
http://erehmi.cnblogs.com/ 所有电商APP的商品详情页面几乎都是和淘宝的一模一样(见下图): 采用上下分页的模式 商品基本参数 & 选购参数在上页展示 商品图文详情等 ...
- QT +坐标系统 + 自定义控件 + 对象树的验证(自动进行析构)_内存回收机制
通过创建一个新的按钮类,来进行析构函数的验证,即对象树概念的验证.当程序结束的时候会自动的调用析构函数, 验证思路: 要验证按钮会不会自动的析构,(即在QPushButton类里面的析构函数添加qDe ...
- P2964 [USACO09NOV]硬币的游戏A Coin Game (DP)
题意:n颗硬币 两个人从前往后按顺序拿 如果上一个人拿了i颗 那么下一个可以拿1-2*i颗 问先手能获得的最大收益 题解:比较典型的最大最小最大最小..DP了 但是暴力做的话是n^3 所以就体现出了这 ...
- B6. Concurrent 内存模型与线程交互
[概述]
- luogu 数列找不同-莫队
https://www.luogu.org/problemnew/show/P3901 了解过莫队的人应该都清楚,莫队是一个优化的暴力,可以在相对暴力比较优的时间中,求出一段序列内的某些性质(例:数字 ...
- Java多线程的内存模型和Thread状态切换
线程的内存模型 32位操作系统的寻址空间为2的32次方,也就是4GB的寻址空间:系统在这4GB的空间里划分出1GB的空间给系统专用,称作内核空间,具有最高权限:剩下3GB的空间为用户空间(一般JVM的 ...
- dubbo负载均衡策略和集群容错策略
dubbo负载均衡策略 random loadbalance 默认情况下,dubbo是random load balance随机调用实现负载均衡,可以对provider不同实例设置不同的权重,会按照权 ...
- 国内UED收录
腾讯 腾讯CDC http://cdc.tencent.com/ CDC(Customer Research & User Experience Design Center)腾讯用户研究与体验 ...