Why is Maven trying to compile my code as -source 1.3? Why is Maven trying to compile my code as -source 1.3? hadoop hadoop

Why is Maven trying to compile my code as -source 1.3?


Use Maven compiler plugin

<plugins>     <plugin>          <artifactId>maven-compiler-plugin</artifactId>          <version>3.1</version>          <configuration>              <source>1.7</source>              <target>1.7</target>          </configuration>      </plugin></plugins>


This answer to a similar qestion might answer your original question as to why.

Quoting from that post:

Configuring the Maven Compiler Plugin will fix the problem. It turns out the problem was caused by the Maven3 package in the Ubuntu repository. An alternate fix is to download Maven 3 from the Apache website which uses a more up to date Compiler plugin.

I wanted to know why this was happening when the documentation states the default Java source is 1.5. To see what mvn is using for your compiler plugin use:

mvn help:effective-pom

My Maven Compiler Plugin was 2.0.2 even though I was using Maven 3.0.4 from the Ubuntu packages. When I run the same command using Maven 3.0.4 from Apache I have a plugin version 2.3.2, which defaults to Java 1.5 as expected.