• 0.26.0

Weaving with AspectJ Maven Plugin

The best way to weave your classes is by using jcabi-maven-plugin:ajc.

Alternatively, you can use aspectj-maven-plugin in order to apply AOP aspects to your code during compile time:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>aspectj-maven-plugin</artifactId>
  <version>1.4</version>
  <configuration>
    <complianceLevel>1.6</complianceLevel>
    <encoding>${project.build.sourceEncoding}</encoding>
    <showWeaveInfo>true</showWeaveInfo>
    <source>1.6</source>
    <target>1.6</target>
    <verbose>true</verbose>
    <aspectLibraries>
      <aspectLibrary>
        <groupId>com.jcabi</groupId>
        <artifactId>jcabi-aspects</artifactId>
      </aspectLibrary>
    </aspectLibraries>
  </configuration>
  <executions>
    <execution>
      <id>weave-classes</id>
      <phase>process-classes</phase>
      <goals>
        <goal>compile</goal>
      </goals>
    </execution>
  </executions>
</plugin>