Maven compiler error

一笑奈何 提交于 2019-12-06 01:27:04

I would suggest to run

mvn -v

to find out if you are using different Maven versions on the two machines.

In parallel I would suggest to upgrade to a newer version of the compiler plugin. 2.0.2 is VERY old. At least upgrade to 2.3.2 or even 2.5.1 if not the latest 3.0.

In addition I would specify source and target to the language level (e.g. Java 7 below) you need so you would end up with something like this

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.0</version>
  <configuration>
    <source>1.7</source>
    <target>1.7</target>
  </configuration>
</plugin>

That should either fix it or at least give you more info into what to look at next.

I had a similar problem when doing maven clean.
it was using maven-clean-plugin version 2.2.
I added the following to my build and that solved the problem:

 <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.5</version>
 </plugin>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!