Im trying to build use maven from the terminal, and am getting the following error:
[ERROR] (use -source 5 or higher to enable annotations)
The strange thing is, in my pom I have the following:
<properties>
...
<java.version>1.7</java.version>
...
</properties>
and
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
When I run maven install from within eclipse it works.
When I run mvn --version from the terminal, here is the output:
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.7.0_72, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-7-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.16.0-24-generic", arch: "amd64", family: "unix"
I noticed too, that when running from the terminal, there is the following error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project
So, for some strange reason it is using an older version of the compiler plugin when running from the terminal.
Anyone know why this error is occurring, and how to fix it?