1
嘗試編譯我的aspectj項目時出現以下錯誤。使用Maven拋出AspectJ編譯拋出java.lang.NoClassDefFoundError:org/aspectj/bridge/IMessageHolder
[INFO] --- aspectj-maven-plugin:1.4:compile (default) @ jetserver ---
Feb 2, 2012 7:33:31 PM org.sonatype.guice.bean.reflect.LoadedClass
WARNING: Error injecting: org.codehaus.mojo.aspectj.AjcCompileMojo
java.lang.NoClassDefFoundError: org/aspectj/bridge/IMessageHolder
at java.lang.Class.getDeclaredConstructors0(Native Method)
[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.4:compile (default) on project game-server: Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.4:compile failed: Unable to load the mojo 'compile' in the plugin 'org.codehaus.mojo:aspectj-maven-plugin:1.4'. A required class is missing: org/aspectj/bridge/IMessageHolder
pom的相關部分粘貼在下面。任何想法,爲什麼我得到這個錯誤?
<build>
<plugins>
<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>1.6.11</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.6.11</version>
</dependency>
</dependencies>
<configuration>
<source>1.6</source>
<complianceLevel>1.6</complianceLevel>
<verbose>true</verbose>
<showWeaveInfo>true</showWeaveInfo>
<target>1.6</target>
<!-- The following sets up aspectj weaving path. jetserver jar has the
compiled aspect which is used to weave classes in this app -->
<aspectLibraries>
<aspectLibrary>
<groupId>org.menacheri</groupId>
<artifactId>jetserver</artifactId>
<version>0.1</version>
</aspectLibrary>
</aspectLibraries>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>