Thursday, February 11, 2010

Configuring Maven for Wicket 1.4.x

Note to self:

when using Wicket 1.4 and up together with Maven, the maven-compiler plugin must be configured to use source and target JDK 1.5 or higher. This is because of the Method MarkupContainer.add(Component...), which in JDK 1.4 (the maven-compiler plugin's standard) gets translated into MarkupContainer.add(Component[]).

To configure the plugin, add this to the project's pom.xml:

<build>
 <plugins>
  <plugin>
   <groupId>org.mortbay.jetty</groupId>
   <artifactId>maven-jetty-plugin</artifactId>
  </plugin>
  <plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-compiler-plugin</artifactId>
   <version>2.1</version>
   <configuration>
    <source>1.6</source>
    <target>1.6</target>
   </configuration>
  </plugin>
 </plugins>
</build>

No comments:

Post a Comment