Add another file handler and another location to the undertow subsystem in standalone.xml:
<server name="default-server">
<http-listener name="default" socket-binding="http"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<location name="/img" handler="images"/>
</host>
</server>
<handlers>
<file name="welcome-content" path="${jboss.home.dir}/welcome-content" directory-listing="true"/>
<file name="images" path="/var/images" directory-listing="true"
follow-symlink="true"/>
</handlers>
从此,在开发的开始,war里就不用再包含第三方的js、图片。