2013-12-16 9 views
5

私はMavenを学習していて問題が発生しました。私は私のwebappでmvn clean installをやろうとすると、パラメータstopPortとstopKeyがないか無効であるというエラーが表示されます。 pom.xmlの形式は次のとおりです。Maven JettyプラグインstopPortとstopKeyがないか無効です

<plugin> 
     <groupId>org.mortbay.jetty</groupId> 
     <artifactId>maven-jetty-plugin</artifactId> 
     <version>6.1.17</version> 
     <executions> 
     <execution> 
      <id>start-jetty</id> 
      <phase>pre-integration-test</phase> 
      <goals> 
       <goal>run</goal> 
      </goals> 
      <configuration> 
       <scanIntervalSeconds>0</scanIntervalSeconds> 
       <stopPort>9999</stopPort> 
       <stopKey>foo</stopKey> 
       <daemon>true</daemon> 
      </configuration> 
     </execution> 
     <execution> 
      <id>stop-jetty</id> 
      <phase>post-integration-test</phase> 
      <goals> 
       <goal>stop</goal> 
      </goals> 
     </execution> 
     </executions> 
    </plugin> 

何が起こる可能性がありますか?あらかじめThx。

+1

これはかなりの推測ですが、あなたの 'stopPort'と' stopKey'のみ 'run'目標の設定に含まれているため、問題は可能性があり?その設定を 'executions'セクションの前に移動した場合、それは機能しますか?その例をここに見ることができます:https://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin#MavenJettyPlugin-Automaticexecutionoftheplugin – DB5

+0

Awww ..どのように私はそれを逃した可能性があります!うまく働いた - ありがとう! +1 – user3107531

+0

うれしいことを聞いてうれしいです。彼らは同じ問題に遭遇すれば、他の人が簡単にそれを見つけることができるように、適切な答えとしてそれを加えました。 – DB5

答えて

7

問題はrunゴールにstopPortstopKeyの設定しか定義していないことです。この構成は、executionセクションの外に移動する必要があります。

だからあなたのポンポンは、今のようになります。

<plugin> 
    <groupId>org.mortbay.jetty</groupId> 
    <artifactId>maven-jetty-plugin</artifactId> 
    <version>6.1.17</version> 
    <configuration> 
     <scanIntervalSeconds>0</scanIntervalSeconds> 
     <stopPort>9999</stopPort> 
     <stopKey>foo</stopKey> 
    </configuration> 
    <executions> 
    <execution> 
     <id>start-jetty</id> 
     <phase>pre-integration-test</phase> 
     <goals> 
      <goal>run</goal> 
     </goals> 
     <configuration> 
      <daemon>true</daemon> 
     </configuration> 
    </execution> 
    <execution> 
     <id>stop-jetty</id> 
     <phase>post-integration-test</phase> 
     <goals> 
      <goal>stop</goal> 
     </goals> 
    </execution> 
    </executions> 
</plugin> 
関連する問題