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 ...
随机推荐
- day24-2 单例模式
目录 单例模式 类内部定义静态方法实现单例模式 装饰器实现单例模式 元类实现单例模式 单例模式 单例模式:基于某种方法实例化多次得到实例是同一个 当实例化多次得到的对象中存放的属性都一样的情况,应该将 ...
- freemarker特殊字符输出
期望输出: #{fefefefwewrerwerwrrrre}${fffqqqwwwwwwwwwwwwwwww} 但是以上解析ftl时候会报错!!!!!!!!!!!! 解决办法: 方法1:使用${r& ...
- Spring框架针对dao层的jdbcTemplate操作crud之add添加数据库操作
使用jdbcTemplate 原理是把加载驱动Class.forName("com.mysql.jdbc.Driver"); 和连接数据库Connection conn=Drive ...
- VS C++项目报错warning C4199: ……use /Zc:twoPhase-
具体的报错如下: c1xx : warning C4199: two-phase name lookup is not supported for C++/CLI, C++/CX, or OpenMP ...
- <Jenkins> 入门一
1.Continous integration 持续集成 2.Continous Delivery 持续交付 3.Java 写的
- 条款30:透彻了解inline的里里外外(understand the ins and outs of inlining)
NOTE: 1.将大多数inline限制在小型 被频繁调用的函数身上.这可使日后的调试过程和二进制升级(binary upgradability)更容易,也可使潜在的代码膨胀问题最小化, 使程序的速度 ...
- 转载 vue的基础使用
转载https://www.cnblogs.com/majj/p/9957597.html#top vue的介绍 前端框架和库的区别 nodejs的简单使用 vue的起步 指令系统 组件的使用 过滤器 ...
- Centos6.5安装Nexus及安装时的一些错误
注意:此篇博文未有配置部分,有需求的同学只能自行寻找了-- 1.下载: https://www.sonatype.com/download-oss-sonatype 2.官方推荐安装在/opt目录下 ...
- robot framework常见错误:RIDE运行一次后不显示log
在使用RIDE进行web自动化测试时,会发现经常运行第二遍不显示下方log,如下 原因: 代码使用的是谷歌浏览器.IE浏览器测试,运行一次后chromedriver.exe,IEDriverServe ...
- 大数据学习——下载集群根目录下的文件到E盘
代码如下: package cn.itcast.hdfs; import java.io.IOException; import org.apache.hadoop.conf.Configuratio ...