Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] woven classes not getting into the woven jar


I created an aspect library jar and am weaving it into java classes that go into a woven jar. I use maven 2.2.1 and aspectj-maven-plugin 1.3 to build the aspect library and weave it into the java classes.

Running a JUnit that tests the weaving in the the woven project, passes. If I copy the same JUnit test into a project that depends on the woven project's jar and aspectjrt.jar, the JUnit test fails. 

Apparently the woven classes are not getting into the "woven" jar. I would appreciate any insights you might have into what is causing this problem.

This is the pom.xml for the woven project:

<modelVersion>4.0.0</modelVersion>
<groupId>com.med</groupId>
<artifactId>cdc-aop-woven</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>cdc-aop-woven</name>
<build>
<plugins>
<plugin>
<!-- This is necessary to enable JDK 1.6 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<complianceLevel>1.6</complianceLevel>
<includes>
<include>**/*.java</include>
</includes>
<excludes>
<exclude />
</excludes>
<aspectLibraries>
<aspectLibrary>
<groupId>com.med</groupId>
<artifactId>cdc-aop</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<!-- use this goal to weave all your main classes -->
<goal>compile</goal>
<!-- use this goal to weave all your test classes -->
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.9</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.med</groupId>
<artifactId>cdc-aop</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

This is the pom.xml for the project that tests the woven jar:

<modelVersion>4.0.0</modelVersion>
<groupId>com.med</groupId>
<artifactId>cdc-aop-woven-client</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>cdc-aop-woven-client</name>
<build>
<plugins>
<plugin>
<!-- This is necessary to enable JDK 1.6 -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.6.9</version>
</dependency>
<dependency>
<groupId>com.med</groupId>
<artifactId>cdc-aop-woven</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>

 



Back to the top