2017-09-12 7 views
0

私は、監査のためにaspectJを使用するmavenプロジェクトを持っています。私はIntellijのアイデアを使用しています。 IきれいなパッケージAspectJのプラグインが言うときIntelliJのMavenプロジェクトでAspectJが動作しない

<plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>aspectj-maven-plugin</artifactId> 
       <version>1.7</version> 
       <configuration> 
        <showWeaveInfo>true</showWeaveInfo> 
        <source>${java.version}</source> 
        <target>${java.version}</target> 
        <Xlint>ignore</Xlint> 
        <complianceLevel>${java.version}</complianceLevel> 
        <encoding>UTF-8</encoding> 
        <verbose>true</verbose> 
       </configuration> 
       <executions> 
        <execution> 
         <!-- IMPORTANT --> 
         <phase>process-sources</phase> 
         <goals> 
          <goal>compile</goal> 
          <goal>test-compile</goal> 
         </goals> 
        </execution> 
       </executions> 
       <dependencies> 
        <dependency> 
         <groupId>org.aspectj</groupId> 
         <artifactId>aspectjtools</artifactId> 
         <version>1.8.10</version> 
        </dependency> 
       </dependencies> 
</plugin> 

:ここに私のプラグインの設定がポンポンファイル内にある

Join point 'method-execution(java.util.List com.test.getHistories(java.lang.String, java.lang.String))' in Type 'com.test.HistoryService' (HistoryService.java:18) advised by around advice from 'com.test.aspects.AuditLoggerAspect' (AuditLoggerAspect.java:88) 

Join point 'method-execution(java.lang.String com.test.getString(int, java.lang.Object))' in Type 'com.test' (AspectTest.java:14) advised by around advice from 'com.test.AuditLoggerAspect' (AuditLoggerAspect.class(from AuditLoggerAspect.java)) 

このアプリのパッケージには、WARあり、iは、WebLogicにデプロイします。 私はそれを展開するか、またはテストを実行すると、アスペクトは動作しません。どうして?

私はJava Appでこの側面とmavenプラグインの設定をテストしています。

答えて

0

プロジェクトmaven-compiler-pluginをきれいにしてパッケージ化するときに、aspectJ-compiler-pluginがコンパイルした後でプロジェクトを再コンパイルすると、コンパイルされた部分が削除されました。 以下の設定をmaven-compiler-pluginに追加して解決します:

関連する問題