2011-02-16 11 views
1

私のアプリケーションに私のアスペクトを織り込むときにaspectj-maven-pluginを使用しています。私が見ている問題は、コンパイルと製織がうまく動作しているように見えるが、テストフェーズに入るたびにハングアップするということだ。mavenとaspectjプラグイン - テストがハング

[INFO] Compiling 7 source files to /home/***/target/classes 
[INFO] [aspectj:compile {execution: default}] 
[INFO] [resources:testResources {execution: default-testResources}] 
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] skip non existing resourceDirectory /home/***/src/test/resources 
[INFO] [compiler:testCompile {execution: default-testCompile}] 
[INFO] Compiling 5 source files to /home/***/target/test-classes 
[INFO] [aspectj:test-compile {execution: default}] 
[INFO] [surefire:test {execution: default-test}] 
[INFO] Surefire report directory: /home/***/surefire-reports 

------------------------------------------------------- 
    T E S T S 
------------------------------------------------------- 
Running com.example.MyTest 

は、他の誰がこの動作は/それを修正する方法を知って見てい:私はこれは私が得る出力である私のpom.xmlから

<build> 
    <plugins> 
     <plugin> 
      <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> 
       <source>1.6</source> 
       <target>1.6</target> 
      </configuration> 
      <executions> 
       <execution> 
        <goals> 
         <goal>compile</goal> 
        </goals> 
       </execution> 
      </executions> 
     </plugin> 
    </plugins> 
</build> 

<dependencies> 
    <dependency> 
     <groupId>log4j</groupId> 
     <artifactId>log4j</artifactId> 
     <version>1.2.16</version> 
    </dependency> 
    <dependency> 
     <groupId>org.aspectj</groupId> 
     <artifactId>aspectjrt</artifactId> 
     <version>1.6.7</version> 
    </dependency> 
</dependencies> 

をセクションが含まれていましたか?

答えて

2

私がやっていたように誰かがやってきた場合に備えて、ここに入れてください。テストが掛かっていた理由は、アスペクトのポイントカットが原因でした。

call(* *.*(..)) 

この後、私はポイントカットの前に呼び出されたアドバイスを受けました。しかし、これは周期的な状態を作り、私のテストをぶら下げていました。ドゥー!