通過WLST實現weblogic的自動部署
阿新 • • 發佈:2019-01-01
前提條件:
1.狀態處於釋放配置;
2.執行的本機安裝了weblogic,並且將weblogic.jar新增到了CLASSPATH環境變數中;
自動部署:
java weblogic.Deployer -user weblogic -adminurl t3://10.1.73.7:8001 -password nclesb123 -deploy -name myweb-1.0-SNAPSHOT -upload -source target/myweb-1.0-SNAPSHOT.war(自動部署且自動啟動)
自動解除安裝:
java weblogic.Deployer -user weblogic -adminurl t3://10.1.73.7:8001 -password nclesb123 -undeploy -name myweb-1.0-SNAPSHOT (會自動停止並刪除,注意當應用不存在的時候會報錯)
針對更新系統上已經存在的應用可以先進行解除安裝操作,再進行部署操作,當然也可以直接用redeploy,下面的:
java weblogic.Deployer -user weblogic -adminurl t3://10.1.73.7:8001 -password nclesb123 -redeploy -name myweb-1.0-SNAPSHOT -upload -source target/myweb-1.0-SNAPSHOT.war(當應用不存在的時候也不報錯,並自動進行了部署)
參考:
Partially redeploy, for example, to update a JSP in a exploded webapp:java weblogic.Deployer -adminurl url -username username -password password
-name myapp -redeploy mywar/index.jsp
The path of JSP to be updated is relative to the root of the
application. If a directory is specified the entire subtree is updated.
Multiple servers sharing the same physical deployment:
java weblogic.Deployer -adminurl url -username username -password password
-name myapp -targets server1,server2 -nostage -deploy c:/myapps/myapp.ear
The -nostage option indicates that the application is available
on all target servers at the same path and hence server should not copy
files to the managed servers.