문제

I am learning Maven and have encountered a problem. When I try to do mvn clean install with my webapp i get the error saying that parameters stopPort and stopKey are missing or invalid. Here is what pom.xml looks like:

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

Any idea what could cause that? Thx in advance.

도움이 되었습니까?

해결책

The problem is that you have only defined the stopPort and stopKey configuration in the run goal. This configuration needs to be moved to be outside the execution section.

So your pom would now be:

<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 ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top