Maven Compile Error

The problem is that maven-compiler-plugin in Maven2 by default uses -source 1.3 and target 1.3

You can fix it by adding this to your pom:

    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <configuration>
        <compilerVersion>1.5</compilerVersion>
        <source>1.5</source>
        <target>1.5</target>
      </configuration>
    </plugin>

It's practical to put this into pluginManagement section in your topmost parent pom so that your derived poms do not need to care about this.


You have to add some informations in your pom.xml. Something like that:

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