Intellij with Jetty issue
Hi !
I need to deploy a war that contains a specific jetty-web.xml but there is not way to specify it , the content of the file is like this :
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
<Set name="contextPath">/</Set>
<Set name="war"><Property name="jetty.webapps" default="./lib"/>/favor.war</Set>
<Set name="extraClasspath">./conf/</Set>
<Set name="maxFormContentSize">200000</Set>
<Set name="configurationClasses">
<Array type="java.lang.String">
<Item>org.eclipse.jetty.webapp.WebInfConfiguration</Item>
<Item>org.eclipse.jetty.webapp.WebXmlConfiguration</Item>
<Item>org.eclipse.jetty.annotations.AnnotationConfiguration</Item>
</Array>
</Set>
<Set name="systemClasses">
<Array type="java.lang.String">
<Item>org.eclipse.jetty.webapp.</Item>
</Array>
</Set>
<Set name="serverClasses">
<Array type="java.lang.String">
<Item>-org.eclipse.jetty.webapp.</Item>
</Array>
</Set>
<Set name="parentLoaderPriority">true</Set>
<Call name="setAttribute">
<Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
<Arg>^$</Arg>
</Call>
</Configure>
But Intellij doesn't provide a way to do it , I found that Intellij is creating in tmp folders that contains an xml with the following , which seems
to be autogenerated from intellij based on the options that we have in the ide.
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd"><Configure ><Set name="contextPath">/</Set><Set name="resourceBase">/home/apps/workspace/favor/build/classes/artifacts/favor/exploded/favor.war</Set></Configure>
Any idea on how to specify it ?
Thanks !
请先登录再写评论。
Hello Adrian,
Please try this: Open Project Settings - Modules. And add desired web.xml under your web module.
Best regards,
Nikolay
I found the solution is quite hidden.
Project Settings -> Facets -> Web -> Add Application Server Specific Descriptor . Then search for your jetty-web.xml and it works. I found this by myself but on the documentation I couldn't find it.