General

All other little handy tips that can’t really fit in any specific category

Photography

Photography technique, tutorials and equipment review.

Computers

Tips, tutorials and solutions for Windows, Macs, Linux, Servers and Media Centers. Get the very most out of your computer. Resources for all levels from newbies and techies.

Web Design and Development

Tools, tech tips and tutorials for web design and development. Including wordpress plugins and tweaks.

Tools and Productivity

Software, web applications, scripts and tools to make your computing, design, development or networking experience more easier, enjoyable and productive.

Home » Computers, Tools and Productivity

Maven Compilation Failure (not supported in source 1.3)

Submitted by

We recently started using Atlassian’s continuous Integration server – Bamboo for our continuous builds.

The project compiles fine on Eclipse IDE and also works properly on the command line (using the command mvn compile).

However when the built is done on Bamboo, we get the following errors:

annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)
@Override

generics are not supported in -source 1.3
(use -source 5 or higher to enable generics)
private List errorDetails;

We were confused because in Bamboo Build Resources configuration in the Administration section the JDK was set to JDK 1.6.0_23, so we shouldn’t be having problems with annotations or generics.

Turns out that Maven using JDK 1.3 by default for compiling, building and packaging.

The solution

Include the maven plugin compiler in the pom.xml and specify the JDK version.


  org.apache.maven.plugins
  maven-compiler-plugin
  
    1.6
    1.6
  

Now Maven will use JDK 1.6 for compilations, building and packaging

Edwin Kwan is the founder and editor of Little Handy Tips and Wollongong Fitness. He is also the developer for the Google Custom Search WordPress plugin and Custom About Author WordPress plugin. He also has a keen interest in Photography . Find out more about him here.

Google+ 

Tags: , ,

css.php
%d bloggers like this: