2014-04-04 36 views
1

請幫助我的人,我很絕望。我一直在嘗試整夜。我遇到的問題是:Weird NoClassDef-s with Eclipse Jetty's Maven pluginNoClassDef-S與Eclipse Jetty的Maven插件,再次

基本上:我無法使最新版本的Jetty插件在集成測試中正常工作。事實上,一切正常,直到Jetty的關機階段,當我被告知org.eclipse.jetty.util.FutureCallback丟失。

我已經包括在上面的鏈接告訴依賴性。最初他們被忽略,然後我將它們添加到項目/構建/擴展中。現在我還有其他幾個ClassNotFoundException,我無法解決這個問題。

這是我在我的POM:

<plugins> 

     <!-- This is activated before tests and uses the overlay import mechanism --> 
     <plugin> 
      <groupId>org.eclipse.jetty</groupId> 
      <artifactId>jetty-maven-plugin</artifactId> 

      <configuration> 

       <systemProperties> 
        <!-- Triggers test data creation in uk.ac.ebi.fg.myequivalents.webservices.server.test.WebTestDataInitializer --> 
       <systemProperty> 
        <name>uk.ac.ebi.fg.myequivalents.test_flag</name> 
        <value>true</value> 
       </systemProperty> 
       </systemProperties>   

       <scanIntervalSeconds>10</scanIntervalSeconds> 
       <useTestScope>true</useTestScope> 

       <httpConnector> 
       <!-- 8080 is often busy on EBI hosts --> 
       <port>10973</port> 
       </httpConnector> 

       <stopPort>10974</stopPort> 
     <stopKey>KILL</stopKey> 

      </configuration> 

      <executions> 
       <!-- 
        starts jetty before tests and stops it afterwards. Note that no stop goal is needed, it magically stops 
        after tests 
       --> 
       <execution> 
        <id>start-jetty</id> 
        <phase>pre-integration-test</phase> 
        <goals> 
         <goal>run</goal> 
       </goals> 
        <configuration> 
         <scanIntervalSeconds>0</scanIntervalSeconds> 
         <daemon>true</daemon> 
        </configuration> 
       </execution> 
       <execution> 
       <id>stop-jetty</id> 
       <phase>post-integration-test</phase> 
       <goals> 
       <goal>stop</goal> 
       </goals> 
       </execution>      
      </executions> 
     </plugin> 

這些都是我所設置的extesions:{} jetty.version在父定義

 <extensions> 
     <extension> 
      <groupId>org.eclipse.jetty</groupId> 
     <artifactId>jetty-util</artifactId> 
      <version>${jetty.version}</version>    
     </extension>   
     <extension> 
      <groupId>org.eclipse.jetty</groupId> 
     <artifactId>jetty-jsp</artifactId> 
      <version>${jetty.version}</version>    
     </extension>   
     <extension> 
      <groupId>org.eclipse.jetty</groupId> 
     <artifactId>jetty-io</artifactId> 
      <version>${jetty.version}</version>    
     </extension>   
     <extension> 
      <groupId>org.eclipse.jetty</groupId> 
     <artifactId>jetty-jaspi</artifactId> 
      <version>${jetty.version}</version>    
     </extension>   
    </extensions> 

$和= 9.1.3.v20140225,但我已經嘗試了許多,下降到7.x的

此外,Maven是3.2.1,Java是1.7.0_51,在OS X 10.9.2

運行

非常感謝您爲這個討厭的問題提供任何幫助。

+1

由於沒有一個解決方案在這裏幫助或者(和作爲是原始的海報http://stackoverflow.com/questions/19042425/weird-noclassdef-s-with-eclipse-jettys-maven -plugin),我已經在這裏提交了一個錯誤報告:https://bugs.eclipse.org/bugs/show_bug.cgi?id = 438500。 – carlspring

回答

2

我找到了!顯然,問題在於「停止」目標(正確)附加在「後整合測試」階段。所以,如果你發出'mvn integration-test',就我所知,這個階段沒有達到(http://tinyurl.com/omwulm5)。通過給予'mvn verify'或'install',並且不向POM添加任何Jetty相關的依賴項(所有需要的東西現在都應該包含在9.1.x中),Maven完全沒有任何抱怨(hooray!)。

這可能看起來傻乎乎的讀者比我聰明,我仍然舉報,以防萬一,我剛剛幾個小時做你努力一樣多。

+0

我發現的還有一件事:如果一個測試有錯誤,這個碼頭相關的異常可能會再次出現(雖然它不是真的,只是由於測試中止而引起),所以請注意。 – zakmck

0

只是嘗試添加<stopWait>10</stopWait>到插件配置。

滿配置,你可以在this answer看到。

+0

這很好,但在上述情況下無用。 – zakmck