Monday, September 19, 2005

Building JDK 5 projects with Maven 2

I had a difficult time working out from the Apache Maven 2 site documentation how to build my JDK 5 projects with m2. I found the spot in the documentation for configuring plugins and reasoned that the Java compilation goal must be connected to a plugin, but did not see exactly how to tie it all together.

After several futile Google attempts, I finally hit upon trying pom.xml source target 1.5 and found this JIRA issue covering an example and including an attached pom.xml. Using the example, a basic POM (what was previously project.xml with Maven 1) is:

<project xmlns="" xmlns:xsi=""
  <name>Maven Quick Start Archetype</name>

I got this by running the suggested new project generator:

m2 archetype:create -DartifactId=my-app

And adding the needed <build/> section.

Post a Comment