Andrew Holland edited this page Mar 24, 2014 · 9 revisions
Clone this wiki locally


This site provides some custom extensions for the m2e Maven-Eclipse Integration. Currently available:

  • AspectJ extension
  • JAXB extension
  • HyperJAXB extension
  • OpenJPA extension


From your Eclipse menu bar, select Help | Install New Software... and enter this update site URL in the Work with field:


Select the Omadac m2e Extensions category and the features you require.

Installation via the Discovery process under Window | Preferences | Maven is not yet supported.


The current version 0.2.0 of the extensions is compatible with any of

  • Eclipse Indigo/m2e 1.0.x
  • Eclipse Juno/m2e 1.1.x or 1.2.x.
  • Eclipse Kepler/m2e 1.4.0

AspectJ extension usage

The AspectJ extension supports compile-time weaving for AspectJ using the aspectj-maven-plugin, which is typically configured like this:


The AspectJ m2e extension runs the Mojo in the background when you save one of your source files of the given project, so your classes are always woven automatically in your Eclipse builds.

JAXB extension usage

The m2e extension for JAXB supports the maven-jaxb2-plugin, which is typically configured in the POM of your project like this:


There are two optional configuration elements schemaDirectory and generateDirectory specifying the directories for your input schemas and for the JAXB classes to be generated by xjc.

The default values are:

  • schemaDirectory: src/main/resources
  • generateDirectory: target/generated-sources/xjc

The m2e JAXB extension automatically adds the generateDirectory source folder to your Eclipse project. It automatically runs xjc via the maven-jaxb2-plugin whenever you modify any resources in schemaDirectory.

OpenJPA extension usage

The OpenJPA extension supports build-time byte code enhancement of JPA entity classes for Apache OpenJPA using the openjpa-maven-plugin or the newer version org.apache.openjpa:openjpa-maven-plugin.


The OpenJPA m2e extension runs the Mojo in the background when you save one of your source files of the given project, so your entity classes are always enhanced automatically in your Eclipse builds.

The schema, sql and test-enhance goals of the openjpa-maven-plugin are currently mapped to ignore by this extension.

About this repository

This repository is a fork of Sonatype's official m2eclipse-extras repository. The Sonatype sources are still left in trunk for reference and as a basis for further extensions. All custom plugins and features have a name prefix of org.omadac.

The top-level aggregator POM only builds the org.omadac modules.


Harald Wellmann