1
java 6.0を使用して、mavenプロジェクトにaspectjを追加しようとしています。 1.4のバージョンのaspectj-maven-pluginと1.6.11のバージョンのaspectjを使用しています。実行時にアスペクトが見つかりません
クラスは、外部依存関係ジャー内にあり、ここにポンポンです:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<complianceLevel>1.6</complianceLevel>
<source>1.6</source>
<target>1.6</target>
<showWeaveInfo>true</showWeaveInfo>
<weaveDependencies>
<weaveDependency>
<groupId>${project.groupId}</groupId>
<artifactId>gem</artifactId>
</weaveDependency>
</weaveDependencies>
</configuration>
<executions>
<execution>
<!-- Needs to run before the regular javac compile phase -->
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
側面はビルド時に罰金を適用しているように見える:ここ はサンプルです:
[INFO] --- aspectj-maven-plugin:1.4:compile (default) @ test ---
[INFO] Extending interface set for type 'test.pkg1.pkg2.PaymentEnquiry' (PaymentE
nquiry.java) to include 'test.pkg1.pkg2.aj.AdditionalPaymentEnquiryMethods'
(PaymentEnquiryExtensions.aj)
しかし、実行時に次のエラーが発生します。 java.lang.NoSuchMethodError:
test.pkg1.pkg2.Payment.setDetails(Ljava/util/List;)V
なぜこのようなことが起こっているのかがわかります。
修正されたクラスファイルはどこにありますか?コードを実行するときにクラスパス上に拡張されていないものの代わりにそれらを含めてもよろしいですか? –