I've configured weaving third party jar with maven plugin aspectj-maven-plugin.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.4</version>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>${aspectj.version}</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>${aspectj.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<!--<proceedOnError>true</proceedOnError>-->
<weaveDependencies>
<weaveDependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
</weaveDependency>
</weaveDependencies>
<aspectLibraries>
<aspectLibrary>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
</aspectLibrary>
</aspectLibraries>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
There is a problem with references to missing java classes. Quartz jar has some integration with JMS but my application doesn't use JMS so those quartz files are never loaded.
I've found a crutch with proceedOnError = true but I think due errors spring injection into aspect annotated class stops workings.
shade-maven-plugin doesn't fit here because it could be triggered by package phase only and aspectj launches on compile one.
[INFO] --- aspectj-maven-plugin:1.4:compile (default) @ aspectj-demo ---
[ERROR] can't determine implemented interfaces of missing type javax.servlet.ServletContextListener
when processing declare parents org.quartz.ee.servlet.QuartzInitializerListener
when processing type mungers
when weaving
when batch building BuildConfig[null] #Files=5 AopXmls=#0
[Xlint:cantFindType]
[ERROR] can't determine implemented interfaces of missing type javax.servlet.http.HttpServlet
when processing declare parents org.quartz.ee.servlet.QuartzInitializerServlet
when processing type mungers
when weaving
when batch building BuildConfig[null] #Files=5 AopXmls=#0
[Xlint:cantFindType]