繁体   English   中英

Maven Jetty插件stopPort和stopKey丢失或无效

[英]Maven Jetty plugin stopPort and stopKey missing or invalid

我正在学习Maven并遇到了问题。 当我尝试使用我的webapp进行mvn clean install时,我得到错误,说参数stopPort和stopKey丢失或无效。 这是pom.xml的样子:

    <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提前。

问题是您只在run目标中定义了stopPortstopKey配置。 需要将此配置移动到execution部分之外。

所以你的pom现在是:

<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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM