[jboss-dev-forums] [JBoss AS7 Development] - Deploying an application from an external deployment location

jaikiran pai do-not-reply at jboss.com
Tue Jun 21 15:33:11 EDT 2011


jaikiran pai [http://community.jboss.org/people/jaikiran] created the document:

"Deploying an application from an external deployment location"

To view the document, visit: http://community.jboss.org/docs/DOC-16939

--------------------------------------------------------------
Just like previous versions ( http://community.jboss.org/docs/DOC-13241 AS5 and  http://community.jboss.org/docs/DOC-16444 AS6), JBoss AS7 allows you to deploy applications from an external deployment folder. i.e. you +don't+ 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.

h5. Standalone server:

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. 

* Stop the standalone server, if it is already running.
* Open the JBOSS_HOME/standalone/configuration/standalone.xml file in a text editor of your choice
* 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.
* Now let's add a new deployment-scanner which will look for deployments under the folder named /home/me/as7/mydeployments:

<deployment-scanner name="my-external-deployment-scanner" path="/home/jpai/as7/deployments" scan-interval="5000" />


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.

* With this addition, the susbsystem section will now look like:

<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.0">
    <deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir" path="deployments" />
    <deployment-scanner name="my-external-deployment-scanner" path="/home/jpai/as7/deployments" scan-interval="5000" />
</subsystem>


* Let's now save the changes in the standalone.xml file and start the standalone server:

jpai at jpai-laptop:bin$./standalone.sh


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).

For complete reference on what the deployment-scanner element configuration allows, take a look at the jboss-deployment-scanner.xsd here  https://github.com/jbossas/jboss-as/blob/master/deployment-scanner/src/main/resources/schema/jboss-deployment-scanner.xsd https://github.com/jbossas/jboss-as/blob/master/deployment-scanner/src/main/resources/schema/jboss-deployment-scanner.xsd
--------------------------------------------------------------

Comment by going to Community
[http://community.jboss.org/docs/DOC-16939]

Create a new document in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=102&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110621/9a95632d/attachment.html 


More information about the jboss-dev-forums mailing list