JBoss AS 7 disable hot deployment

*爱你&永不变心* 提交于 2020-01-01 09:18:16

问题


In previous versions you just disable the ScanEnabled attribute in conf/jboss-service.xml.

I am wondering how do you disable this on JBoss 7

Thanks


回答1:


You could just remove the deployment scanner subsystem.

Remove <extension module="org.jboss.as.deployment-scanner"/> and then remove the:

    <subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
        <deployment-scanner path="deployments" relative-to="jboss.server.base.dir" scan-interval="5000" auto-deploy-zipped="false" auto-deploy-exploded="false"/>
    </subsystem>

If you don't want to remove the subsystem, add auto-deploy-zipped="false" auto-deploy-exploded="false" to your <deployment-scanner/> tag.




回答2:


I was struggling with this today. While you can set auto-deploy-zip and auto-deploy-exploded both to false, this doesn't actually disable hot deploy, it just makes it so that you have to trigger hot deploy by touching a .dodeploy file to initiate it. Additionally, this requires that you touch a .dodeploy file for each artifact that you want to start after the container is started.

Reading over: https://community.jboss.org/wiki/TurnDeploymentScannerDown and this: https://docs.jboss.org/author/display/AS7/Deployment+Scanner+configuration I realized that the proper way to disable hot deploy is to set the scan-interval to a negative number, this causes the deployment scanner to run on startup only.




回答3:


Assuming you are running AS 7 in the standalone mode, you'll have to add the deployment-scanner sub-system configuration as shown below

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

References

https://community.jboss.org/wiki/DeployingAnApplicationFromAnExternalDeploymentLocation
https://docs.jboss.org/author/display/AS7/Application+deployment



回答4:


Whilst migration applications from JBoss 4 we had the same requirement. We set the scan-interval to 0 so the deployments directory is scanned at server startup only.

<subsystem xmlns="urn:jboss:domain:deployment-scanner:1.1">
  <deployment-scanner name="your-jboss6-deploymentscanner" path="${your.scan.dir}" scan-interval="0"/>
 </subsystem>

In the above your.scan.dir is set on the command line when we start the server.



来源:https://stackoverflow.com/questions/10212618/jboss-as-7-disable-hot-deployment

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!