Apache Maven is a software tool for building and managing Java-based projects. WebLogic Server provides support for Maven through the provisioning of plug-ins that enable you to perform various operations on WebLogic Server from within a Maven environment. As of this release, there are two separate plug-ins available:
weblogic-maven-plugin
—Delivered in WebLogic Server 11g Release 1, provides support for deployment operations. For more information about this plug-in, see "Using the WebLogic Maven Plug-In for Deployment" in Deploying Applications to Oracle WebLogic Server.
wls-maven-plugin
—Delivered in WebLogic Server 12c, provides enhanced functionality to install, start and stop servers, create domains, execute WLST scripts, and compile and deploy applications. In addition to its shortened, easier to specify name, the extended functionality in the wls-maven-plugin
requires a local WebLogic Server installation, in contrast to the weblogic-maven-plugin
, which is generated as a standalone, self-contained JAR file. However, with the wls-maven-plugin
, you can install WebLogic Server from within your Maven environment to fulfill the local WebLogic Server requirement. For more information about this plug-in, see Configuring the WebLogic Development Maven Plug-In..
WebLogic Server supports both Maven 2.2.x and 3.0.x.
For detailed information on using Maven to build applications and projects, see the Maven Users Centre at http://maven.apache.org/users/index.html
.
The following sections describe using wls-maven-plugin
:
The wls-maven-plugin
is located in the MW_HOME
/wlserver_12.1/server/lib
directory, where MW_HOME
represents the top-level installation directory for all Fusion Middleware products installed on one machine; for example, c:\Oracle\Middleware
. The plug-in is provided as a pre-built JAR file and accompanying pom.xml
file:
MW_HOME
/wlserver_12.1/server/lib/wls-maven-plugin.jar
MW_HOME
/wlserver_12.1/server/lib/pom.xml
Follow these steps for installing and configuring wls-maven-plugin
:
For apache-maven-3.0.x:
From the following directory, MW_HOME
/wlserver_12.1/server/lib/
, install the plug-in in your local Maven repository with the following command:
mvn install -Dfile=wls-maven-plugin.jar -DpomFile=pom.xml
Provision the wls-maven-plugin.jar
in your local Maven repository under //depo/.m2/repository/com/oracle/weblogic/wls-maven-plugin
with the following command:
mvn install:install-file -Dfile=wls-maven-plugin.jar -DpomFile=pom.xml
The default pom.xml
file has the required settings for you to use the wls
goal prefix which is enabled by default. The prefix permits easier use of the plug-in.
<build>
<plugins>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.3</version>
<configuration>
<goalPrefix>wls</goalPrefix>
</configuration>
</plugin>
</plugins>
</build>
However, before doing so, you must edit the settings.xml
file in the $MAVEN_HOME/conf
directory, as follows. Add the following pluginGroup
element to the pluginGroups
XML stanza.
<pluginGroups>
<pluginGroup>com.oracle.weblogic</pluginGroup>
</pluginGroups>
You can validate whether you have successfully installed the plug-in using the help
goal, as follows:
mvn wls:help //for further information on all the goals
or
mvn wls:help -Dgoal=GOAL_NAME -Ddetail=true //For example: -Dgoal=start-server
The help goal will display the list of goals available in the wls-maven-plugin
if you have successfully installed the plug-in.
For information about the plug-in goals, refer to Maven Plug-In Goals.
If you do not intend to use the prefix, or if it is not set up properly, you can always use the full coordinates, for example:
mvn com.oracle.weblogic:wls-maven-plugin:help
For apache-maven-2.2.x:
From the following directory, MW_HOME
/wlserver_12.1/server/lib/
, install the plug-in in your local Maven repository with the following command:
mvn install
Provision the wls-maven-plugin.jar
in your local Maven repository under //depo/.m2/repository/com/oracle/weblogic/wls-maven-plugin
with the following command:
mvn install:install-file -Dfile=wls-maven-plugin.jar -DpomFile=pom.xml
The default pom.xml
file has the required settings for you to use the wls
goal prefix which is enabled by default. The prefix permits easier use of the plug-in.
<build>
<plugins>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>2.3</version>
<configuration>
<goalPrefix>wls</goalPrefix>
</configuration>
</plugin>
</plugins>
</build>
However, before doing so, you must edit the Maven settings.xml
file in the $MAVEN_HOME/conf
directory, as follows. Add the following pluginGroup
element to the pluginGroups
XML stanza.
<pluginGroups>
<pluginGroup>com.oracle.weblogic</pluginGroup>
</pluginGroups>
You can validate whether you have successfully installed the plug-in using the help
goal, as follows:
mvn wls:help //for further information on all the goals
or
mvn wls:help -Dgoal=GOAL_NAME -Ddetail=true //For example: -Dgoal=start-server
The help goal will display the list of goals available in the wls-maven-plugin
if you have successfully installed the plug-in.
For information about the plug-in goals, refer to Maven Plug-In Goals.
If you do not intend to use the prefix, or if it is not set up properly, you can always use the full coordinates, for example:
mvn com.oracle.weblogic:wls-maven-plugin:help
Example 3-1 illustrates a basic Java EE 6 Web application pom.xml
file that enables the use of the wls-maven-plugin
.
Example 3-1 Basic Configuration pom.xml File
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>demo.sab</groupId>
<artifactId>maven-demo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>maven-demo</name>
<properties>
<endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-web-api</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
...
...
<!-- WebLogic Server 12c Maven Plugin -->
<plugin>
<groupId>com.oracle.weblogic</groupId>
<artifactId>wls-maven-plugin</artifactId>
<version>12.1.1.0</version>
</plugin>
</plugins>
</build>
</project>
The wls-maven-plugin
follows the Maven theme and uses a convention-over-configuration approach. Thus, for a set of commonly used configuration elements, the plug-in supplies an appropriate, consistent set of default values that you can use across all of the goals. This reduces the degree of configuration required for you to use the plug-in and helps you to achieve uniform goal executions, even in different environments. The common configuration elements and their default values are:
middlewareHome
: ${basedir}/Oracle/Software
, where ${basedir}
is the standard Maven project property which represents the directory containing the current Maven project.
weblogicHome
: wlserver
or wlserver_12.1
depending on the install type.
domainHome
: ${basedir}/Oracle/Domains
source
: ${project.build.directory}/${project.artifactId}.${project.packaging}
adminurl
: t3://localhost:7001
Even though these configuration parameters have default values, you can override them in a pom.xml
file or on the command line, as needed. However, because of the default values, you can leave these parameters out of the configuration stanzas and thus, use them consistently across all of the goals.
For example, you can issue the following commands that all use the same WebLogic Server installation and domain parameters without specifying any repetitive values:
$ mvn wls:install -DartifactLocation=/Users/myUser/Downloads/wls/wls_1211/wls1211_dev.zip $ mvn wls:create-domain –Duser=weblogic –Dpassword=welcome1 $ mvn wls:start-server
Table 3-1 lists all the wls-maven-plugin
goals.
Goal Name | Description |
---|---|
Generates and compiles the classes needed to deploy EJBs and JSPs to WebLogic Server. Also validates the deployment descriptors for compliance with the current specifications at both the individual module level and the application level. |
|
Creates a domain for WebLogic Server using the default domain template. For more complex domain creation, use the |
|
Deploys WebLogic Server applications and modules. Supports all deployment formats; for example, WAR, JAR, and such. |
|
Lists all the goals supported by the |
|
Installs WebLogic Server. |
|
Lists the deployment names for applications and standalone modules deployed, distributed, or installed in the domain. |
|
Redeploys a running application or part of a running application. |
|
Starts an application deployed on WebLogic Server. |
|
Starts WebLogic Server. |
|
Stops an application. |
|
Stops WebLogic Server. |
|
Undeploys the application from WebLogic Server. Stops the deployment unit and removes staged files from target servers. |
|
Updates an application's deployment plan by redistributing the plan files and reconfiguring the application based on the new plan contents. |
|
WLST wrapper for Maven. |
com.oracle.weblogic:wls-maven-plugin:appc
wls:appc
Generates and compiles the classes need to deploy EJBs and JSPs to WebLogic Server. Also validates the deployment descriptors for compliance with the current specifications at both the individual module level and the application level.
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies the path to an alternative Java EE application deployment descriptor. |
|
|
false |
Specifies the path to an alternative WebLogic Server application deployment descriptor. |
|
|
false |
When true, does not include deployment descriptors in client JARs generated for EJBs. |
|
|
false |
Specifies a list of comma-separated directories that comprise the desired |
|
|
false |
Specifies a directory where generated client JARs will be written. |
|
|
false |
When true, causes the JSP compiler to include comments from the JSP in the generated HTML page. Otherwise, the JSP comments do not appear in the generated HTML page. |
|
|
false |
Specifies the Java compiler for compiling class files from the generated Java source code. The Java compiler program should be in your |
|
|
false |
The class that invokes the compiler. |
|
|
false |
When true, continues compilation even when there are errors in the JSP files. |
|
|
false |
When true, compiles debugging information into class files. |
|
|
false |
When true, warns about the use of deprecated methods in the generated Java source file when compiling the source file into a class file. |
|
|
false |
Specifies the directory where compiled class files are written. Use this parameter to place compiled classes in a directory that is already in your |
|
|
false |
When true, generates WLS stubs and skeletons for EJBs. |
|
|
false |
When true, forces the generation of EJB and JSP classes. Otherwise, the classes will not be regenerated if it is determined to be unnecessary. |
|
|
false |
When true, generates IDL for EJB remote interfaces. |
|
|
false |
Specifies the directory where IDL files will be written. |
|
|
false |
When true, generates factory methods for valuetypes. |
|
|
false |
Specifies the method signatures used to trigger IDL code generation. |
|
|
false |
When true, does not generate abstract interfaces and methods or attributes that contain them. |
|
|
false |
Does not generate valuetypes or the methods and attributes that contain them. |
|
|
false |
When true, generates IDL somewhat compatible with Orbix 2000 2.0 C++. |
|
|
false |
When true, overwrites existing IDL files. |
|
|
false |
When true, displays additional status information for IDL generation. |
|
|
false |
When true, generates IDL somewhat compatible witih Visibroker 4.5 C++. |
|
|
false |
When true, ignores the plan file if it does not exist. |
|
|
false |
When true, generates CORBA stubs for EJBs. |
|
|
false |
Specifies the directory where IIOP stub files will be written. |
|
|
false |
When true, preserves the generated |
|
|
false |
A comma-separated list of libraries. |
|
|
false |
Registers all the files in the specified directory as libraries. |
|
|
false |
When true, adds JSP line numbers to generated class files to aid in debugging. |
|
|
false |
Includes manifest information from specified manifest file. |
|
|
false |
Specifies the maximum number of generated Java files to be compiled at one time. |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
When true, does not exit from the execution of the |
|
|
false |
When true, passes flags to Symantec's |
|
|
false |
When true, suppresses compiler warnings. |
|
|
false |
When true, sends the output to |
|
|
false |
When true, compiles with optimization on. |
|
|
false |
Specifies an alternate output archive or directory. When not set, the output is placed in the source archive or directory. |
|
|
false |
Specifies the path to an optional deployment plan. |
|
|
false |
When true, turns off output except for errors. |
|
|
false |
Passes a list of options to the compiler. |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
false |
Specifies the path to the source files. |
|
|
false |
Limits the compatibility of the Java files to a JDK no higher than specified. For example "1.5". |
|
|
false |
Specifies whether to include the compiled output directory in your |
|
|
false |
Specifies the minimum level of the JVM required to run the compiled class files. For example, "1.5". |
|
boolean |
false |
When true, displays additional status information during the compilation process. |
|
|
false |
When true, enables verbose output from the Java compiler. |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
|
|
false |
When true, writes out the descriptors with inferred information including annotations. |
The appc
goal executes the WebLogic Server application compiler utility to prepare an application for deployment. This goal benefits from the convention-over-configuration approach, allowing you to execute it using the defaults of the project. Example 3-2 shows typical appc
goal output. Note that this example uses the –verbose
option to highlight the activities the appc
utility is performing; this is not typically necessary.
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:appc -Dverbose [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building maven-demo 1.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- wls-maven-plugin:12.1.1.0:appc (default-cli) @ maven-demo --- [INFO] ++====================================================================++ [INFO] ++ wls-maven-plugin: appc ++ [INFO] ++====================================================================++ <Nov 23, 2011 4:43:08 PM CST> <Info> <J2EE> <BEA-160230> <Created working directory: /var/folders/cL/cLTyZKXjGgmQhEpoV+U-DE+++TI/-Tmp-/appcgen_1322028788639_maven-demo.war> [JspcInvoker]Checking web app for compliance. [jspc] -webapp specified, searching . for JSPs [jspc] Compiling /index.jsp <Nov 23, 2011 4:43:12 PM CST> <Info> <J2EE> <BEA-160220> <Compilation completed successfully.> [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 5.281s [INFO] Finished at: Wed Nov 23 16:43:12 CST 2011 [INFO] Final Memory: 16M/81M [INFO] ------------------------------------------------------------------------
com.oracle.weblogic:wls-maven-plugin:create-domain
wls:create-domain
Creates a domain for WebLogic Server using the default domain template. For more complex domain creation, use the wlst
goal.
Table 3-3 create-domain Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies the path to the WebLogic Server domain. |
|
|
false |
Specifies the domain template file to use to create the domain. The default domain template included with WebLogic Server is used when this parameter is not specified. |
|
|
false |
When |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
true |
Specifies the administrative password. |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
true |
Specifies the administrative user name. |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
Use the create-domain
goal to create a WebLogic Server domain from a specified WebLogic Server installation. You specify the location of the domain using the optional domainHome
configuration parameter, which by default is set to ${basedir}/Oracle/Domains
. As such, the domain will be created in an Oracle/Domains
subdirectory of your Maven project root directory.
You specify the location of the WebLogic Server installation using the optional middlewareHome
configuration parameter which is set to ${basedir}/Oracle/Software
by default. If you used the default location to execute the install
goal, you can omit specifying middlewareHome
in the create-domain
goal.
When creating a domain, a user name and password are required. You can specify these using the user
and password
configuration parameters or by specifying them on the command line.
<!-- WebLogic Server 12c Maven Plugin --> <plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>wls-maven-plugin</artifactId> <version>12.1.1.0</version> <configuration> <artifactLocation> com.oracle.weblogic:wls-dev:zip:12.1.1.0 </artifactLocation> <user>weblogic</user> <password>welcome1</password> </configuration> </plugin>
Example 3-3 shows typical command output from the execution of the create-domain
goal.
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:create-domain [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building maven-demo 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- wls-maven-plugin:12.1.1.0:create-domain (default-cli) @ maven-demo --- [INFO] ++====================================================================++ [INFO] ++ wls-maven-plugin: create-domain ++ [INFO] ++====================================================================++ [INFO] Domain creation script: readTemplate('/Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software/wlserver/common/templates/domains/wls.jar') cd('/Security/base_domain/User/weblogic') set('Name', 'weblogic') set('Password', '***') writeDomain('/Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Domains/mydomain') [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 39.345s [INFO] Finished at: Wed Nov 23 16:01:13 CST 2011 [INFO] Final Memory: 24M/81M [INFO] ------------------------------------------------------------------------
Unless you specify the domainHome
configuration parameter, the domain will be created in the ${basedir}/Oracle/Domains
directory of your Maven project, as shown below:
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ ls -l Oracle/Domains/mydomain
total 16
drwxr-xr-x 3 myuser staff 102 23 Nov 16:01 autodeploy
drwxr-xr-x 10 myuser staff 340 23 Nov 16:01 bin
drwxr-xr-x 10 myuser staff 340 23 Nov 16:01 config
drwxr-xr-x 3 myuser staff 102 23 Nov 16:01 console-ext
-rw-r--r-- 1 myuser staff 462 23 Nov 16:01 fileRealm.properties
drwxr-xr-x 7 myuser staff 238 23 Nov 16:01 init-info
drwxr-xr-x 3 myuser staff 102 23 Nov 16:01 lib
drwxr-xr-x 6 myuser staff 204 23 Nov 16:01 security
drwxr-xr-x 3 myuser staff 102 23 Nov 16:01 servers
-rwxr-x--- 1 myuser staff 293 23 Nov 16:01 startWebLogic.sh
com.oracle.weblogic:wls-maven-plugin:deploy
wls:deploy
Deploys WebLogic Server applications and modules. Supports all deployment formats; for example, WAR, JAR, RAR, and such.
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
When true, displays debug-level messages to the standard output. |
|
|
false |
When true, enables validation of security data. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, indicates that the user wants to copy the application in the server staging area externally or using a third-party tool. When specified, WebLogic Server looks for the application under |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, does not copy the deployment files to target servers, but leaves them in a fixed location, specified by the |
|
|
false |
When true, ignores all version related code paths on the Administration Server. |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the path to the deployment plan. |
|
|
false |
When true, eliminates retired deployment tasks. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Specifies the number of seconds before WebLogic Server undeploys the currently-running version of this application or module so that clients can start using a new version. When not specified, a graceful retirement policy is assumed. |
|
|
false |
Specifies the security model to be used for this deployment, overriding the default security model for the security realm. Possible values are: |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
false |
Specifies the archive file or exploded archive directory to deploy. This can be one of the following: a file, directory, or exploded archive on the local system, or a colon (:) separated list of Maven coordinates of the form ( |
|
|
false |
When true, indicates that the application needs to be copied into the target server staging area before deployment. |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. |
|
|
false |
Specifies a comma-separated list of targets for the current operation. When not specified, all configured targets are used. For a new application, the default target is the Administration Server. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of |
|
|
false |
When true, copies the source files to the Administration Server's upload directory prior to deployment. Use this setting when running the plug-in remotely (using the |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information. |
|
|
false |
When true, prints the version information. |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
Use this goal to deploy an application. By using the convention-over-configuration approach, the default values available for middlewareHome
, adminurl
, and the source
file to deploy, allow you to execute the deploy
goal without any additional configuration, as shown below:
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:deploy
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:deploy (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++ wls-maven-plugin: deploy ++
[INFO] ++====================================================================++
weblogic.Deployer invoked with options: -noexit -user weblogic -deploy -source /Users/myuser/Projects/Java/wls-maven-doc/maven-demo/target/maven-demo.war
<Nov 23, 2011 4:36:51 PM CST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, maven-demo [archive:
/Users/myuser/Projects/Java/wls-maven-doc/maven-demo/target/maven-demo.war],
to configured targets.>
Task 0 initiated: [Deployer:149026]deploy application maven-demo on AdminServer.
Task 0 completed: [Deployer:149026]deploy application maven-demo on AdminServer.
Target state: deploy completed on Server AdminServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.803s
[INFO] Finished at: Wed Nov 23 16:36:52 CST 2011
[INFO] Final Memory: 6M/81M
[INFO] ------------------------------------------------------------------------
com.oracle.weblogic:wls-maven-plugin:help
wls:help
Lists all the goals supported by the wls-maven-plugin
.
com.oracle.weblogic:wls-maven-plugin:install
wls:install
Installs WebLogic Server.
Name | Type | Required | Description |
---|---|---|---|
|
|
true |
Specifies the address of the installation. The address can be one of the following: a colon (:) separated list of Maven coordinates of the form: |
|
|
true |
Specifies the absolute path of a local Maven repository. |
|
|
false |
Specifies the path to the WebLogic Server domain. |
|
|
false |
Installs the product with an executable installer. The following macros are supported: |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
Use this goal to install WebLogic Server into a local directory so it can be used to execute other goals, as well as to create a WebLogic Server domain for deploying and testing the application represented as the Maven project.
This goal installs WebLogic Server using a specified installation distribution. You specify the location of the distribution using the artifactLocation
configuration parameter, which can be the location of the distribution as a file on the file system; an HTTP URL which can be accessed; or a Maven coordinate of the distribution installed in a Maven repository. Specify the artifactLocation
configuration element in the wls-maven-plugin
section of the pom.xml
file, or by using the –DartifactLocation
property when invoking Maven.
You specify the target directory for the installation using the optional middlewareHome
configuration parameter which is set to ${basedir}/Oracle/Software
by default, where ${basedir}
is the standard Maven project property which represents the directory containing the current Maven project. By specifying a middlewareHome
value, you direct the installation to be performed in the specified location.
For example, if you want to install a WebLogic Server ZIP file distribution, you can specify the location of the ZIP distribution as one of the following:
A local file reference—For a local file reference, specify the path on the local file system:
<!-- WebLogic Server 12c Maven Plugin --> <plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>wls-maven-plugin</artifactId> <version>12.1.1.0</version> <configuration> <artifactLocation> /Users/myuser/Downloads/wls/wls_1211/wls1211_dev.zip </artifactLocation> </configuration> </plugin>
Typical command output is like the following:
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:install (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++ wls-maven-plugin: install ++
[INFO] ++====================================================================++
[INFO] Installing /Users/myuser/Downloads/wls/wls_1211/wls1211_dev.zip into
/Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software
[INFO] Installing the product, this may take some time.
[INFO] Executing: [cmd:[/bin/bash, -c, chmod +x ./configure.sh; ./configure.sh]]
[INFO] Process being executed, waiting for completion.
[INFO] [exec] **************************************************
[INFO] [exec] WebLogic Server 12c (12.1.1.0) Zip Configuration
[INFO] [exec]
[INFO] [exec] MW_HOME: /Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software
[INFO] [exec] JAVA_HOME: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
[INFO] [exec] **************************************************
...
...
...
[INFO] [exec] BUILD SUCCESSFUL
[INFO] [exec] Total time: 0 seconds
[INFO] [configure script] exit code: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:53.210s
[INFO] Finished at: Wed Nov 23 15:46:53 CST 2011
[INFO] Final Memory: 3M/81M
[INFO] ------------------------------------------------------------------------
A URL reference
<!-- WebLogic Server 12c Maven Plugin --> <plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>wls-maven-plugin</artifactId> <version>12.1.1.0</version> <configuration> <artifactLocation> http://adc2101001.us.oracle.com:7001/bea_wls_internal/wls1211_dev.zip </artifactLocation> </configuration> </plugin>
Typical command output is like the following:
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:install [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building maven-demo 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- wls-maven-plugin:12.1.1.0:install (default-cli) @ maven-demo --- [INFO] ++====================================================================++ [INFO] ++ wls-maven-plugin: install ++ [INFO] ++====================================================================++ [INFO] Installing http://adc2101001.us.oracle.com:7001/bea_wls_internal/wls1211_dev.zip into /Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software [INFO] Attempt to download artifact from maven repo failed - Artifact not found [INFO] Attempt to download the weblogic server instance directly from url. [INFO] Downloading the file ... ... ... ... [INFO] [exec] BUILD SUCCESSFUL [INFO] [exec] Total time: 0 seconds [INFO] [configure script] exit code: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4:23.710s [INFO] Finished at: Wed Nov 23 15:53:21 CST 2011 [INFO] Final Memory: 3M/81M [INFO] ------------------------------------------------------------------------
A Maven artifact—In this case, the distribution is retrieved from the local Maven repository itself. This means that it needs to have been previously installed into the local repository or pulled over from a remote repository.
For example, to install wls1211-dev.zip
into a Maven repository, use a command like the following:
myuser:~ $ mvn install:install-file -Dfile=wls1211_dev.zip -DgroupId=com.oracle.weblogic -DartifactId=wls-dev -Dpackaging=zip -Dversion=12.1.1.0
Typical command output is like the following:
[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ standalone-pom --- [INFO] Installing /Users/myuser/Downloads/wls/wls_1211/wls1211_dev.zip to /Users/myuser/.m2/repository/com/oracle/weblogic/wls-dev/12.1.1.0/wls-dev-12.1.1.0.zip [INFO] Installing /var/folders/cL/cLTyZKXjGgmQhEpoV+U-DE+++TI/-Tmp-/mvninstall7575420374983698784.pom to /Users/myuser/.m2/repository/com/oracle/weblogic/wls-dev/12.1.1.0/wls-dev-12.1.1.0.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 11.089s [INFO] Finished at: Wed Nov 23 15:30:17 CST 2011 [INFO] Final Memory: 3M/81M [INFO] ------------------------------------------------------------------------
This command installed wls1211-dev.zip
as a Maven artifact with the following coordinates:
com.oracle.weblogic:wls-dev:zip:12.1.1.0
To use this Maven artifact as the WebLogic Server distribution to install, the plug-in configuration will look like the following:
<!-- WebLogic Server 12c Maven Plugin --> <plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>wls-maven-plugin</artifactId> <version>12.1.1.0</version> <configuration> <artifactLocation> com.oracle.weblogic:wls-dev:zip:12.1.1.0 </artifactLocation> </configuration> </plugin>
Typical output from the execution of the install
goal is shown below:
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:install [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building maven-demo 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- wls-maven-plugin:12.1.1.0:install (default-cli) @ maven-demo --- [INFO] ++====================================================================++ [INFO] ++ wls-maven-plugin: install ++ [INFO] ++====================================================================++ [INFO] Installing com.oracle.weblogic:wls-dev:zip:12.1.1.0 into /Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software [INFO] Installing the product, this may take some time. [INFO] Executing: [cmd:[/bin/bash, -c, chmod +x ./configure.sh; ./configure.sh]] [INFO] Process being executed, waiting for completion. [INFO] [exec] ************************************************** [INFO] [exec] WebLogic Server 12c (12.1.1.0) Zip Configuration [INFO] [exec] [INFO] [exec] MW_HOME: /Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software [INFO] [exec] JAVA_HOME: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home [INFO] [exec] ************************************************** [INFO] [exec] ... ... ... [INFO] [exec] [INFO] [exec] Your environment has been set. [INFO] [exec] [INFO] [exec] BUILD SUCCESSFUL [INFO] [exec] Total time: 0 seconds [INFO] [configure script] exit code: 0 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1:57.549s [INFO] Finished at: Wed Nov 23 15:35:32 CST 2011 [INFO] Final Memory: 4M/81M [INFO] ------------------------------------------------------------------------
Unless you specify the middlewareHome
configuration parameter, the installation is performed in the default, ${basedir}/Oracle/Software
directory.
For example:
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ ls -l total 8 drwxr-xr-x 3 myuser staff 102 23 Nov 15:44 Oracle -rw-r--r-- 1 myuser staff 3597 23 Nov 15:43 pom.xml drwxr-xr-x 3 myuser staff 102 23 Nov 15:03 src myuser:~/Projects/Java/wls-maven-doc/maven-demo $ ls -l Oracle/Software/ total 64 -rw-r--r-- 1 myuser staff 5808 23 Nov 15:45 README.txt -rw-r--r-- 1 myuser staff 3064 23 Nov 15:45 configure.cmd -rwxr-xr-x 1 myuser staff 2857 23 Nov 15:45 configure.sh -rw-r--r-- 1 myuser staff 3189 23 Nov 15:45 configure.xml -rw-r--r-- 1 myuser staff 133 23 Nov 15:45 domain-registry.xml drwxr-xr-x 508 myuser staff 17272 23 Nov 15:46 modules -rw-r--r-- 1 myuser staff 1138 23 Nov 15:45 registry.template -rw-r--r-- 1 myuser staff 1320 23 Nov 15:46 registry.xml drwxr-xr-x 3 myuser staff 102 23 Nov 15:45 utils drwxr-xr-x 7 myuser staff 238 23 Nov 15:46 wlserver
com.oracle.weblogic:wls-maven-plugin:list-apps
wls:list-apps
Lists the deployment names for applications and standalone modules deployed, distributed, or installed in the domain.
Table 3-7 list-apps Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
When true, displays debug-level messages to the standard output. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
When true, ignore all version-related code paths on the Administration Server. |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
|
|
false |
Specifies the administrative password. |
|
|
false |
When true, eliminates retired deployment tasks. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of -1 means wait forever. |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information. |
|
|
false |
When true, prints the version information. |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
com.oracle.weblogic:wls-maven-plugin:redeploy
wls:redeploy
Redeploys a running application or part of a running application.
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. |
|
|
false |
Removes the files specified in this parameter while leaving the application activated. This parameter is valid only for unarchived deployments. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the path to the deployment plan. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Specifies the number of seconds before WebLogic Server undeploys the currently running version of this application or module so that clients can start using a new version. When not specified, a graceful retirement policy is assumed. |
|
|
false |
Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
false |
Specifies the archive file or exploded archive directory to deploy. This can be one of the following: a file, directory, or exploded archive on the local system, or a colon (:) separated list of Maven coordinates of the form ( |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. |
|
|
false |
Specifies a comma-separated list of targets for the current operation. When not specified, all configured targets are used. For a new application, the default target is the Administration Server. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of -1 means wait forever. |
|
|
false |
When true, copies the specified source files to the Administration Server's |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information during the deployment process. |
|
|
false |
When true, prints the version information. |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
com.oracle.weblogic:wls-maven-plugin:start-app
wls:start-app
Starts an application deployed on WebLogic Server.
Table 3-9 start-app Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
When true, switches the application to administration mode so that it accepts only administration requests via a configured administration channel. When false, production mode is assumed. |
|
|
false |
Specifies the listen address and listen port of the Administration Server. |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed. |
|
|
false |
When true, displays debug-level messages to the standard output. |
|
|
false |
Specifies the path to the WebLogic Server domain. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, ignores all version-related code paths on the Administration Server. |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
password |
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed. |
|
|
false |
When true, eliminates retired deployment tasks. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Specifies the number of seconds before WebLogic Server undeploys the currently running version of this application or module so that clients can start using a new version. When not specified, a graceful retirement policy is assumed. |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. |
|
|
false |
Specifies a comma-separated list of targets for the current operation. When not specified, all configured targets are used. For a new application, the default target is the Administration Server. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information during the deployment process. |
|
|
false |
When true, prints the version information. |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
com.oracle.weblogic:wls-maven-plugin:start-server
wls:start-server
Starts WebLogic Server.
Table 3-10 start-server Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies the script to start WebLogic Server. If this parameter is not specified, it will default to either |
|
|
false |
Specifies the path to the WebLogic Server domain. |
|
|
false |
Specifies the URL that, when pinged, will verify that the server is running. |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
false |
Specifies in seconds, the timeout for the script. Valid when the |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
The start-server
goal executes a startWebLogic
command on a given domain, starting the WebLogic Server instance. This goal also uses the middlewareHome
and domainHome
configuration parameters to specify the location of the WebLogic Server installation and domain to use. If you have followed the convention-over-configuration approach and kept the default values when installing the server and creating a domain, you need not re-specify these configuration parameters. However, if you installed WebLogic Server or created a domain in a different location, you must specify the location using the middlewareHome
and domainHome
configuration elements in the pom.xml
file or as parameters on the command line.
Using the convention-over-configuration approach, you can start the default domain ${basedir}/Oracle/Domains/mydomain
using the WebLogic Server installation in ${basedir}/Oracle/Software
as shown below:
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:start-server [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building maven-demo 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- wls-maven-plugin:12.1.1.0:start-server (default-cli) @ maven-demo --- [INFO] ++====================================================================++ [INFO] ++ wls-maven-plugin: start-server ++ [INFO] ++====================================================================++ .[INFO] Starting server in domain /Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Domains/mydomain [INFO] Check stdout file for details: /Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Domains/mydomain/server-2388282492279558044.out [INFO] Process being executed, waiting for completion. ......... [INFO] Server started successful [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 9.137s [INFO] Finished at: Wed Nov 23 16:23:07 CST 2011 [INFO] Final Memory: 4M/81M [INFO] ------------------------------------------------------------------------
com.oracle.weblogic:wls-maven-plugin:stop-app
wls:stop-app
Stops an application.
Table 3-11 stop-app Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
When true, switches the application to administration mode so that it accepts only administration requests via a configured administration channel. When false, production mode is assumed. |
|
|
false |
Specifies the listen address and listen port of the Administration Server. |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed. |
|
|
false |
When true, displays debug-level messages to the standard output. |
|
|
false |
Specifies the path to the WebLogic Server domain. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. |
|
|
false |
When true, stops the application after existing |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
When true, ignores pending |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, ignores all version-related code paths on the Administration Server. |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed. |
|
|
false |
When true, eliminates retired deployment tasks. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. |
|
|
false |
Specifies a comma-separated list of targets for the current operation. When not specified, all configured targets are used. For a new application, the default target is the Administration Server. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information. |
|
|
false |
When true, prints the version information. |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
com.oracle.weblogic:wls-maven-plugin:stop-server
wls:stop-server
Stops WebLogic Server.
Table 3-12 stop-server Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. |
|
|
false |
Specifies the script to stop WebLogic Server. This will default to |
|
|
false |
Specifies the path to the WebLogic Server domain. |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
Specifies the log file to which the script output will be redirected. When not specified, it defaults to |
|
|
true |
Specifies the administrative password. |
|
|
false |
Specifies, in seconds, the timeout for the script. This is valid when the |
|
|
true |
Specifies the administrative user name. |
|
|
false |
When true, the plug-in should wait for the script to complete. |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
|
|
false |
Specifies the working directory for the script. If you do not specify this attribute, it defaults to the current working directory. |
The stop-server
goal stops a server instance using the stopWebLogic
script in the specified domain, as shown below:
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:stop-server -DmiddlewareHome=$MW_HOME -Duser=weblogic -Dpassword=welcome1 -DdomainHome=/Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Domains/mydomain [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building maven-demo 1.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- wls-maven-plugin:12.1.1.0:stop-server (default-cli) @ maven-demo --- [INFO] ++====================================================================++ [INFO] ++ wls-maven-plugin: stop-server ++ [INFO] ++====================================================================++ [INFO] Stop server in domain: /Users/myuser/Projects/Java/wls-maven-doc/maven-demo/Oracle/Domains/mydomain [INFO] Process being executed, waiting for completion. [INFO] [exec] Stopping Weblogic Server... [INFO] [exec] [INFO] [exec] Initializing WebLogic Scripting Tool (WLST) ... [INFO] [exec] [INFO] [exec] Welcome to WebLogic Server Administration Scripting Shell [INFO] [exec] [INFO] [exec] Type help() for help on available commands [INFO] [exec] [INFO] [exec] Connecting to t3://localhost:7001 with userid weblogic ... [INFO] [exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'mydomain'. [INFO] [exec] [INFO] [exec] Warning: An insecure protocol was used to connect to the [INFO] [exec] server. To ensure on-the-wire security, the SSL port or [INFO] [exec] Admin port should be used instead. [INFO] [exec] [INFO] [exec] Shutting down the server AdminServer with force=false while connected to AdminServer ... [INFO] [exec] WLST lost connection to the WebLogic Server that you were [INFO] [exec] connected to, this may happen if the server was shutdown or [INFO] [exec] partitioned. You will have to re-connect to the server once the [INFO] [exec] server is available. [INFO] [exec] Disconnected from weblogic server: AdminServer [INFO] [exec] Disconnected from weblogic server: [INFO] [exec] [INFO] [exec] [INFO] [exec] Exiting WebLogic Scripting Tool. [INFO] [exec] [INFO] [exec] Done [INFO] [exec] Stopping Derby Server... [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 8.921s [INFO] Finished at: Wed Nov 23 16:41:14 CST 2011 [INFO] Final Memory: 4M/81M [INFO] ------------------------------------------------------------------------
com.oracle.weblogic:wls-maven-plugin:undeploy
wls:undeploy
Undeploys the application from WebLogic Server. Stops the deployment unit and removes staged files from target servers.
Table 3-13 undeploy Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed. |
|
|
false |
When true, displays debug-level messages to the standard output. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. |
|
|
false |
When true, stops the application after existing |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
When true, ignores pending |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, ignores all version-related code paths on the Administration Server. |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed. |
|
|
false |
When true, eliminates retired deployment tasks. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. |
|
|
false |
Specifies a comma-separated list of targets for the current operation. When not specified, all configured targets are used. For a new application, the default target is the Administration Server. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information during the deployment process. |
|
|
false |
When true, prints the version information. |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
com.oracle.weblogic:wls-maven-plugin:update-app
wls:update-app
Updates an application's deployment plan by redistributing the plan files and reconfiguring the application based on the new plan contexts.
Table 3-14 update-app Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed. |
|
|
false |
When true, displays debug-level messages to the standard output. |
|
|
false |
Specifies the path to the WebLogic Server domain. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, ignores all version-related code paths on the Administration Server. |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the location of the deployment plan. |
|
|
false |
Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed. |
|
|
false |
When true, eliminates retired deployment tasks. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. |
|
|
false |
Specifies a comma-separated list of targets for the current operation. When not specified, all configured targets are used. For a new application, the default target is the Administration Server. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of |
|
|
false |
When true, copies the source files to the Administration Server's upload directory prior to deployment. Use this setting when running the plug-in remotely (using the |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information. |
|
|
false |
When true, prints the version information. |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
com.oracle.weblogic:wls-maven-plugin:wlst
wls:wlst
WLST wrapper for Maven.
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies a string value containing command-line arguments to pass to the WLST Python interpreter. The arguments are delimited by spaces. An argument that contains embedded spaces should be quoted either with single quotes or with escaped double quotes. For example, here is a string for args that contains two parameters: "'Thomas Paine' \"Now is the time that tries men's souls.\"" |
|
|
false |
When true, displays additional status information. |
|
|
false |
When true, specifies whether a script, if supplied, executes before or after the file, if supplied. Either a file or a script is required, and both are allowed. See |
|
|
false |
When true, the Maven build fails if the |
|
|
false |
Specifies the file path of the WLST Python script to execute. Either a |
|
|
false |
Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation. |
|
|
false |
Specifies the path to a Java properties file. The property names become defined variables in the WLST Python interpreter and are initialized to the values supplied. For example, if the properties file contains the line |
|
|
false |
Specifies an inline WLST Python script, for example, " |
|
|
false |
Adds additional JARs and directories to the classpath making the resources and classes they contain available to the |
|
|
false |
Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the |
The wlst
goal enables the WebLogic Scripting Tool (WLST) to be used to execute scripts that configure resources or perform other operations on a WebLogic Server domain. The wlst
Maven goal uses the WebLogic Server WLST standard environment so you can use it with all your existing WLST scripts.
Again benefitting from the convention-over-configuration approach, you need not specify middlewareHome
and domainHome
locations when using the default locations.
You can use the wlst
goal to execute an external WLST script specified with the fileName
configuration parameter or you can specify a sequence of WLST commands within the pom.xml
file using the script
configuration element.
<!-- WebLogic Server 12c Maven Plugin -->
<plugin>
<groupId>com.oracle.weblogic</groupId>
<artifactId>wls-maven-plugin</artifactId>
<version>12.1.1.0</version>
<configuration>
<artifactLocation>
com.oracle.weblogic:wls-dev:zip:12.1.1.0
</artifactLocation>
<user>weblogic</user>
<password>welcome1</user>
<filename>create-datasource.py</fileName>
</configuration>
</plugin>
Example 3-4 shows typical wlst
goal output.
myuser:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:wlst -DfileName=create-datasource.py [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building maven-demo 1.0 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- wls-maven-plugin:12.1.1.0:wlst (default-cli) @ maven-demo --- [INFO] ++====================================================================++ [INFO] ++ wls-maven-plugin: wlst ++ [INFO] ++====================================================================++ *** Creating DataSource *** Connecting to t3://localhost:7001 with userid weblogic ... Successfully connected to Admin Server 'AdminServer' that belongs to domain 'mydomain'. Warning: An insecure protocol was used to connect to the server. To ensure on-the-wire security, the SSL port or Admin port should be used instead. Location changed to edit tree. This is a writable tree with DomainMBean as the root. To make changes you will need to start an edit session via startEdit(). For more help, use help(edit) Starting an edit session ... Started edit session, please be sure to save and activate your changes once you are done. Activating all your changes, this may take a while ... The edit lock associated with this edit session is released once the activation is completed. Activation completed Location changed to serverRuntime tree. This is a read-only tree with ServerRuntimeMBean as the root. For more help, use help(serverRuntime) **** DataSource Details **** Name: cp Driver Name: Oracle JDBC driver DataSource: oracle.jdbc.xa.client.OracleXADataSource Properties: {user=demo} State: Running [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 10.686s [INFO] Finished at: Wed Nov 23 16:55:25 CST 2011 [INFO] Final Memory: 13M/81M [INFO] ------------------------------------------------------------------------
Note:
Do not use the WLST exit()
command unless you intend to stop the build immediately.