我正在使用maven2构建java项目,当我发出命令mvn clean install时,我得到的是错误could not parse error message: (use -source 5 or higher to enable generics)。
在我的eclipse环境中,我使用的是JDK1.7,该项目运行良好。当我想要构建项目时,我无法做到这一点,我认为maven默认使用java 1.3版本。
任何人请帮助我如何在maven中将jdk版本设置为1.7,以成功构建项目..
除了在pom.xml中提到的jar之外,我想添加我自己的jar,我如何在pom.xml中指定它?
提前谢谢..
发布于 2011-11-18 20:47:57
在你的pom.xml中,将maven编译器插件配置为使用1.6:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>https://stackoverflow.com/questions/8182622
复制相似问题