2016-01-25 37 views
5

我想配置一个项目的pom.xml文件。我希望它在测试阶段启动Jetty服务器。为了做到这一点,我应该在Jetty插件中添加“daemon”元素,正如我在下面所做的那样,但是IntelliJ以“元素守护进程不允许在这里”警告我。你能帮我么?是什么原因?Maven Jetty插件守护进程元素不允许在这里

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.eclipse.jetty</groupId> 
      <artifactId>jetty-maven-plugin</artifactId> 
      <version>9.2.11.v20150529</version> 
      <configuration> 
       <httpConnector> 
        <port>8083</port> 
       </httpConnector> 
      </configuration> 
      <executions> 
       <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> 
    </plugins> 
</build> 

回答

10

这实际上是一个IntelliJ Idea的错误。它有时不能正确识别一些配置属性。这个插件确实有这个属性,所以你没有别的选择,只能忽略IDE中的错误。该插件将按预期工作。

+3

有没有这个错误的参考,我们可以upvote?有一个不合理的错误真的很烦人,但我不想禁用我的pom.xml的模式验证。 – Joffrey

+1

凹凸。我也希望看到这个固定。 –

+0

我的解决方法是重新启动IDE,而不是打开pom.xml ... –