问题描述
我正在尝试配置项目的pom.xml文件.我希望它在测试阶段启动Jetty服务器.为了做到这一点,我应该像下面所做的那样向Jetty插件添加"daemon"元素,但是IntelliJ警告我此处不允许使用元素daemon".你能帮我么?是什么原因?
I am trying to configure a project's pom.xml file. I want it to start Jetty server in testing phase. In order to do it I should add "daemon" element to Jetty plugin as I did below, but IntelliJ warns me with "Element daemon is not allowed here." Can you please help me? What is the reason?
<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>
推荐答案
它实际上是IntelliJ Idea的错误.有时它无法正确识别某些配置属性.该插件确实具有此属性,因此除了忽略IDE中的错误外,您实际上没有其他选择.该插件将按预期工作.
It's actually a IntelliJ Idea's bug. It sometimes doesn't recognize some of configuration properties correctly. The plugin does have this property, so you don't really have other option than to just ignore the error in IDE. The plugin will work as expected.
这篇关于此处不允许使用Maven Jetty插件守护程序元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!