Original:
[Java] [JBoss] Change JBoss Deployment directory (virtual directory)
In the development process, sometimes we want to put the program in our source code directory, such as D:\code, rather than on JBoss deploy, what to do?
We know that we have Tomcat integrated in JBoss, so you can configure this directory just like Tomcat, just find the server.xml.
For different versions of JBoss, the directory name may be slightly different:
For jboss4.0, it's deploy\jbossweb-tomcat55.sar\server.xml.
For jboss4.2 is Jboss-web.deployer\server.xml,
For jboss5.1, it's jbossweb.sar\server.xml.
In short, the simplest way is to search for server.xml in the JBoss directory. After finding Server.xml, add before:
<context path= "/app" docbase= "D:\\code\myapp" debug= "1" reloadable= "true" override= "true" crosscontext= "true"/ >
Note Docbase can also be a war package:
<context path= "/app" docbase= "D:\\code\myapp.war" debug= "1" reloadable= "true" override= "true" crosscontext= "true" />
Where path is the virtual directory name, Docbase is the hard disk absolute path reloadable is reloaded when the class changes.
[Java] [JBoss] Change JBoss Deployment directory (virtual directory)