一、weblogic.Deployer所需的环境
1、在本机上安装WebLogic Server 软件;
2、添加WebLogic Server类到
CLASSPATH 环境变量中,并设置JDK的二进制执行目录到path环境变量中。我们可以使用
setWLSEnv.sh 或者
setWLSEnv.cmd 脚本帮助我们设置环境变量
如下:

然后手动把上面的CLASSPATH变量和path变量的值设置到系统环境变量中。右击我的电脑--->属性--->设置环境变量.......
这两个脚本存放在weblogic安装目录的
server/bin子目录下,例如:C:\app\Oracle\Middleware\wlserver_10.3\server\bin
二、调用weblogic.Deployer的语法
java [
SSL Arguments] weblogic.Deployer [
Connection Arguments] [
User Credentials Arguments] COMMAND-NAME command-options [
Common Arguments]
提示:命令和命令选项是不区分大小写的。
1、SSL参数:
java
[ -Dweblogic.security.TrustKeyStore=DemoTrust ]
[ -Dweblogic.security.JavaStandardTrustKeyStorePassPhrase=password ]
[ -Dweblogic.security.CustomTrustKeyStoreFileName=filename
-Dweblogic.security.TrustKeystoreType=jks
[-Dweblogic.security.CustomTrustKeyStorePassPhrase=password ]
]
[ -Dweblogic.security.SSL.hostnameVerifier=classname ]
[ -Dweblogic.security.SSL.ignoreHostnameVerification=true ]
weblogic.Deployer
[ User Credentials Arguments ]
COMMAND-NAME command-arguments
2、连接参数:
java [
SSL Arguments] weblogic.Deployer [-adminurl protocol://listen_address:port_number] [
User Credentials Arguments] COMMAND-NAME command-options [
Common Arguments]
Argument
|
Definition
|
-adminurl [protocol://]Admin-Server-listen-address:listen-port
|
Listen address and listen port of the Administration Server.
To use a port that is not secured by SSL, the format is
-adminurl [protocol]Admin-Server-listen-address:port
where
t3
,
http
,
iiop
, and
iiops
are valid protocols.
In order to use an adminurl with the HTTP protocol, you must enable the HTTP tunneling option in the Administration Console. For more information, see
Setting Up WebLogic Server for HTTP Tunneling
in Administering Server Environments for Oracle WebLogic Server. For instructions on enabling HTTP tunneling in the Administration Console, see
Configure HTTP protocol
in Oracle WebLogic Server Administration Console Online Help.
To use a port that is secured by SSL, the format is
-adminurl
secure-protocol://Admin-Server-listen-address:port
where
t3s
and
https
are valid secure protocols.
To connect to the Administration Server via a configured administration channel, you must specify a valid administration port number:
-adminurl
secure-protocol://Admin-Server-listen-address:domain-wide-admin-port
There is no default value for this argument.
|
3、用户认证参数:
java [
SSL Arguments ] weblogic.Deployer [
Connection Arguments] [ { -username username [-password password] } | [ -userconfigfile config-file [-userkeyfile admin-key] ] ] COMMAND-NAME command-options [
Common Arguments]
Argument
|
Definition
|
-username username
|
Administrator username. If you supply the
-username
option but you do not supply a corresponding
-password
option,
weblogic.Deployer
prompts you for the password.
|
-password password
|
Password of the administrator user.
To avoid having the plain text password appear in scripts or in process utilities such as
ps
, first store the username and encrypted password in a configuration file using the WebLogic Scripting Tool (WLST)
storeUserConfig
command as described in the WLST Command Reference for WebLogic Server. Omit both the
-username
and
-password
options to
weblogic.Deployer
to use the values stored in the default configuration file.
If you want to use a specific configuration file and key file, rather than the default files, use the
-userconfigfile
and
-userkeyfile
options to
weblogic.Deployer
.
|
-userconfigfile config-file
|
Location of a user configuration file to use for the administrative username and password. Use this option, instead of the
-user
and
-password
options, in automated scripts or in situations where you do not want to have the password shown on-screen or in process-level utilities such as
ps
. Before specifying the
-userconfigfile
attribute, you must first generate the file using the WebLogic Scripting Tool (WLST)
storeUserConfig
command as described in the WLST Command Reference for WebLogic Server.
|
-userkeyfile admin-key
|
Specifies the location of a user key file to use for encrypting and decrypting the username and password information stored in a user configuration file (the
-userconfigfile
option). Before specifying the
-userkeyfile
attribute, you must first generate the file using the WebLogic Scripting Tool (WLST)
storeUserConfig
command as described in the WLST Command Reference for WebLogic Server.
|
4、公共参数:
java [
SSL Arguments ] weblogic.Deployer [
Connection Arguments] [ { -username username [-password password] } | [ -userconfigfile config-file [-userkeyfile admin-key] ] ] COMMAND-NAME command-options [公共参数]
Argument Name
|
Description
|
-advanced
|
Prints full command-line help text for all
weblogic.Deployer
actions and options.
|
-debug
|
在标准输出中显示调试消息
|
-examples
|
Display example command lines for common tasks.
|
-help
|
Prints command-line help text for the most commonly used
weblogic.Deployer
actions and options.
|
-noexit
|
默认情况下,如果在命令处理期间引发异常,则weblogic.Deployer调用System.Exit(1)。
显示的退出值指示在部署操作期间发生的故障数。
加了 -noexit 后,将覆盖上述的行为。即不退出。
|
-noversion
|
Indicates that
weblogic.Deployer
should ignore all version related code paths on the Administration Server. This behavior is useful when deployment source files are located on Managed Servers (not the Administration Server) and you want to use the external_stage staging mode.
If you use this option, you cannot use versioned applications.
|
-nowait
|
weblogic.Deployer
prints the task ID and exits without waiting for the action to complete. This option initiates multiple tasks and then monitor them later with the
-list
action.
|
-output <raw | formatted>
|
(Deprecated.) Either
raw
or
formatted
to control the appearance of
weblogic.Deployer
output messages. Both output types contain the same information, but
raw
output does not contain embedded tabs. By default,
weblogic.Deployer
displays
raw
output.
|
-purgetasks
|
Indicates that
weblogic.Deployer
should flush out deployment tasks that are retired.
|
-remote
|
Indicates that
weblogic.Deployer
is not running on the same machine as the Administration Server, and that source paths specified in the command are valid for the Administration Server machine itself. If you do not use the
-remote
option,
weblogic.Deployer
assumes that all source paths are valid paths on the local machine.
|
-timeout seconds
|
Maximum time, in seconds, to wait for the deployment task to complete. After the time expires,
weblogic.Deployer
prints out the current status of the deployment and exits.
|
-verbose
|
Additional progress messages, including details about the prepare and activate phases of the deployment.
|
-version
|
Prints version information for
weblogic.Deployer
.
|
官方文档: