<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Deploying an application from an external deployment location
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/jaikiran">jaikiran pai</a> in <i>JBoss AS7 Development</i> - <a href="http://community.jboss.org/docs/DOC-16939">View the full document</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Just like previous versions (<a class="" href="http://community.jboss.org/docs/DOC-13241">AS5</a> and <a class="" href="http://community.jboss.org/docs/DOC-16444">AS6</a>), JBoss AS7 allows you to deploy applications from an external deployment folder. i.e. you <em>don't</em> have to place the deployment within the JBoss AS installation directory hierarchy for it to be picked up and deployed by the server. The following sections will explain how you can configure AS7 to look for deployments in an external deployment directory.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><h5>Standalone server:</h5><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>By default, the standalone server looks for deployments in JBOSS_HOME/standalone/deployments folder. In this example, we will configure the AS7 standalone server to additionally pick up deployments from a folder named /home/me/as7/mydeployments. </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ul><li style="text-align: start;">Stop the standalone server, if it is already running.</li><li style="text-align: start;">Open the JBOSS_HOME/standalone/configuration/standalone.xml file in a text editor of your choice</li><li style="text-align: start;">Look for <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.0"> subsystem in that file. You'll notice that it already contains a <deployment-scanner> child element which configures the server to look for deployments in a  folder named "deployments" relative-to the jboss.server.base.dir.</li><li style="text-align: start;">Now let's add a new deployment-scanner which will look for deployments under the folder named /home/me/as7/mydeployments:</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><deployment-scanner name="my-external-deployment-scanner" path="/home/jpai/as7/deployments" scan-interval="5000" /></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Notice that we have named this deployment-scanner "my-external-deployment-scanner". You can give it a (unique) name of your choice. The "path" points to /home/jpai/as7/deployments folder, which is where we will be placing our deployments. The "scan-interval" is the interval in milliseconds for the scanner thread to run, to check for hot deployment.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ul><li style="text-align: start;">With this addition, the susbsystem section will now look like:</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml"><span class="jive-xml-tag"><subsystem xmlns="urn:jboss:domain:deployment-scanner:1.0"></span>
    <span class="jive-xml-tag"><deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir" path="deployments" /></span>
    <span class="jive-xml-tag"><deployment-scanner name="my-external-deployment-scanner" path="/home/jpai/as7/deployments" scan-interval="5000" /></span>
<span class="jive-xml-tag"></subsystem></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ul><li style="text-align: start;">Let's now save the changes in the standalone.xml file and start the standalone server:</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code">jpai@jpai-laptop:bin$./standalone.sh
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>If you had any deployments in /home/jpai/as7/deployments folder, then you'll notice that the server has picked up those deployments for deploying. Also, if you add any new deployments, to this folder while the server is running, they will be picked up too (unless you configure the deployment scanner to disable hot deployment).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>For complete reference on what the deployment-scanner element configuration allows, take a look at the jboss-deployment-scanner.xsd here </span><a class="jive-link-external-small" href="https://github.com/jbossas/jboss-as/blob/master/deployment-scanner/src/main/resources/schema/jboss-deployment-scanner.xsd" target="_blank">https://github.com/jbossas/jboss-as/blob/master/deployment-scanner/src/main/resources/schema/jboss-deployment-scanner.xsd</a></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Comment by <a href="http://community.jboss.org/docs/DOC-16939">going to Community</a></p>
        <p style="margin: 0;">Create a new document in JBoss AS7 Development at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2225">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>