Maven2, Java5 et al.

March 21, 2007

I’m finally making the move up to Java 5 (yes, it is difficult to leave 1.4.2 behind, but considering Java 6 is out it is high time). In doing so I had a problem with Maven2 that I had not encountered before i.e. getting it to use the correct compiler compliance settings. This post from Ahti Kitsik sorted me out.

Advertisements

3 Responses to “Maven2, Java5 et al.”

  1. John Says:

    This post has been up for a while, but here’s the answer. Add the following lines to your POM file.

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

    1.5
    1.5

  2. John Says:

    ugh, this site doesn’t add the necessary entities.

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

  3. codecurl Says:

    many thanks, just in time to move up to 1.6


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: