To celebrate the first anniversary of this feature request I'm adding a description of our current use-case for this feature :-P
We're using woven classes in our unit tests. To not create an additional Maven project for running the unit tests with the woven classes packaged in a jar we need this feature. This provides us with the possibility to weave class files created by the compiler plugin without packaging them into a jar first.
To keep ajc from struggling with already woven classes we have to force the maven compiler plugin to create our (unweaved) classes in a separate directory via the command line option "-d" :
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<!-- Modifying output directory of default compile because non-weaved classes must be stored
in separate folder to not confuse ajc by reweaving already woven classes (which leads to
to ajc error message like "bad weaverState.Kind: -115") -->
<id>default-compile</id>
<configuration>
<compilerArguments>
<d>${project.build.directory}/unwoven-classes</d>
</compilerArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<build>
To keep javac from bailing-out due to a non-existent directory "target/unwoven-classes/" we have to create this first. The following is a hack of (mis-) using the copy-resources goal of the Maven resource plugin for this:
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<phase>generate-sources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/unwoven-classes</outputDirectory>
<resources>
<resource>
<directory>${basedir}</directory>
<includes>
<include>non-existent</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<build>
By separating the unwoven classes from the woven ones we can add an additional check to trigger ajc only if javac created new unwoven classes.
To weave the unwoven classes created by javac we're using the plugin option <weaveDirectories> introduced with the feature request:
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<weaveDirectories>
<weaveDirectory>${project.build.directory}/unwoven-classes</weaveDirectory>
</weaveDirectories>
</configuration>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<build>
Where do the additional classes come from? By default the plugin adds all comple source roots to the -inpath