How to add context file from Wildfly to JHipster

2019-07-30 03:22发布

问题:

The context root file from Wildfly AS looks like this (it must be put in a file name jboss-web.xml as explained here :

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <context-root>my-context</context-root>
</jboss-web>

This file and its content have to be copied into the WEB-INF folder of the WAR file.

Of course I can manually add this file after the build and it works. But is there a way to do it automatically ? Is there in JHipster any folder that copies its content to the WEB-INF folder ? (Could be great to add such container specific files)

回答1:

You can put the file in /src/main/webapp/WEB-INF and it will work.

This goes against our goal of an "XML free" configuration, but that's how Wildfly works... BTW I am not sure you can get Spring working on Wildfly, with its broken classloader.