Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

AspectJMaven/compiler

The Maven compiler plugin actually is actually a facade over a number of different compilers, one of these compilers in AspectJ.

You can instruct the maven compiler to use AspectJ as described in the Maven compiler plugin documentation [1].

An example for AspectJ follows :


<project>
  [...]
  <build>
    [...]
    <plugins>
      [...]
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <compilerId>aspectj</compilerId>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>plexus</groupId>
            <artifactId>plexus-compiler-aspectj</artifactId>
            <version>1.3</version>
          </dependency>
        </dependencies>
      </plugin>
  [...]
</project>

Unfortunately, it currently uses AspectJ 1.2, which is incredibly old. There is a ticker on the Plexus JIRA [2] asking for support for a recent version if AspectJ.

A technique similar to that used for the Maven AspectJ Plugin could be used to force a recent version of AspectJ, but has not been tested. Please let us know on AspectJ mailing list if you manage to force a recent version.

Back to the top