为什么Maven项目默认绑定到J2SE-1.5? [英] Why Maven project is tied to J2SE-1.5 by default?

查看:245
本文介绍了为什么Maven项目默认绑定到J2SE-1.5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我根据 Eclipse 中的没有原型 Maven 项目创建默认值,则它将基于 J2SE-1.5

If I create default empty based on no archetype Maven project in Eclipse, it will be based on J2SE-1.5.

我要手动更改Build Path条目和代码合规性。

I am to change manually both Build Path entry and code compliance.

为什么?

如何使其他?

推荐答案

p> @axtavt是正确的,添加源级配置到你的项目。但是,不要配置 maven-compiler-plugin ,只需将此属性放入 pom.xml

@axtavt is right, add source level configuration to your project. But do not configure maven-compiler-plugin, simply put this properties into pom.xml.

<properties> 
  <maven.compiler.source>1.7</maven.compiler.source> 
  <maven.compiler.target>1.7</maven.compiler.target> 
</properties>

在Eclipse中刷新maven配置后,

After this refresh maven configuration in Eclipse.

这篇关于为什么Maven项目默认绑定到J2SE-1.5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆