maven - 在eclipse的maven项目中使用泛型 [英] maven - use generics in a eclipse's maven project
本文介绍了maven - 在eclipse的maven项目中使用泛型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谢谢
解决方案
不要忘记配置maven -compiler-plugin:
< plugin>
< groupId> org.apache.maven.plugins< / groupId>
< artifactId> maven-compiler-plugin< / artifactId>
<! - 锁定用于构建重现性的插件版本 - >
< version> 2.0.2< / version>
< configuration>
< source> 1.6< / source>
< target> 1.6< / target>
< / configuration>
< / plugin>
I have a maven website project generated by archtype plugin with eclipse IDE. The problem is when i need to use generics or any thing of java 5 or 6, i changed the project compiler to 1.6 and i got a error mark on the project icon in the package explorer but everything is fine. I think it is cause by maven but I dont know how to get rid of it.
Thank you
解决方案
Don't forget to configure the maven-compiler-plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<!-- Lock down plugin version for build reproducibility -->
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
这篇关于maven - 在eclipse的maven项目中使用泛型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文