We use the Maven AspectJ plugin to build our web application. It uses "weaveDependencies" to add aspects to some dependency jar files.
Now we end with two versions of some classes in the web application archive, one in WEB-INF/classes and one in the jar source file in WEB-INF/lib . It seems that only one of the classes has aspects.
I am afraid that this may cause problems.
What is the best way to fix this?
The same issue is discussed (without solution) on the Eclipse forums .
The whole pom.xml itself is huge, and of course, the included subprojects also have their own. I hope the excerpt from the WAR project is quite informative.
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>2.1.1</version> <configuration> <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors> <filters> <filter>${basedir}/src/etc/${environment}/environment.properties</filter> </filters> </configuration> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>aspectj-maven-plugin</artifactId> <version>1.2</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> <outxml>true</outxml> <aspectLibraries> <aspectLibrary> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> </aspectLibrary> </aspectLibraries> <weaveDependencies> <weaveDependency> <groupId>OURPROJECT</groupId> <artifactId>OURPROJECT-api</artifactId> </weaveDependency> <weaveDependency> <groupId>OURPROJECT</groupId> <artifactId>OURPROJECT-service</artifactId> </weaveDependency> </weaveDependencies> <source>1.6</source> <target>1.6</target> </configuration> </plugin>
source share