Why not use the default jboss deploy directory?
To keep things Out of the box, jboss has a bunch of .sar, .war, and .jar deployment artifacts as well as a bunch of xml files in the default deploy directory (whose path is “jboss-install-dir/server/configured-server-instance/deploy”). For the sake of being neat and cautious, I prefer to break out any deployment artifacts that are constantly in development to a separate external directory where I would never be able to “accidentally” delete all the other important configuration files required by jboss to run. Something like that never happened to me, but a friend. Yeah, a friend. About the only thing I feel ok with leaving in the default deploy directory are the “-ds” files that map the database configurations for the instance. These database settings rarely if ever change so it abides by the “deploy moving targets to an external directory” school of thought.
Ok, I want to deploy and external directory. How do I set it up?
Open up the profile.xml file:
[root@bedrock ~]# vi /jboss-install-path/server/jboss-configure-instance/conf/bootstrap/profile.xml
You’re going to want to add a line like the following:
<bean name="BootstrapProfileFactory"
class="org.jboss.system.server.profileservice.repository.StaticProfileFactory">
...
<property name="applicationURIs">
<list elementClass="java.net.URI">
<value>${jboss.server.home.url}deploy</value>
<value>file:/c:/external/deploy/directory/path</value>
</list>
</property>
...
</bean>
Save the file, and fire up jboss, and you’re good to go.
Related posts: