3 Using the WebLogic Development Maven Plug-In

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

Configuring the WebLogic Development Maven Plug-In

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:

  1. 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
    
  2. 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
    
  3. 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> 
    
  4. 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:

  1. 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
    
  2. 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
    
  3. 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> 
    
  4. 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
    

Basic Configuration POM File

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>

Using the WebLogic Development Maven Plug-In

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

Maven Plug-In Goals

Table 3-1 lists all the wls-maven-plugin goals.

Table 3-1 Maven Plug-In Goals

Goal Name Description

appc

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.

create-domain

Creates a domain for WebLogic Server using the default domain template. For more complex domain creation, use the wlst goal.

deploy

Deploys WebLogic Server applications and modules. Supports all deployment formats; for example, WAR, JAR, and such.

help

Lists all the goals supported by the wls-maven-plugin.

install

Installs WebLogic Server.

list-apps

Lists the deployment names for applications and standalone modules deployed, distributed, or installed in the domain.

redeploy

Redeploys a running application or part of a running application.

start-app

Starts an application deployed on WebLogic Server.

start-server

Starts WebLogic Server.

stop-app

Stops an application.

stop-server

Stops WebLogic Server.

undeploy

Undeploys the application from WebLogic Server. Stops the deployment unit and removes staged files from target servers.

update-app

Updates an application's deployment plan by redistributing the plan files and reconfiguring the application based on the new plan contents.

wlst

WLST wrapper for Maven.


appc

Full Name

com.oracle.weblogic:wls-maven-plugin:appc

Short Name

wls:appc

Description

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.

Parameters

Table 3-2 appc Parameters

Name Type Required Description

altappdd

java.lang.String

false

Specifies the path to an alternative Java EE application deployment descriptor.

altwlsappdd

java.lang.String

false

Specifies the path to an alternative WebLogic Server application deployment descriptor.

basicClientJar

boolean

false

When true, does not include deployment descriptors in client JARs generated for EJBs.
Default value is: false

classpath

java.lang.String

false

Specifies a list of comma-separated directories that comprise the desired CLASSPATH. Should include the directories containing the classes required by the JSP files.

clientJarOutputDir

java.lang.String

false

Specifies a directory where generated client JARs will be written.

commentary

boolean

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.
Default value is: false

compiler

java.lang.String

false

Specifies the Java compiler for compiling class files from the generated Java source code. The Java compiler program should be in your PATH unless you specify the absolute path to the compiler explicitly.
Default value is: javac

compilerClass

java.lang.String

false

The class that invokes the compiler.
Default value is: com.sun.tools.javac.Main

continueCompilation

boolean

false

When true, continues compilation even when there are errors in the JSP files.
Default value is: false

debug

boolean

false

When true, compiles debugging information into class files.
Default value is: false

deprecation

boolean

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.
Default value is: false

destdir

java.io.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 CLASSPATH.

enableHotCodeGen

boolean

false

When true, generates WLS stubs and skeletons for EJBs.
Default value is: false

forceGeneration

boolean

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.
Default value is: false

idl

boolean

false

When true, generates IDL for EJB remote interfaces.
Default value is: false

idlDirectory

java.lang.String

false

Specifies the directory where IDL files will be written.
Default: the target directory or JAR

idlFactories

boolean

false

When true, generates factory methods for valuetypes.
Default value is: false

idlMethodSignatures

java.lang.String

false

Specifies the method signatures used to trigger IDL code generation.

idlNoAbstractInterfaces

boolean

false

When true, does not generate abstract interfaces and methods or attributes that contain them.
Default value is: false

idlNoValueTypes

boolean

false

Does not generate valuetypes or the methods and attributes that contain them.
Default value is: false

idlOrbix

boolean

false

When true, generates IDL somewhat compatible with Orbix 2000 2.0 C++.
Default value is: false

idlOverwrite

boolean

false

When true, overwrites existing IDL files.
Default value is: false

idlVerbose

boolean

false

When true, displays additional status information for IDL generation.
Default value is: false

idlVisibroker

boolean

false

When true, generates IDL somewhat compatible witih Visibroker 4.5 C++.
Default value is: false

ignorePlanValidation

boolean

false

When true, ignores the plan file if it does not exist.

iiop

boolean

false

When true, generates CORBA stubs for EJBs.
Default value is: false

iiopDirectory

java.lang.String

false

Specifies the directory where IIOP stub files will be written.
Default: the target directory or JAR

keepgenerated

boolean

false

When true, preserves the generated .java files.
Default value is: false

libraries

java.lang.String

false

A comma-separated list of libraries.

librarydir

java.io.File

false

Registers all the files in the specified directory as libraries.

lineNumbers

boolean

false

When true, adds JSP line numbers to generated class files to aid in debugging.
Default value is: false

manifest

java.io.File

false

Includes manifest information from specified manifest file.

maxfiles

java.lang.Integer

false

Specifies the maximum number of generated Java files to be compiled at one time.

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

noexit

boolean

false

When true, does not exit from the execution of the appc goal when encountering JSP compile errors.
Default value is: true

normi

boolean

false

When true, passes flags to Symantec's sj.
Default value is: false

nowarn

boolean

false

When true, suppresses compiler warnings.
Default value is: false

nowrite

boolean

false

When true, sends the output to stdout instead of writeLicense.txt.
Default value is: false

optimize

boolean

false

When true, compiles with optimization on.
Default value is: false

output

java.io.File

false

Specifies an alternate output archive or directory. When not set, the output is placed in the source archive or directory.

plan

java.io.File

false

Specifies the path to an optional deployment plan.

quiet

boolean

false

When true, turns off output except for errors.

runtimeFlags

java.lang.String

false

Passes a list of options to the compiler.

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

source

java.io.File

false

Specifies the path to the source files.
Default value is: ${project.build.directory}/${project.artifactId}.${project.packaging}

sourceVersion

java.lang.String

false

Limits the compatibility of the Java files to a JDK no higher than specified. For example "1.5".
Default value is: The JDK version of the Java compiler used

supressCompiler

boolean

false

Specifies whether to include the compiled output directory in your CLASSPATH.
Default value is: true

targetVersion

java.lang.String

false

Specifies the minimum level of the JVM required to run the compiled class files. For example, "1.5".
Default value is: The JDK version of the Java compiler used

verbose

boolean

false

When true, displays additional status information during the compilation process.
Default value is: false

verboseJavac

boolean

false

When true, enables verbose output from the Java compiler.
Default value is: false

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.

writeInferredDescriptors

boolean

false

When true, writes out the descriptors with inferred information including annotations.


Usage Example

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.

Example 3-2 appc

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

create-domain

Full Name

com.oracle.weblogic:wls-maven-plugin:create-domain

Short Name

wls:create-domain

Description

Creates a domain for WebLogic Server using the default domain template. For more complex domain creation, use the wlst goal.

Parameters

Table 3-3 create-domain Parameters

Name Type Required Description

domainHome

java.lang.String

false

Specifies the path to the WebLogic Server domain.
Default value is: ${basedir}/Oracle/Domains/mydomain

domainTemplate

java.lang.String

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.

failOnDomainExists

boolean

false

When true and the domain to be created already exists, the build fails and an exception is thrown. When false and the domain to be created already exists, the build is successful and the existing domain is not overwritten. If the domain does not exist, this parameter has no effect.
Default value is: false

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

password

java.lang.String

true

Specifies the administrative password.

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

user

java.lang.String

true

Specifies the administrative user name.

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.


Usage Example

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.

Example 3-3 create-domain

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

deploy

Full Name

com.oracle.weblogic:wls-maven-plugin:deploy

Short Name

wls:deploy

Description

Deploys WebLogic Server applications and modules. Supports all deployment formats; for example, WAR, JAR, RAR, and such.

Parameters

Table 3-4 deploy Parameters

Name Type Required Description

adminurl

java.lang.String

false

Specifies the listen address and listen port of the Administration Server.
Default value is: t3://localhost:7001

advanced

boolean

false

When true, prints advanced usage options.

debug

boolean

false

When true, displays debug-level messages to the standard output.
Default value is: false

enableSecurityValidation

boolean

false

When true, enables validation of security data.
Default value is: false

examples

boolean

false

When true, displays examples of how to use this plug-in.

external_stage

boolean

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 StagingDirectoryName(of target server)/ applicationName.
Default value is: false

failOnError

boolean

false

When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error.
Default value is: true

id

java.lang.String

false

Specifies an optional, user-supplied, unique deployment task identifier.

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

name

java.lang.String

false

Specifies the deployment name to assign to a newly-deployed application or standalone module.

nostage

boolean

false

When true, does not copy the deployment files to target servers, but leaves them in a fixed location, specified by the source parameter.
By default, nostage is true for the Administration Server and stage is true for the Managed Server targets.

noversion

boolean

false

When true, ignores all version related code paths on the Administration Server.
Default value is: false

nowait

boolean

false

When true, initiates multiple tasks and then monitors them later with the -list action.
Default value is: false

password

java.lang.String

false

Specifies the administrative password.

plan

java.lang.String

false

Specifies the path to the deployment plan.

purgetasks

boolean

false

When true, eliminates retired deployment tasks.
Default value is: false

remote

boolean

false

When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the source parameter specifies a path on the server, unless the upload parameter is also used.
Default value is: false

retiretimeout

java.lang.Integer

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.
Default value is: -1

securityModel

java.lang.String

false

Specifies the security model to be used for this deployment, overriding the default security model for the security realm. Possible values are: DDOnly, CustomRoles, CustomRolesAndPolicies, and Advanced.

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

source

java.lang.String

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 (groupId:artifactID:packaging:classifier:version).
When not using Maven coordinates, the source path points to a local file system unless the remote parameter is used.
Default value is: ${project.build.directory}/${project.artifactId}.${project.packaging}

stage

boolean

false

When true, indicates that the application needs to be copied into the target server staging area before deployment.
By default, nostage is true for the Administration Server and stage is true for the Managed Server targets.

submoduletargets

java.lang.String

false

Specifies JMS Server targets for resources defined within a JMS application module.
Possible values have the form: submod@mod-jms.xml@target or submoduleName@target.

targets

java.lang.String

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.

timeout

java.lang.Integer

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.
Default value is: -1

upload

boolean

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 remote parameter) and when the user lacks normal access to the Administration Server's file system.
Default value is: false

user

java.lang.String

false

Specifies the administrative user name.

userConfigFile

java.lang.String

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.

userKeyFile

java.lang.String

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.

verbose

boolean

false

When true, displays additional status information.
Default value is: false

version

boolean

false

When true, prints the version information.
Default value is: false

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.


Usage Example

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

help

Full Name

com.oracle.weblogic:wls-maven-plugin:help

Short Name

wls:help

Description

Lists all the goals supported by the wls-maven-plugin.

Parameters

Table 3-5 help Parameters

Name Type Required Description

detail

boolean

false

When true, prints detailed goal information.
Default value is: false

goal

java.lang.String

false

Prints information about the specified goal. When not specified, information for all goals will be displayed.


install

Full Name

com.oracle.weblogic:wls-maven-plugin:install

Short Name

wls:install

Description

Installs WebLogic Server.

Parameters

Table 3-6 install Parameters

Name Type Required Description

artifactLocation

java.lang.String

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: groupId:artifactId:packaging:classifier:version, a file on the local system (/home/myhome/myapps/helloworld.war), or a remote HTTP URL (http://foo/a/b.zip).

localRepository

org.apache.maven.artifact.repository.ArtifactRepository

true

Specifies the absolute path of a local Maven repository.

domainHome

java.lang.String

false

Specifies the path to the WebLogic Server domain.
Default value is: ${basedir}/Oracle/Domains/mydomain

installCommand

java.lang.String

false

Installs the product with an executable installer. The following macros are supported: @INSTALLER_FILE@ - the path to the installer file, @JAVA_HOME@ - path to the Java home. For example: @JAVA_HOME@ -Xms512m -Xmx1024m -jar @INSTALLER_FILE@ one two

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software


Usage Example

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
    

list-apps

Full Name

com.oracle.weblogic:wls-maven-plugin:list-apps

Short Name

wls:list-apps

Description

Lists the deployment names for applications and standalone modules deployed, distributed, or installed in the domain.

Parameters

Table 3-7 list-apps Parameters

Name Type Required Description

adminurl

java.lang.String

false

Specifies the listen address and listen port of the Administration Server.
Default value is: t3://localhost:7001

advanced

boolean

false

When true, prints advanced usage options.

debug

boolean

false

When true, displays debug-level messages to the standard output.
Default value is: false

examples

boolean

false

When true, displays examples of how to use this plug-in.

failOnError

boolean

false

When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error.
Default value is: true

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

noversion

boolean

false

When true, ignore all version-related code paths on the Administration Server.
Default value is: false

nowait

boolean

false

When true, initiates multiple tasks and then monitors them later with the -list action.

password

java.lang.String

false

Specifies the administrative password.

purgetasks

boolean

false

When true, eliminates retired deployment tasks.

remote

boolean

false

When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the source parameter specifies a path on the server, unless the upload parameter is also used.

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

timeout

java.lang.Integer

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.
Default value is: -1

user

java.lang.String

false

Specifies the administrative user name.

userConfigFile

java.lang.String

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.

userKeyFile

java.lang.String

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.

verbose

boolean

false

When true, displays additional status information.
Default value is: false

version

boolean

false

When true, prints the version information.
Default value is: false

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.


redeploy

Full Name

com.oracle.weblogic:wls-maven-plugin:redeploy

Short Name

wls:redeploy

Description

Redeploys a running application or part of a running application.

Parameters

Table 3-8 redeploy Parameters

Name Type Required Description

adminurl

java.lang.String

false

Specifies the listen address and listen port of the Administration Server.
Default value is: t3://localhost:7001

deleteFiles

java.lang.String

false

Removes the files specified in this parameter while leaving the application activated. This parameter is valid only for unarchived deployments.

examples

boolean

false

When true, displays examples of how to use this plug-in.

failOnError

boolean

false

When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error.
Default value is: true

id

java.lang.String

false

Specifies an optional, user-supplied, unique deployment task identifier.

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

name

java.lang.String

false

Specifies the deployment name to assign to a newly-deployed application or standalone module.

password

java.lang.String

false

Specifies the administrative password.

plan

java.lang.String

false

Specifies the path to the deployment plan.

remote

boolean

false

When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the source parameter specifies a path on the server, unless the upload parameter is also used.

retiretimeout

java.lang.Integer

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.
Default value is: -1

rmiGracePeriod

java.lang.Integer

false

Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the graceful parameter is true. The default value of -1 means no grace period.
Default value is: -1

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

source

java.lang.String

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 (groupId:artifactID:packaging:classifier:version).
When not using Maven coordinates, the source path points to a local file system unless the remote parameter is used.
Default value is: ${project.build.directory}/${project.artifactId}.${project.packaging}

submoduletargets

java.lang.String

false

Specifies JMS Server targets for resources defined within a JMS application module.
Possible values have the form: submod@mod-jms.xml@target or submoduleName@target.

targets

java.lang.String

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.

timeout

java.lang.Integer

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.
Default value is: -1

upload

boolean

false

When true, copies the specified source files to the Administration Server's upload directory prior to redeployment. Use this setting when running the plug-in remotely (using the remote parameter) and when the user lacks normal access to the Administration Server's file system.
Default value is: false

user

java.lang.String

false

Specifies the administrative user name.

userConfigFile

java.lang.String

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.

userKeyFile

java.lang.String

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.

verbose

boolean

false

When true, displays additional status information during the deployment process.
Default value is: false

version

boolean

false

When true, prints the version information.
Default value is: false

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.


start-app

Full Name

com.oracle.weblogic:wls-maven-plugin:start-app

Short Name

wls:start-app

Description

Starts an application deployed on WebLogic Server.

Parameters

Table 3-9 start-app Parameters

Name Type Required Description

adminmode

boolean

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.
Default value is: false

adminurl

java.lang.String

false

Specifies the listen address and listen port of the Administration Server.
Default value is: t3://localhost:7001

advanced

boolean

false

When true, prints advanced usage options.

appversion

java.lang.String

false

Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed.

debug

boolean

false

When true, displays debug-level messages to the standard output.
Default value is: false

domainHome

java.lang.String

false

Specifies the path to the WebLogic Server domain.
Default value is: ${basedir}/Oracle/Domains/mydomain

examples

boolean

false

When true, displays examples of how to use this plug-in.

failOnError

boolean

false

When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error.
Default value is: true

id

java.lang.String

false

Specifies an optional, user-supplied, unique deployment task identifier.

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

name

java.lang.String

false

Specifies the deployment name to assign to a newly-deployed application or standalone module.

noversion

boolean

false

When true, ignores all version-related code paths on the Administration Server.
Default value is: false

nowait

boolean

false

When true, initiates multiple tasks and then monitors them later with the -list action.

password

java.lang.String

false

Specifies the administrative password.

planversion

java.lang.String

false

Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed.

purgetasks

boolean

false

When true, eliminates retired deployment tasks.
Default value is: false

remote

boolean

false

When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the source parameter specifies a path on the server, unless the upload parameter is also used.
Default value is: false

retiretimeout

java.lang.Integer

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.
Default value is: -1

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

submoduletargets

java.lang.String

false

Specifies JMS Server targets for resources defined within a JMS application module.
Possible values have the form: submod@mod-jms.xml@target or submoduleName@target.

targets

java.lang.String

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.

timeout

java.lang.Integer

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.
Default value is: -1

user

java.lang.String

false

Specifies the administrative user name.

userConfigFile

java.lang.String

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.

userKeyFile

java.lang.String

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.

verbose

boolean

false

When true, displays additional status information during the deployment process.
Default value is: false

version

boolean

false

When true, prints the version information.
Default value is: false

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.


start-server

Full Name

com.oracle.weblogic:wls-maven-plugin:start-server

Short Name

wls:start-server

Description

Starts WebLogic Server.

Parameters

Table 3-10 start-server Parameters

Name Type Required Description

command

java.lang.String

false

Specifies the script to start WebLogic Server. If this parameter is not specified, it will default to either startWebLogic.sh or startWebLogic.cmd, based on the platform.

domainHome

java.lang.String

false

Specifies the path to the WebLogic Server domain.
Default value is: ${basedir}/Oracle/Domains/mydomain

httpPingUrl

java.lang.String

false

Specifies the URL that, when pinged, will verify that the server is running.

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

timeoutSecs

java.lang.Integer

false

Specifies in seconds, the timeout for the script. Valid when the waitForExit parameter is true. A zero (0) or negative value indicates that the script will not timeout.
Default value is: -1

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.


Usage Example

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

stop-app

Full Name

com.oracle.weblogic:wls-maven-plugin:stop-app

Short Name

wls:stop-app

Description

Stops an application.

Parameters

Table 3-11 stop-app Parameters

Name Type Required Description

adminmode

boolean

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.
Default value is: false

adminurl

java.lang.String

false

Specifies the listen address and listen port of the Administration Server.
Default value is: t3://localhost:7001

advanced

boolean

false

When true, prints advanced usage options.

appversion

java.lang.String

false

Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed.

debug

boolean

false

When true, displays debug-level messages to the standard output.
Default value is: false

domainHome

java.lang.String

false

Specifies the path to the WebLogic Server domain.
Default value is: ${basedir}/Oracle/Domains/mydomain

examples

boolean

false

When true, displays examples of how to use this plug-in.

failOnError

boolean

false

When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error.
Default value is: true

graceful

boolean

false

When true, stops the application after existing HTTP clients have completed their work. When not specified, force shutdown is assumed.

id

java.lang.String

false

Specifies an optional, user-supplied, unique deployment task identifier.

ignoresessions

boolean

false

When true, ignores pending HTTP sessions during graceful shutdown. Can be used only when the graceful parameter is true.
Default value is: false

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

name

java.lang.String

false

Specifies the deployment name to assign to a newly-deployed application or standalone module.

noversion

boolean

false

When true, ignores all version-related code paths on the Administration Server.
Default value is: false

nowait

boolean

false

When true, initiates multiple tasks and then monitors them later with the -list action.

password

java.lang.String

false

Specifies the administrative password.

planversion

java.lang.String

false

Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed.

purgetasks

boolean

false

When true, eliminates retired deployment tasks.

remote

boolean

false

When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the source parameter specifies a path on the server, unless the upload parameter is also used.
Default value is: false

rmiGracePeriod

java.lang.Integer

false

Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the graceful parameter is true. The default value of -1 means no grace period.
Default value is: -1

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

submoduletargets

java.lang.String

false

Specifies JMS Server targets for resources defined within a JMS application module.
Possible values have the form: submod@mod-jms.xml@target or submoduleName@target.

targets

java.lang.String

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.

timeout

java.lang.Integer

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.
Default value is: -1

user

java.lang.String

false

Specifies the administrative user name.

userConfigFile

java.lang.String

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.

userKeyFile

java.lang.String

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.

verbose

boolean

false

When true, displays additional status information.
Default value is: false

version

boolean

false

When true, prints the version information.
Default value is: false

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.


stop-server

Full Name

com.oracle.weblogic:wls-maven-plugin:stop-server

Short Name

wls:stop-server

Description

Stops WebLogic Server.

Parameters

Table 3-12 stop-server Parameters

Name Type Required Description

adminurl

java.lang.String

false

Specifies the listen address and listen port of the Administration Server.
Default value is: t3://localhost:7001

command

java.lang.String

false

Specifies the script to stop WebLogic Server. This will default to stopWebLogic.sh or stopWebLogic.cmd, based on the platform.

domainHome

java.lang.String

false

Specifies the path to the WebLogic Server domain.
Default value is: ${basedir}/Oracle/Domains/mydomain

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

outputLog

java.lang.String

false

Specifies the log file to which the script output will be redirected. When not specified, it defaults to stdout.

password

java.lang.String

true

Specifies the administrative password.

timeoutSecs

java.lang.Integer

false

Specifies, in seconds, the timeout for the script. This is valid when the waitForExit parameter is true. A zero (0) or negative value indicates that the script will not timeout.
Default value is: -1

user

java.lang.String

true

Specifies the administrative user name.

waitForExit

boolean

false

When true, the plug-in should wait for the script to complete.
Default value is: true

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.

workingDir

java.lang.String

false

Specifies the working directory for the script. If you do not specify this attribute, it defaults to the current working directory.
Default value is: ${project.base.directory}


Usage Example

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

undeploy

Full Name

com.oracle.weblogic:wls-maven-plugin:undeploy

Short Name

wls:undeploy

Description

Undeploys the application from WebLogic Server. Stops the deployment unit and removes staged files from target servers.

Parameters

Table 3-13 undeploy Parameters

Name Type Required Description

adminurl

java.lang.String

false

Specifies the listen address and listen port of the Administration Server.
Default value is: t3://localhost:7001

advanced

boolean

false

When true, prints advanced usage options.

appversion

java.lang.String

false

Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed.

debug

boolean

false

When true, displays debug-level messages to the standard output.
Default value is: false

examples

boolean

false

When true, displays examples of how to use this plug-in.

failOnError

boolean

false

When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error.
Default value is: true

graceful

boolean

false

When true, stops the application after existing HTTP clients have completed their work. When not specified, forced shutdown is assumed.

id

java.lang.String

false

Specifies an optional, user-supplied, unique deployment task identifier.

ignoresessions

boolean

false

When true, ignores pending HTTP sessions during graceful shutdown. Can be used only when the graceful parameter is true.
Default value is: false

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

name

java.lang.String

false

Specifies the deployment name to assign to a newly-deployed application or standalone module.

noversion

boolean

false

When true, ignores all version-related code paths on the Administration Server.
Default value is: false

nowait

boolean

false

When true, initiates multiple tasks and then monitors them later with the -list action.

password

java.lang.String

false

Specifies the administrative password.

planversion

java.lang.String

false

Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed.

purgetasks

boolean

false

When true, eliminates retired deployment tasks.

remote

boolean

false

When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the source parameter specifies a path on the server, unless the upload parameter is also used.
Default value is: false

rmiGracePeriod

java.lang.Integer

false

Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the graceful parameter is true. The default value of -1 means no grace period.
Default value is: -1

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

submoduletargets

java.lang.String

false

Specifies JMS Server targets for resources defined within a JMS application module.
Possible values have the form: submod@mod-jms.xml@target or submoduleName@target.

targets

java.lang.String

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.

timeout

java.lang.Integer

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.
Default value is: -1

user

java.lang.String

false

Specifies the administrative user name.

userConfigFile

java.lang.String

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.

userKeyFile

java.lang.String

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.

verbose

boolean

false

When true, displays additional status information during the deployment process.
Default value is: false

version

boolean

false

When true, prints the version information.
Default value is: false

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.


update-app

Full Name

com.oracle.weblogic:wls-maven-plugin:update-app

Short Name

wls:update-app

Description

Updates an application's deployment plan by redistributing the plan files and reconfiguring the application based on the new plan contexts.

Parameters

Table 3-14 update-app Parameters

Name Type Required Description

adminurl

java.lang.String

false

Specifies the listen address and listen port of the Administration Server.
Default value is: t3://localhost:7001

advanced

boolean

false

When true, prints advanced usage options.

appversion

java.lang.String

false

Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed.

debug

boolean

false

When true, displays debug-level messages to the standard output.
Default value is: false

domainHome

java.lang.String

false

Specifies the path to the WebLogic Server domain.
Default value is: ${basedir}/Oracle/Domains/mydomain

examples

boolean

false

When true, displays examples of how to use this plug-in.

failOnError

boolean

false

When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error.
Default value is: true

id

java.lang.String

false

Specifies an optional, user-supplied, unique deployment task identifier.

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

name

java.lang.String

false

Specifies the deployment name to assign to a newly-deployed application or standalone module.

noversion

boolean

false

When true, ignores all version-related code paths on the Administration Server.
Default value is: false

nowait

boolean

false

When true, initiates multiple tasks and then monitors them later with the -list action.

password

java.lang.String

false

Specifies the administrative password.

plan

java.lang.String

false

Specifies the location of the deployment plan.

planversion

java.lang.String

false

Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed.

purgetasks

boolean

false

When true, eliminates retired deployment tasks.
Default value is: false

remote

boolean

false

When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the source parameter specifies a path on the server, unless the upload parameter is also used.
Default value is: false

rmiGracePeriod

java.lang.Integer

false

Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the graceful parameter is true. The default value of -1 means no grace period.
Default value is: -1

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

submoduletargets

java.lang.String

false

Specifies JMS Server targets for resources defined within a JMS application module.
Possible values have the form: submod@mod-jms.xml@target or submoduleName@target.

targets

java.lang.String

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.

timeout

java.lang.Integer

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.
Default value is: -1

upload

boolean

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 remote parameter) and when the user lacks normal access to the Administration Server's file system.
Default value is: false

user

java.lang.String

false

Specifies the administrative user name.

userConfigFile

java.lang.String

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.

userKeyFile

java.lang.String

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.

verbose

boolean

false

When true, displays additional status information.
Default value is: false

version

boolean

false

When true, prints the version information.
Default value is: false

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.


wlst

Full Name

com.oracle.weblogic:wls-maven-plugin:wlst

Short Name

wls:wlst

Description

WLST wrapper for Maven.

Parameters

Table 3-15 wlst Parameters

Name Type Required Description

args

java.lang.String

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.\""

debug

boolean

false

When true, displays additional status information.
Default value is: false

executeScriptBeforeFile

boolean

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 filename and script parameters.
Default value is: true

failOnError

boolean

false

When true, the Maven build fails if the wlst goal fails. The default value is true, and consequently any error condition will cause the build to fail. In some cases, setting failOnError to false will allow the wlst goal to ignore the error.
Default value is: true

fileName

java.lang.String

false

Specifies the file path of the WLST Python script to execute. Either a fileName or a script parameter must be specified, and both are allowed.

middlewareHome

java.lang.String

false

Specifies the path to the home directory for an Oracle WebLogic Server or Fusion Middleware installation.
Required unless WebLogic Server was installed in the default location selected by the WebLogic Server Maven Plug-In install goal.
Default value is: ${basedir}/Oracle/Software

propertiesFile

java.lang.String

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 "foobar: Very important stuff", the variable foobar can be used in a Python statement in the following manner: "print('foobar has the value: ' + foobar)".

script

java.lang.String

false

Specifies an inline WLST Python script, for example, "print('Hello, world!')".

serverClasspath

java.lang.String

false

Adds additional JARs and directories to the classpath making the resources and classes they contain available to the wls-maven-plugin.

weblogicHome

java.lang.String

false

Specifies the location of the WebLogic Server installation. Specify an absolute path or relative path to the middlewareHome location.
Optional when the defaults are used and the weblogicHome is a child folder of middlewareHome.
Required if you have more than one weblogicHome, or if it is not a child folder of middlewareHome.


Usage Example

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.

Example 3-4 wlst

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.