Fusion Middleware Documentation
Advanced Search


Developing Applications for Oracle WebLogic Server
Close Window

Table of Contents

Show All | Collapse

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.

The weblogic-maven-plugin provides enhanced functionality to install, start and stop servers, create domains, execute WLST scripts, and compile and deploy applications. With the weblogic-maven-plugin, you can install WebLogic Server from within your Maven environment to fulfill the local WebLogic Server requirement.

The following sections describe using weblogic-maven-plugin:

See Developing Applications Using Continuous Integration for additional Maven documentation. In particular, see the section "Building Java EE Projects for WebLogic Server with Maven."

Installing Maven

Before you can use the weblogic-maven-plugin plug-in, you must first have a functional Maven installation and a Maven repository. WebLogic Server supports Maven 3.0.4 and later.

A distribution of Maven 3.0.4 is included with WebLogic Server in the following location: ORACLE_HOME\oracle_common\modules\org.apache.maven_3.0.4. This is a copy of the standard Maven 3.0.4 release, without any modifications.

Run the ORACLE_HOME\wlserver\server\bin\setWLSEnv script to configure Maven.

Alternatively, you can download and install your own copy of Maven from the Maven Web site: http://maven.apache.org. Make sure you set any required variables as detailed in that documentation, such as M2_HOME and JAVA_HOME.

The weblogic-maven-plugin sets the Java protocol handler to weblogic.net. To use the default JDK protocol handlers, specify the system property -DUseSunHttpHandler=true in the JVM that executes Maven. To do this, override the environment variable MAVEN_OPTS inside the mvn.bat or mvn.sh files to set the appropriate value. For example: set MAVEN_OPTS="-DUseSunHttpHandler=true".

For detailed information on installing and using Maven to build applications and projects, see the Maven Users Centre at http://maven.apache.org/users/index.html.

Configuring the WebLogic Development Maven Plug-In

The weblogic-maven-plugin plug-in is provided as a pre-built JAR file and accompanying pom file.

Follow these steps for installing and configuring weblogic-maven-plugin:

  1. Install the Oracle Maven sync plug-in and run the push goal:

    1. Change directory to ORACLE_HOME\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.1.2.

    2. mvn install:install-file -DpomFile=oracle-maven-sync.12.1.2.pom -Dfile=oracle-maven-sync.12.1.2.jar.

    3. mvn com.oracle.maven:oracle-maven-sync:push -Doracle-maven-sync.oracleHome=c:\oracle\middleware\oracle_home\.

  2. You can validate whether you have successfully installed the plug-in using the Maven help:describe goal. See the Apache help plug-in describe goal documentation for additional information.

    mvn help:describe -DgroupId=com.oracle.weblogic
    -DartifactId=weblogic-maven-plugin -Dversion=12.1.2-0-0
    

How to use the WebLogic Maven Plug-in

There are two ways to invoke the goals in the WebLogic Maven plug-in:

  • From a Maven project POM.

  • From the command line.

The appc, ws-jwsc, ws-wsdlc, and ws-clientgen goals require a POM.

Other goals will work either way. For example, install, wlst, start-server, or stop-server work either from a POM or the command line.

The preferred and recommended way is to use a Maven POM file.

To invoke a WebLogic Maven plug-in goal from a POM file, do the following:

  1. Add a build section to your POM if you do not already have one.

  2. Add a plug-in section to the build section for the WebLogic Maven plug-in.

  3. Add an execution section to the WebLogic Maven plug-in's plugin section for each goal that you want to execute. This section must provide the necessary parameters for the goal, and map the goal to a phase in the Maven Lifecycle.

Example 3-1 shows an example of the necessary additions, including a few goals. The detailed descriptions of each goal later in this section present the details for parameters and examples for each goal.

If you map multiple goals to the same lifecycle phase, they are typically executed in the order you list them in the POM.

Example 3-1 Modifying the POM File

<build>
    <plugins>
      <plugin>
        <!-- This is the configuration for the
             weblogic-maven-plugin
        -->
        <groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
        <version>12.1.2-0-0</version>
        <configuration>
<middlewareHome>/fmwhome/wls12120</middlewareHome>
        </configuration>
        <executions>
          <!-- Execute the appc goal during the package phase -->
          <execution>
            <id>wls-appc</id>
            <phase>package</phase>
            <goals>
              <goal>appc</goal>
            </goals>
            <configuration>
<source>${project.build.directory}/${project.name}.${project.packaging}</source>
            </configuration>
          </execution>
          <!-- Deploy the application to the WebLogic Server in the
               pre-integration-test phase
          -->
          <execution>
            <id>wls-deploy</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
            <configuration>
              <!--The admin URL where the app is deployed. 
Here use the plugin's default value t3://localhost:7001-->
<adminurl>t3://127.0.0.1:7001</adminurl>
              <user>weblogic</user>
              <password>password</password>
              <!--The location of the file or directory to be deployed-->
<source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source>
              <!--The target servers where the application is deployed. 
Here use the plugin's default value AdminServer-->
              <targets>AdminServer</targets>
              <verbose>true</verbose>
<name>${project.build.finalName}</name>
            </configuration>
          </execution>
          <!-- Stop the application in the pre-integration-test phase -->
          <execution>
            <id>wls-stop-app</id>
            <phase>pre-integration-test</phase>
            <goals>
              <goal>stop-app</goal>
            </goals>
            <configuration>
<adminurl>t3://127.0.0.1:7001</adminurl>
              <user>weblogic</user>
              <password>password</password>
<name>${project.build.finalName}</name>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build> 

Table 3-1 lists the phases in the default Maven lifecycle.

Table 3-1 Maven Lifecycle Phases

Phase Description

validate

Validates the project is correct and all necessary information is available.

compile

Compiles the source code of the project.

test

Tests the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed.

package

Takes the compiled code and package it in its distributable format, such as a JAR.

integration-test

Processes and deploys the package if necessary into an environment where integration tests can be run.

verify

Runs any checks to verify the package is valid and meets quality criteria.

install

Installs the package into the local repository, for use as a dependency in other projects locally.

deploy

In an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.


Table 3-2 shows the most common mappings of goals to phases

Table 3-2 Common Mapping of Goals to Phases

Phase Goal

validate

ws-clientgen, ws-wsdlc

compile

ws-jwsc

test

NA

package

appc

pre-integration-testFoot 1 

install, create-domain, start-server, distribute-app, deploy, redeploy, update-app, start-app, stop-app, wlst, and list-apps

post-integration-testFoot 2 

undeploy, stop-server, uninstall

verify

NA

install

NA

deploy

NA


Footnote 1 The integration-test phase has pre sub-phases that are executed before the actual execution of any integration tests, respectively.

Footnote 2 The integration-test phase has post sub-phases that are executed after the actual execution of any integration tests, respectively.

Basic Configuration POM File

Example 3-2 illustrates a basic Java EE 6 Web application pom.xml file that demonstrates the use of the weblogic-maven-plugin appc goal.

Example 3-2 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>com.oracle.weblogic</groupId>
       <artifactId>weblogic-server-pom</artifactId>
       <version>12.1.2-0-0</version>
       <type>pom</type>
       <scope>provided</scope>
      </dependency>
    </dependencies>
 
    <build>
        <plugins>
            ...
            ...
 
            <!-- WebLogic Server 12c Maven Plugin -->
            <plugin>
                <groupId>com.oracle.weblogic</groupId>
                <artifactId>weblogic-maven-plugin</artifactId>
                <version>12.1.2-0-0</version>
            </plugin>
            <configuration>
             </configuration>
             <executions>
               <execution>
                <id>wls-appc</id>
                <phase>package</phase>
                <goals>
                 <goal>appc</goal>
                </goals>
               <configuration>
                 source>${project.build.directory}/${project.name}.
                   ${project.packaging}</source>
               </configuration>
              </execution>
             </executions>
         </plugins>
    </build>
 
</project>

Maven Plug-In Goals

Table 3-3 lists all the weblogic-maven-plugin goals. Each goal is described in detail in the sections that follow.

Table 3-3 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 a domain template. This goal supports specifying the domain directory (the last directory determines the domain name) and the administrative username and password. 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.

distribute-app

Prepares deployment files for deployment by copying deployment files to target servers and validating them.

help

Deprecated. Use the standard Maven help plug-in instead.

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. This goal starts WLS by running a local start script. For starting remote servers using the node manager, use the wlst goal instead.

stop-app

Stops an application.

stop-server

Stops WebLogic Server. This goal stops WLS by running a local start script. For stopping remote servers using the node manager, use the wlst goal instead.

undeploy

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

uninstall

Uninstalls WebLogic Server. Currently works only for servers installed using the Zip installer.

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.

ws-clientgen

Generates client Web service artifacts from a WSDL.

ws-wsdlc

Generates a set of artifacts and a partial Java implementation of the Web service from a WSDL.

ws-jwsc

Builds a JAX-WS Web service.


appc

Full Name

com.oracle.weblogic:weblogic-maven-plugin: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. Does not require a local server installation.

Parameters

Table 3-4 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

This parameter is deprecated in this release and ignored. Use the standard Maven dependency model instead to manipulate the effective CLASSPATH during a build.

clientJarOutputDir

java.lang.String

false

Specifies a directory where generated client JARs will be written.

commentary

boolean

false

This parameter is deprecated in this release.

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

This parameter is deprecated in this release.

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

This parameter is deprecated in this release. Use the standard Maven mechanism to specify the Manifest during packaging.

maxfiles

java.lang.Integer

false

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

middlewareHome

java.lang.String

false

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release.

nowarn

boolean

false

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

nowrite

boolean

false

This parameter is deprecated in this release.

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

This parameter is deprecated in this release and ignored. Use the standard Maven dependency model instead to manipulate the effective CLASSPATH.

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

This parameter is deprecated in this release and ignored. Use the standard Maven dependency model instead to add the target classes to the effective CLASSPATH during a build.

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

This parameter is deprecated in this release and ignored.

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.

<execution>
<id>wls-appc</id>
<phase>package</phase>
<goals>
<goal>appc</goal>
</goals>
<configuration>
<source>${project.build.directory}/${project.name}.${project.packaging}</source>
</configuration>
</execution> 

Example 3-3 shows typical appc goal output.

Example 3-3 appc

$ mvn com.oracle.weblogic:weblogic-maven-plugin:appc
 -Dsource=target/basicWebapp.war -DforceGeneration=true
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building basicWebapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:appc (default-cli) @ main-test ---
[INFO] Running weblogic.appc on
/home/oracle/src/tests/main-test/target/basicWebapp.war
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.901s
[INFO] Finished at: Wed May 15 10:52:46 EST 2013
[INFO] Final Memory: 26M/692M
[INFO] 

create-domain

Full Name

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

Description

Creates a domain for WebLogic Server using a domain template. This goal supports specifying the domain directory (the last directory determines the domain name) and the administrative username and password. For more complex domain creation, use the wlst goal.

Parameters

Table 3-5 create-domain Parameters

Name Type Required Description

domainHome

java.lang.String

true

Specifies the directory to use for creating the domain. This goal takes the name of the last subdirectory specified as the domain name and sets the new domain's name to that value. For example, domainHome=/weblogic/domains/MyNewDomain causes the domain name to be set to 'MyNewDomain'.

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

true

The path to the Oracle Middleware install directory.

password

java.lang.String

true

Specifies the administrative password.

serverClasspath

java.lang.String

false

This parameter is deprecated and ignored in this release.

user

java.lang.String

true

Specifies the administrative user name.

weblogicHome

java.lang.String

false

This parameter is deprecated and ignored in this release.

wlstVersion

java.lang.String

false

Specifies whether to run the wlst.sh script from ${middlewareHome}/wlserver/common/bin or ${middlewareHome}/oracle_common/common/bin. Allowable values are wls and oracle_common. The default is wls.


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 domainHome configuration parameter.

When creating a domain, a user name and password are required. You can specify these using the user and password configuration parameters in your POM file or by specifying them on the command line.

The domain name is taken from the last subdirectory specified in domainHome.

<execution>
<id>wls-create-domain</id>
<phase>pre-integration-test</phase>
<goals>
<goal>create-domain</goal>
</goals>
<configuration>
<middlewareHome>c:/dev/wls12120</middlewareHome>
<domainHome>${project.build.directory}/base_domain</domainHome>
<user>weblogic</user>
<password>password</password>
</configuration>
</execution>

Example 3-4 shows typical command output from the execution of the create-domain goal.

Example 3-4 create-domain

mvn com.oracle.weblogic:weblogic-maven-plugin:create-domain
-DdomainHome=c:\oracle\middleware\oracle_home\user_projects\domains\maven-domain
-DmiddlewareHome=c:\oracle\middleware\oracle_home -Duser=weblogic -Dpassword=password
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building WebLogic Server Maven Plugin 12.1.2-0-0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:create-domain (default-cli) @
 weblogic-maven-plugin ---
[INFO] [create-domain]Domain creation script: 
readTemplate(r'C:/oracle/middleware/oracle_home/wlserver/common/templates/wls/wls.jar')
set('Name', 'maven-domain')
cd('/Security/maven-domain/User/weblogic')
set('Name', 'weblogoc')
set('Password', '***')
writeDomain(r'c:/oracle/middleware/oracle_home/user_
projects/domains/maven-domain')
[INFO] [wlst]script temp file = C:/Users/user/AppData/Local/Temp/test6066166061714573929.py
[INFO] [wlst]Executing: [cmd:[C://windows\\system32\\cmd.exe, /c, 
C:\oracle\middleware\oracle_home\wlserver\common\bin\wlst.cmd 
C:\Users\user\AppData\Local\Temp\test6066166061714573929.py ]]
[INFO] Process being executed, waiting for completion.
[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] [wlst][cmd:[C:\\windows\\system32\\cmd.exe, /c, C:\oracle\middleware\oracle_home\wlserver\common\bin\wlst.cmd 
C:\Users\user\AppData\Local\Temp\test6066166061714573929.py ]] exit code=0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.276s
[INFO] Finished at: Wed May 01 13:13:25 EDT 2013
[INFO] Final Memory: 9M/23M
[INFO] ------------------------------------------------------------------------

deploy

Full Name

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

Description

Deploys WebLogic Server applications and modules to a running server. Supports all deployment formats; for example, WAR, JAR, RAR, and such. Does not require a local server installation.

Parameters

Table 3-6 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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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. The default is AdminServer.

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

This parameter is deprecated in this release and ignored.


Usage Example

Use this goal to deploy an application.

<execution>
<id>wls-deploy</id>
<phase>pre-integration-test</phase>
<goals>
<goal>deploy</goal>
</goals>
<configuration>
<adminurl>t3://127.0.0.1:7001</adminurl>
<user>weblogic</user>
<password>password</password>
<source>${project.build.directory}/${project.build.finalName}
.${project.packaging}</source>
<targets>AdminServer</targets>
<verbose>true</verbose>
<name>${project.build.finalName}</name>
</configuration>
</execution>

Example 3-5 shows typical deploy goal output.

Example 3-5 deploy

mvn com.oracle.weblogic:weblogic-maven-plugin:deploy
-Dsource=C:\webservices\MySimpleEjb.jar
-Dpassword=password -Duser=weblogic
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebLogic Server Maven Plugin 12.1.2-0-0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:deploy (default-cli) @ weblogic-mave
n-plugin ---
weblogic.Deployer invoked with options:  -noexit -adminurl t3://localhost:7001 -
deploy -user weblogic -source C:\webservices\MySimpleEjb.jar -targets AdminServe
r
<May 1, 2013 1:41:09 PM EDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiati
ng deploy operation for application, MySimpleEjb [archive: C:\webservices\MySimp
leEjb.jar], to AdminServer .>
Task 0 initiated: [Deployer:149026]deploy application MySimpleEjb on AdminServer
.
Task 0 completed: [Deployer:149026]deploy application MySimpleEjb on AdminServer
.
Target state: deploy completed on Server AdminServer
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.042s
[INFO] Finished at: Wed May 01 13:41:11 EDT 2013
[INFO] Final Memory: 10M/25M

distribute-app

Full Name

com.oracle.weblogic:weblogic-maven-plugin:distribute-app

Description

Prepares deployment files for deployment by copying deployment files to target servers and validating them. Does not require a local server installation.

Parameters

Table 3-7 distribute-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.

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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.


Use this goal to prepare deployment files for deployment.

<execution>
<id>wls-distribute-app</id>
<phase>pre-integration-test</phase>
<goals>
<goal>distribute-app</goal>
</goals>
<configuration>
<adminurl>t3://127.0.0.1:7001</adminurl>
<user>weblogic</user>
<password>password</password>
<source>${project.build.directory}/${project.build.finalName}
.${project.packaging}</source>
<targets>cluster1</targets>
<verbose>true</verbose>
<name>${project.build.finalName}</name>
</configuration>
</execution>

Example 3-6 shows typical distribute-app goal output.

Example 3-6 distribute-app

$ mvn com.oracle.weblogic:weblogic-maven-plugin:distribute-app
 -Dadminurl=t3://localhost:7001 -Dstage=true -DmiddlewareHome=/maven/wls12120
 -Dname=cluster-test -Duser=weblogic -Dpassword=welcome1 -Dtargets=cluster1
 -Dsource=target/cluster-test-1.0-SNAPSHOT.war
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building cluster-test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:distribute-app (default-cli) @
 cluster-test ---
weblogic.Deployer invoked with options: -noexit -adminurl t3://localhost:7001
 -distribute -user weblogic -name cluster-test -source 
/home/oracle/src/tests/uber-test/cluster-test/
target/cluster-test-1.0-SNAPSHOT.war -targets cluster1 -stage
<May 15, 2013 2:09:58 PM EST> <Info> <J2EE Deployment SPI> <BEA-260121>
 <Initiating distribute operation for application, cluster-test [archive: 
/home/oracle/src/tests/uber-test/cluster-test/
target/cluster-test-1.0-SNAPSHOT.war], to cluster1 .>
Task 0 initiated: [Deployer:149026]distribute application cluster-test on
 cluster1.
Task 0 completed: [Deployer:149026]distribute application cluster-test on
 cluster1.
Target state: distribute completed on Cluster cluster1
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.953s
[INFO] Finished at: Wed May 15 14:10:00 EST 2013
[INFO] Final Memory: 15M/429M
[INFO] ------------------------------------------------------------------------

help

Full Name

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

Description

Deprecated. Use the standard Maven help plug-in instead.

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

Parameters

Table 3-8 help Parameters

Name Type Required Description

detail

boolean

false

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


install

Full Name

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

Description

Installs WebLogic Server.

Parameters

Table 3-9 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).

domainHome

java.lang.String

false

This parameter is deprecated in this release and ignored.

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

installDir

java.lang.String

true

The location to install the server. For the zip installer, the equivalent of middlewareHome is ${installDir}/wls12120.


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.

Note:

The install goal creates a single managed server called myserver, and does not create a domain. Most other goals, including create-domain, use a default server name of AdminServer. You therefore need to override the default AdminServer server name in your POM.

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 weblogic-maven-plugin section of the pom.xml file, or by using the –DartifactLocation property when invoking Maven.

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.

  • A URL reference.

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

    artifactLocation can be a URL, a file path, or a Maven coordinate of the form groupId:artifactId:packaging:version or groupId:artifactId:packaging:classifier:version. For example, com.oracle.weblogic:weblogic-server-installer:zip:12.1.2-0-0.

<execution>
<id>wls-install-server</id>
<phase>pre-integration-test</phase>
<goals>
<goal>install</goal>
</goals>
<configuration>
<installDir>c:/dev</installDir>
<artifactLocation>c:/temp/wls1212_dev.zip</artifactLocation>
</configuration>
</execution>

Example 3-7 shows typical install goal output.

Example 3-7 install

mvn com.oracle.weblogic:weblogic-maven-plugin:install
 -DartifactLocation=wls1212.zip -DinstallDir=c:\oracle\middleware
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:install (default-cli) @ standalone-p
om ---
[INFO] Installing wls1212.zip into the location: c:\oracle\middleware
[INFO] Installing the product, this may take some time.
[INFO] [install]installHome = c:\oracle\middleware
[INFO] [install]middlewareHome = c:\oracle\middleware\wls12120
[INFO] Executing: [cmd:[C:\\windows\\system32\\cmd.exe, /c, configure.cmd -silen
t]]
[INFO] Process being executed, waiting for completion.
[INFO] [configure script] exit code: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:43.223s
[INFO] Finished at: Thu May 09 15:57:22 EDT 2013
[INFO] Final Memory: 6M/17M
[INFO] ------------------------------------------------------------------------

list-apps

Full Name

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

Description

Lists the deployment names for applications and standalone modules deployed, distributed, or installed in the domain. Does not require a local server installation.

Parameters

Table 3-10 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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.


Use the list-apps goal to list the deployment names.

<execution>
<id>wls-list-apps</id>
<phase>pre-integration-test</phase>
<goals>
<goal>list-apps</goal>
</goals>
<configuration>
<adminurl>t3://127.0.0.1:7001</adminurl>
<user>weblogic</user>
<password>password</password>
</configuration>
</execution>

Example 3-8 shows typical list-apps goal output.

Example 3-8 list-apps

mvn com.oracle.weblogic:weblogic-maven-plugin:list-apps  
-Duser=weblogic -Dpassword=password
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebLogic Server Maven Plugin 12.1.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:list-apps (default-cli) @ weblogic-m
aven-plugin ---
weblogic.Deployer invoked with options:  -noexit -adminurl t3://localhost:7001 -
listapps -user weblogic
 SamplesSearchWebApp
 stockBackEnd
 ajaxJSF
 asyncServlet30
 singletonBean
 webFragment
 examplesWebApp
 mainWebApp
 annotation
 MySimpleEjb
 stockFrontEnd
 jsfBeanValidation
 programmaticSecurity
 entityBeanValidation
 faceletsJSF
 bookmarkingJSF
 stockAdapter
 noInterfaceViewInWAR
 jdbcDataSource.war
 asyncMethodOfEJB
 calendarStyledTimer
 cdi
 jaxrs
 criteriaQuery
 portableGlobalJNDIName
 multipartFileHandling
 elementCollection
Number of Applications Found : 27
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.656s
[INFO] Finished at: Fri May 03 11:33:51 EDT 2013
[INFO] Final Memory: 11M/28M
[INFO] ------------------------------------------------------------------------
C:\Oracle\Middleware\Oracle_Home\wlserver\server\lib>

redeploy

Full Name

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

Description

Redeploys a running application or part of a running application. Does not require a local server installation.

Parameters

Table 3-11 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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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. The default target is AdminServer.

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

This parameter is deprecated in this release and ignored.


Use the redeploy goal to redeploy an application or part of that application.

<execution>
<id>wls-redeploy</id>
<phase>pre-integration-test</phase>
<goals>
<goal>redeploy</goal>
</goals>
<configuration>
<adminurl>t3://127.0.0.1:7001</adminurl>
<user>weblogic</user>
<password>password</password>
<source>${project.build.directory}/${project.build.finalName}.${project.packaging}</sour
ce>
<name>${project.build.finalName}</name>
</configuration>
</execution>

Example 3-9 shows typical redeploy goal output.

Example 3-9 redeploy

mvn com.oracle.weblogic:weblogic-maven-plugin:redeploy -Dsou
rce=C:\Oracle\Middleware\Oracle_Home\wlserver\server\lib\MySimpleEjb.jar  -Duser
=weblogic -Dpassword=password -Dname=ExampleEJB
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebLogic Server Maven Plugin 12.1.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:redeploy (default-cli) @ weblogic-ma
ven-plugin ---
weblogic.Deployer invoked with options:  -noexit -adminurl t3://localhost:7001 -
redeploy -user weblogic -name ExampleEJB -source C:\Oracle\Middleware\Oracle_Hom
e\wlserver\server\lib\MySimpleEjb.jar -targets AdminServer
<May 3, 2013 12:38:02 PM EDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiat
ing redeploy operation for application, ExampleEJB [archive: C:\Oracle\Middlewar
e\Oracle_Home\wlserver\server\lib\MySimpleEjb.jar], to AdminServer .>
Task 3 initiated: [Deployer:149026]deploy application ExampleEJB on AdminServer.
 
Task 3 completed: [Deployer:149026]deploy application ExampleEJB on AdminServer.
 
Target state: redeploy completed on Server AdminServer
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.322s
[INFO] Finished at: Fri May 03 12:38:02 EDT 2013

start-app

Full Name

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

Description

Starts an application deployed on WebLogic Server. Does not require a local server installation.

Parameters

Table 3-12 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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.


Use the start-app goal to starts an application.

<execution>
<id>wls-start-app</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-app</goal>
</goals>
<configuration>
<adminurl>t3://localhost:7001</adminurl>
<user>weblogic</user>
<password>password</password>
<name>${project.build.finalName}</name>
</configuration>
</execution> 

Example 3-10 shows typical start-app goal output.

Example 3-10 start-app

mvn com.oracle.weblogic:weblogic-maven-plugin:start-app  
-Duser=weblogic -Dpassword=password -Dname=ExampleEJB
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebLogic Server Maven Plugin 12.1.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:start-app (default-cli) @ weblogic-m
aven-plugin ---
weblogic.Deployer invoked with options:  -noexit -adminurl t3://localhost:7001 -
start -user weblogic -name ExampleEJB -retiretimeout -1
<May 3, 2013 12:44:15 PM EDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiat
ing start operation for application, ExampleEJB [archive: null], to configured t
argets.>
Task 5 initiated: [Deployer:149026]start application ExampleEJB on AdminServer.
Task 5 completed: [Deployer:149026]start application ExampleEJB on AdminServer.
Target state: start completed on Server AdminServer
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.053s
[INFO] Finished at: Fri May 03 12:44:16 EDT 2013
[INFO] Final Memory: 10M/26M
[INFO] ------------------------------------------------------------------------

start-server

Full Name

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

Description

Starts WebLogic Server from a script in the current working directory.

Parameters

Table 3-13 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

This parameter is deprecated in this release and ignored.

serverClasspath

java.lang.String

false

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.


Usage Example

The start-server goal executes a startWebLogic command on a given domain, starting the WebLogic Server instance.

<execution>
<id>wls-wlst-start-server</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-server</goal>
</goals>
<configuration>
<domainHome>${project.build.directory}/base_domain</domainHome>
</configuration>
</execution>
 

Example 3-11 shows typical start-server goal output.

Example 3-11 start-server

mvn com.oracle.weblogic:weblogic-maven-plugin:start-server
-DdomainHome=c:\oracle\middleware\oracle_home\user_projects\domains\wl_server
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebLogic Server Maven Plugin 12.1.2-0-0
[INFO] ------------------------------------------------------------------------[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:start-server (default-cli) 
@ weblogic-maven-plugin ---
.[INFO] Starting server in domain: 
c:\oracle\middleware\oracle_home\user_projects\domains\wl_server
[INFO] Check stdout file for details: 
c:\oracle\middleware\oracle_home\user_projects\domains\wl_server\server-2183114106972126386.out
[INFO] Process being executed, waiting for completion.
.............
[INFO] Server started successful
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 37.725s
[INFO] Finished at: Wed May 01 14:25:45 EDT 2013
[INFO] Final Memory: 8M/23M

stop-app

Full Name

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

Description

Stops an application. Does not require a local server installation.

Parameters

Table 3-14 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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.


Use the stop-app goal to stop an application.

<execution>
<id>wls-start-app</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start-app</goal>
</goals>
<configuration>
<adminurl>t3://localhost:7001</adminurl>
<user>weblogic</user>
<password>password</password>
<name>${project.build.finalName}</name>
</configuration>
</execution> 

Example 3-12 shows typical stop-app goal output.

Example 3-12 stop-app

mvn com.oracle.weblogic:weblogic-maven-plugin:stop-app  -Dus
er=weblogic -Dpassword=password -Dname=ExampleEJB
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebLogic Server Maven Plugin 12.1.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:stop-app (default-cli) 
@ weblogic-ma
ven-plugin ---
weblogic.Deployer invoked with options:  -noexit 
-adminurl t3://localhost:7001 -
stop -user weblogic -name ExampleEJB
<May 3, 2013 12:46:27 PM EDT> <Info> 
<J2EE Deployment SPI> <BEA-260121> <Initiat
ing stop operation for application, ExampleEJB [archive: null], 
to configured ta
rgets.>
Task 6 initiated: [Deployer:149026]stop application ExampleEJB on 
AdminServer.
Task 6 completed: [Deployer:149026]stop application ExampleEJB on 
AdminServer.
Target state: stop completed on Server AdminServer
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.028s
[INFO] Finished at: Fri May 03 12:46:27 EDT 2013
[INFO] Final Memory: 10M/29M
[INFO] ------------------------------------------------------------------------
C:\Oracle\Middleware\Oracle_Home\wlserver\server\lib>

stop-server

Full Name

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

Description

Stops WebLogic Server from a script in the current working directory.

Parameters

Table 3-15 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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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.

<execution>
<id>wls-wlst-stop-server</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop-server</goal>
</goals>
<configuration>
<domainHome>${project.build.directory}/base_domain</domainHome>
<user>weblogic</user>
<password>password</password>
<adminurl>t3://localhost:7001</adminurl>
</configuration>
</execution>

Example 3-13 shows typical stop-server goal output.

Example 3-13 stop-server

mvn com.oracle.weblogic:weblogic-maven-plugin:stop-server
 -DdomainHome=c:\oracle\middleware\oracle_home\userprojects\domains\wl_server 
-DworkingDir=c:\oracle\middleware\oracle_home\user_projects\domains\wl_server
-Duser=weblogic -Dpassword=password
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebLogic Server Maven Plugin 12.1.2-0-0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:stop-server (default-cli) 
@ weblogic
-maven-plugin ---
[INFO] Stop server in domain: 
c:\oracle\middleware\oracle_home\user_projects\dom
ains\wl_server
[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 "wl_server".
[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 connec
ted 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] [exec] Derby server stopped.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 23.270s
[INFO] Finished at: Wed May 01 14:33:47 EDT 2013
[INFO] Final Memory: 9M/23M
[INFO] ------------------------------------------------------------------------

undeploy

Full Name

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

Description

Undeploys the application from WebLogic Server. Stops the deployment unit and removes staged files from target servers. Does not require a local server installation.

Parameters

Table 3-16 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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.


Use the undeploy goal to undeploy an application from WebLogic Server.

<execution>
<id>wls-undeploy</id>
<phase>post-integration-test</phase>
<goals>
<goal>undeploy</goal>
</goals>
<configuration>
<adminurl>t3://127.0.0.1:7001</adminurl>
<user>weblogic</user>
<password>password</password>
<name>${project.build.finalName}</name>
</configuration>
</execution>

Example 3-14 shows typical undeploy goal output.

Example 3-14 undeploy

mvn com.oracle.weblogic:weblogic-maven-plugin:undeploy 
-Duser=weblogic -Dpassword=password -Dname=ExampleEJB
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebLogic Server Maven Plugin 12.1.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:undeploy (default-cli) 
@ weblogic-ma
ven-plugin ---
weblogic.Deployer invoked with options:  -noexit 
-adminurl t3://localhost:7001 -
undeploy -user weblogic -name ExampleEJB -targets AdminServer
<May 3, 2013 12:48:15 PM EDT> <Info> <J2EE Deployment SPI> 
<BEA-260121> <Initiat
ing undeploy operation for application, ExampleEJB [archive: null], 
to AdminServ
er .>
Task 7 initiated: [Deployer:149026]remove application ExampleEJB 
on AdminServer.
 
Task 7 completed: [Deployer:149026]remove application ExampleEJB 
on AdminServer.
 
Target state: undeploy completed on Server AdminServer
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.114s
[INFO] Finished at: Fri May 03 12:48:15 EDT 2013
[INFO] Final Memory: 9M/26M
[INFO] ------------------------------------------------------------------------

uninstall

Full Name

com.oracle.weblogic:weblogic-maven-plugin:uninstall

Description

Uninstalls WebLogic Server using the Zip installer. This goal requires a Zip installer-installed WebLogic Server installation

Parameters

Table 3-17 uninstall Parameters

Name Type Required Description

middlewareHome

java.lang.String

true

The Oracle Middleware installation directory.


Use the uninstall goal to uninstall WebLogic Server.

<execution>
<id>wls-uninstall-server</id>
<phase>post-integration-test</phase>
<goals>
<goal>uninstall</goal>
</goals>
<configuration>
<middlewareHome>c:/dev/wls12120</middlewareHome>
</configuration>
</execution>

Example 3-15 shows typical uninstall goal output.

Example 3-15 uninstall

mvn com.oracle.weblogic:weblogic-maven-plugin:uninstall 
-DmiddlewareHome=C:\Oracle\Middleware\Oracle_Home
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building WebLogic Server Maven Plugin 12.1.2.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:uninstall 
(default-cli) @ weblogic-m
aven-plugin ---
[INFO] Attempting to uninstall from : 
C:\Oracle\Middleware\Oracle_Home
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 27.886s

update-app

Full Name

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

Description

Updates an application's deployment plan by redistributing the plan files and reconfiguring the application based on the new plan contexts. Does not require a local server installation.

Parameters

Table 3-18 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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.

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

This parameter is deprecated in this release and ignored.


Use the update-app goal to update an application's deployment plan.

<execution>
<id>wls-update-app</id>
<phase>pre-integration-test</phase>
<goals>
<goal>update-app</goal>
</goals>
<configuration>
<adminurl>t3://127.0.0.1:7001</adminurl>
<user>weblogic</user>
<password>password</password>
<name>${project.build.finalName}</name>
<plan>${basedir}/misc/myplan.xml</plan>
</configuration>
</execution>
 

Example 3-16 shows typical wlst goal output.

Example 3-16 update-app

$ mvn com.oracle.weblogic:weblogic-maven-plugin:update-app -Duser=weblogic
 -Dpassword=password -Dadminurl=t3://localhost:7001 -Dplan=misc/myplan.xml
 -Dname=basicWebapp
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building basicWebapp 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:update-app (default-cli) 
@ main-test ---
weblogic.Deployer invoked with options: -noexit -adminurl 
t3://localhost:7001 -update -user weblogic -plan
 /home/oracle/src/tests/main-test/misc/myplan.xml -name basicWebapp -targets AdminServer
<May 15, 2013 2:30:34 PM EST> <Info> <J2EE Deployment SPI> <BEA-260121>
 <Initiating update operation for application, basicWebapp [archive: null],
 to AdminServer .>
Task 10 initiated: [Deployer:149026]update application basicWebapp on
 AdminServer.
Task 10 completed: [Deployer:149026]update application basicWebapp on
 AdminServer.
Target state: update completed on Server AdminServer
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.651s
[INFO] Finished at: Wed May 15 14:30:34 EST 2013
[INFO] Final Memory: 18M/435M
[INFO] ------------------------------------------------------------------------

wlst

Full Name

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

Description

WLST wrapper for Maven.

Parameters

Table 3-19 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

true

The path to the Oracle Middleware install directory.

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

This parameter is deprecated and ignored in this release.

weblogicHome

java.lang.String

false

This parameter is deprecated and ignored in this release.

wlstVersion

java.lang.String

false

Specifies whether to run the wlst.sh script from ${middlewareHome}/wlserver/common/bin or ${middlewareHome}/oracle_common/common/bin. Allowable values are wls and oracle_common. The default is wls.


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.

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.

<execution>
<id>wls-wlst-server</id>
<phase>post-integration-test</phase>
<goals>
<goal>wlst</goal>
</goals>
<configuration>
<middlewareHome>c:/dev/wls12120</middlewareHome>
<fileName>${project.basedir}/misc/configure_resources.py</fileName>
<args>t3://localhost:7001 weblogic password AdminServer</args>
<script>
print('This is a WLST inline script\n')
print('Next, we run a WLST script to create JMS resources on the server\n')
</script>
<executeScriptBeforeFile>true</executeScriptBeforeFile>
</configuration>
</execution>

Example 3-17 shows typical wlst goal output.

Example 3-17 wlst

mvn com.oracle.weblogic:weblogic-maven-plugin:wlst
 -DfileName=create-datasource.py 

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:wlst (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  weblogic-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

By default, the wlst goal is bound to the pre-integration-test phase. To override the default phase binding for a goal, you can explicitly bind plug-in goals to a particular life cycle phase, for example, to the post-integration-test phase, as shown below. The pom.xml file binds the wlst goal to both the pre- and post-integration-test phases (a dual phase target). As shown, you can run different scripts in different phases, overriding the default settings, and make modifications according to your needs.

Example pom.xml file

<project>
  ....
 <executions>
   <execution>
     <id>WLS_SETUP_RESOURCES</id>
     <phase>pre-integration-test</phase>
     <goals>
       <goal>wlst</goal>
     </goals>
     <configuration>
       <fileName>src/main/wlst/create-datasource.py</fileName>
     </configuration>
   </execution>
 
   <execution>
     <id>WLS_TEARDOWN_RESOURCES</id>
     <phase>post-integration-test</phase>
     <goals>
       <goal>wlst</goal>
     </goals>
     <configuration>
       <fileName>src/main/wlst/remove-datasource.py</fileName>
     </configuration>
   </execution>
 </executions>
 ....
 </project>

ws-clientgen

Full Name

com.oracle.weblogic:weblogic-maven-plugin:ws-clientgen

Description

Maven goal to generate JAX-WS client Web service artifacts from a WSDL.

The ws-clientgen goal provides a Maven wrapper for the "clientgen" Ant task, which is described in WebLogic Web Services Reference for Oracle WebLogic Server.

Note:

The ws-clientgen goal does not work with the JAX-RPC-only JWS annotations described in "WebLogic-Specific Annotations."

Parameters

Table 3-20 briefly describes the ws-clientgen parameters. These parameters are more fully described in Table 2-3 "WebLogic-specific Attributes of the clientgen Ant Task" in WebLogic Web Services Reference for Oracle WebLogic Server.

Table 3-20 ws-clientgen Parameters

Name Type Required Description

binding

bindings

java.lang.String

false

Specifies one or more customization files that specify JAX-WS and JAXB custom binding declarations or SOAP handler files. If there is only one binding element, both <binding>./filename</binding> and <bindings><binding>./filename</binding></bindings> are allowed.

See Table 3-21 for a description of bindings parameters.

catalog

java.lang.String

false

Specifies an external XML catalog file to resolve external entity references.

For more information about creating XML catalog files, see "Using XML Catalogs" in Developing JAX-WS Web Services for Oracle WebLogic Server

copyWsdl

boolean

false

Controls where the WSDL should be copied in the ws-clientgen goal 's destination dir.

debug

boolean

false

Turns on additional debug output.

debugLevel

boolean

false

Uses Ant debug levels.

destDir

java.lang.String

true

Specifies the directory into which the ws-clientgen goal generates the client source code, WSDL, and client deployment descriptor files.

You must specify either the destFile or destDir attribute, but not both.

failOnError

boolean

false

Specifies whether the ws-clientgen goal continues executing in the event of an error. The default value is True.

fork

boolean

false

Specifies whether to execute javac using the JDK compiler externally. The default value is false.

genRuntimeCatalog

boolean

false

Specifies whether the ws-clientgen goal should generate the XML catalog artifacts in the client runtime environment. This value defaults to true.

includeAntRuntime

boolean

false

Specifies whether to include the Ant run-time libraries in the classpath.

includeJavaRuntime

boolean

false

Specifies whether to include the default run-time libraries from the executing VM in the classpath.

jmstransportclient

JMSTransportClient

false

Invoking a WebLogic Web service using JMS transport.

Table 3-23 describes the parameters of the jmstransportclient parameter.

packageName

java.lang.String

false

Specifies the package name into which the generated client interfaces and stub files are packaged.

produce

produces

FileSet

List<FileSet>

false

There is only one FileSet.

There is more than one FileSet.

verbose

boolean

false

Turns on verbose output

wsdl

java.lang.String

true

Specifies a full path name or URL of the WSDL that describes a Web service (either WebLogic or non-WebLogic) for which the client component files should be generated.

wsdlLocation

java.lang.String

false

Controls the value of the wsdlLocation attribute generated on the WebService or WebServiceProvider annotation.

xauthfile

java.lang.String

false

Specifies the authorization file.

xmlCatalog

java.lang.String

false

Not used.


Table 3-21 describes the parameters of the bindings parameter.

Table 3-21 Binding Parameters

Name Type Required Description

file

java.lang.String

false

Specifies a customization file that contains JAX-WS and JAXB custom binding declarations or SOAP handler files.


Table 3-22 describes the parameters of the xmlCatalog parameter.

Table 3-22 xmlCatalog Parameters

Name Type Required Description

refid

java.lang.String

false

Specifies the directories (separated by semi-colons) that the ws-jwsc goal should search for JWS files to compile.


Table 3-23 describes the parameters of the jmstransportclient parameter.

Table 3-23 jmstransportclient Parameters

Name Type Required Description

destinationName

java.lang.String

false

JNDI name of the destination queue or topic. Default value is com.oracle.webservices.jms.RequestQueue.

destinationType

java.lang.String

false

Valid values include: QUEUE or TOPIC. Default value is QUEUE.

replyToName

java.lang.String

false

JNDI name of the JMS destination to which the response message is sent.

targetService

java.lang.String

false

Port component name of the Web service.

jndiInitialContextFactory

java.lang.String

false

Name of the initial context factory class used for JNDI lookup. Default value is weblogic.jndi.WLInitialContextFactory.

jndiConnectionFactoryName

java.lang.String

 

JNDI name of the connection factory that is used to establish a JMS connection. Default value is com.oracle.webservices.jms.ConnectionFactory.

jndiUrl

java.lang.String

 

JNDI provider URL. Default value is t3://localhost:7001.

deliveryMode

java.lang.String

 

Delivery mode indicating whether the request message is persistent. Valid values are PERSISTENT and NON_PERSISTENT. Default value is PERSISTENT.

timeToLive

long

false

Lifetime, in milliseconds, of the request message. Default value is 180000L.

priority

int

false

JMS priority associated with the request and response message. Default value is 0.

jndiContextParameter

java.lang.String

false

JNDI properties, in a format like: someParameterName1=someValue1 , someParameterName2=someValue2.

bindingVersion

java.lang.String

false

Version of the SOAP JMS binding. Default value is 1.0.

runAsPrincipal

java.lang.String

false

Principal used to run the listening MDB.

runAsRole

java.lang.String

false

Role used to run the listening MDB.

messageType

java.lang.String

false

Message type to use with the request message. Valid values are com.oracle.webservices.api.jms.JMSMessageType.BYTES and com.oracle.webservices.api.jms.JMSMessageType.TEXT. Default value is BYTES.

enableHttpWsdlAccess

boolean

false

Boolean flag that specifies whether to publish the WSDL through HTTP. Default value is true.

mdbPerDestination

boolean

false

Boolean flag that specifies whether to create one listening message-driven bean (MDB) for each requested destination. Default value is true.

activationConfig

java.lang.String

false

Activation configuration properties passed to the JMS provider.

contextPath

java.lang.String

false

The deployed context of the web service.

serviceUri

java.lang.String

false

Web service URI portion of the URL.

portName

java.lang.String

false

The name of the port in the generated WSDL.


Usage Example

The ws-clientgen goal generates client Web service artifacts from a WSDL.

This goal benefits from the convention-over-configuration approach, allowing you to execute it using the defaults of the project.

There are two ways to run the ws-clientgen goal:

  • From the command line. For example, after you define an alias:

    mvn –DvariableName1=value1  –DvariableName2=value2 com.oracle.weblogic:weblogic-maven-plugin:ws-clientgen
    
    
  • By specifying the Maven generate-resources life cycle phase. Then run mvn generate-resources in the same directory of pom.xml.

    To do this, modify the pom.xml file to specify the generate-resources life cycle phase, the ws-clientgen goal, and include any parameters you need to set. Consider the following example:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <project>
      <modelVersion>4.0.0</modelVersion>
      <groupId>maven_plugin.simple</groupId>
      <artifactId>maven_plugin_simple</artifactId>
      <version>1.0</version>
      <build>
        <plugins>
          <plugin>
            <groupId>com.oracle.weblogic</groupId>
            <artifactId>weblogic-maven-plugin</artifactId>
            <version>12.1.2-0-0</version>
            <executions>
              <execution>
                <id>clientgen</id>
                <phase>generate-resources</phase>
                <goals>
                  <goal>ws-clientgen</goal>
                </goals>
                <configuration>
                 <wsdl>${basedir}/AddNumbers.wsdl</wsdl>
                  <dest${project.build.outputDirectory}</destDir>
                  <packageName>maven_plugin.simple.client</packageName>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </project>
    

Example 3-18 shows typical ws-clientgen goal output.

Example 3-18 ws-clientgen

mvn -f C:\maven-doc\jwsc-test-2\clientgen_pom.xml generate-resources
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven_plugin_simple 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:ws-clientgen (clientgen) @ maven_plugin_sim
ple ---
[INFO] Executing standalone...
 
[INFO] Executing Maven goal 'clientgen'...
calling method public static void weblogic.wsee.tools.clientgen.MavenClientGen.e
xecute(org.apache.maven.plugin.logging.Log,java.util.Map) throws java.lang.Throw
able
[INFO] Consider using <depends>/<produces> so that wsimport won't do unnecessary
 compilation
[WARNING] parsing WSDL...
[WARNING]
[WARNING]
[WARNING]
[WARNING] Generating code...
[WARNING]
[WARNING]
[WARNING] Compiling code...
[WARNING]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

ws-wsdlc

Full Name

com.oracle.weblogic:weblogic-maven-plugin:ws-wsdlc

Description

Maven goal to generate a set of artifacts and a partial Java implementation of the Web service from a WSDL.

The ws-wsdlc goal provides a Maven wrapper for the "wsdlc" Ant task, which is described in WebLogic Web Services Reference for Oracle WebLogic Server.

Parameters

Table 3-24 briefly describes the ws-wsdlc parameters. These parameters are more fully described in Table 2-3 "WebLogic-specific Attributes of the clientgen Ant Task" in WebLogic Web Services Reference for Oracle WebLogic Server.

Table 3-24 ws-wsdlc Parameters

Name Type Required Description

catalog

java.lang.String

false

Specifies an external XML catalog file.

For more information about creating XML catalog files, see "Using XML Catalogs" in Developing JAX-WS Web Services for Oracle WebLogic Server

debug

boolean

false

Specifies the flag to set when debugging the process. Default value is false.

debugLevel

java.lang.String

false

Uses Ant debug levels.

destImplDir

java.lang.String

false

Specifies the directory into which the stubbed-out JWS implementation file is generated.

destJavadocDir

java.lang.String

false

Specifies the directory into which the Javadoc that describes the JWS interface is generated.

destJwsDir

java.lang.String

true

Specifies the directory into which the JAR file that contains the JWS interface and data binding artifacts should be generated.

explode

boolean

false

Specifies the flag to set if you want exploded output. Defaults to true.

failOnError

boolean

false

Specifies whether the ws-clientgen goal continues executing in the event of an error. The default value is true

fork

boolean

false

Specifies whether to execute javac using the JDK compiler externally. The default value is false.

includeAntRuntime

boolean

false

Specifies whether to include the Ant run-time libraries in the classpath. The default value is true.

includeJavaRuntime

boolean

false

Specifies whether to include the default run-time libraries from the executing VM in the classpath. The default value is false.

optimize

boolean

false

Specifies the flag to set if you want optimization. Defaults to true.

packageName

java.lang.String

false

Specifies the package into which the generated JWS interface and implementation files should be generated.

srcPortName

java.lang.String

false

Specifies the name of the WSDL port from which the JWS interface file should be generated. Set the value of this parameter to the value of the name parameter of the port parameter that corresponds to the Web service port for which you want to generate a JWS interface file.

The port parameter is a child of the service parameter in the WSDL file. If you do not specify this attribute, ws-wsdlc generates a JWS interface file from the service specified by srcServiceName.

srcServiceName

java.lang.String

false

Specifies the name of the Web service from which the JWS interface file should be generated.

srcWsdl

java.lang.String

true

Specifies the name of the WSDL from which to generate the JAR file that contains the JWS interface and data binding artifacts.

verbose

boolean

false

Specifies the flag to set if you want verbose output. Default value is false.


Usage Example

The ws-wsdlc goal generates a set of artifacts and a partial Java implementation of the Web service from a WSDL.

This goal benefits from the convention-over-configuration approach, allowing you to execute it using the defaults of the project.

There are two ways to run the ws-wsdlc goal:

  • From the command line. For example, after you define an alias:

    mvn –DvariableName1=value1  –DvariableName2=value2  com.oracle.weblogic:weblogic-maven-plugin:ws-wsdlc
    
    
  • By specifying the Maven generate-resources life cycle phase.

    To do this, modify the pom.xml file to specify the generate-resources life cycle phase, the ws-wsdlc goal, and include any parameters you need to set. Then run mvn generate-resources in the same directory of pom.xml.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>maven_plugin.simple</groupId>
  <artifactId>maven_plugin_simple</artifactId>
  <version>1.0</version>
  <build>
    <plugins>
      <plugin>
        <groupId>com.oracle.weblogic</groupId>
        <artifactId>weblogic-maven-plugin</artifactId>
        <version>12.1.2-0-0</version>
        <executions>
          <execution>
            <id>wsdlc</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>ws-wsdlc</goal>
            </goals>
            <configuration>
              <srcWsdl>${basedir}/AddNumbers.wsdl</srcWsdl>
              <destJwsDir>${project.build.directory}/jwsImpl</destJwsDir>
              <destImplDir>${project.build.directory}/output</destImplDir>
              <packageName>maven_plugin.simple</packageName>
              <verbose>true</verbose>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Example 3-19 shows typical ws-wsdlc goal output.

Example 3-19 ws-wsdlc

mvn -f wsdlc_pom.xml generate-resources
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven_plugin_simple 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:ws-wsdlc (wsdlc) @ maven_plugin_simple ---
[INFO] Executing standalone...
 
[INFO] Executing Maven goal 'wsdlc'...
calling method public static void weblogic.wsee.tools.wsdlc.MavenWsdlc.execute(o
rg.apache.maven.plugin.logging.Log,java.util.Map) throws java.lang.Throwable
Catalog dir = C:\Users\maven\AppData\Local\Temp\_ckr59b
Download file [AddNumbers.wsdl] to C:\Users\maven\AppData\Local\Temp\_ckr59b
srcWsdl is redefined as [ C:\Users\maven\AppData\Local\Temp\_ckr59b\AddNumber
s.wsdl ]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

ws-jwsc

Full Name

com.oracle.weblogic:weblogic-maven-plugin:ws-jwsc

Description

Maven goal to build a JAX-WS web service.

The ws-jwsc goal provides a Maven wrapper for the "jwsc" Ant task, which is described in WebLogic Web Services Reference for Oracle WebLogic Server.

Note:

The ws-jwsc goal does not work with the JAX-RPC-only JWS annotations described in "WebLogic-Specific Annotations."

Nested Configuration in module Elements

The ws-jwsc goal supports nested configuration elements, as shown in bold in Example 3-20. See Introduction to the POM for information on Maven projects with multiple modules.

Example 3-20 Nested Configuration Elements

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.test.ws</groupId>
  <artifactId>test-ws-jwsc1</artifactId>
  <version>1.0</version>
  <build>
    <plugins>
      <plugin>
        <groupId>com.oracle.weblogic</groupId>
        <artifactId>weblogic-maven-plugin</artifactId>
        <version>12.1.2-0-0</version>
        <executions>
          <execution>
            <id>first-jwsc</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>ws-jwsc</goal>
            </goals>
            <configuration>
              <srcDir>${basedir}/src/main/java</srcDir>
            <destDir>${project.build.directory}/jwscOutput
                  /${project.build.finalName}</destDir>
              <listfiles>true</listfiles>
              <debug>true</debug>
              
                <module>
                  <name>pocreate</name>
                  <contextPath>mypub</contextPath>
                  <compiledWsdl>D:\maven-test\order_wsdl.jar</compiledWsdl >
                  
                    <jws>
                      <file>examples/wsee/jwsc/POCreateImpl.java</file>
                       <transportType>
                         <type>WLHttpTransport</type>
                         <serviceUri>POCreate</serviceUri>
                         <portName>POCreatePort</portName>
                       </transportType>
                    </jws>
                    <jws></jws>
                   <descriptors>
                     <descriptor>"resources/web.xml"<descriptor/>
                     <descriptor>"resources/weblogic.xml"<descriptor />
                   </descriptors>
                </module>
                <module></module>
              </modules>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>    
</project>

These nested configuration elements for ws-jwsc have the following conditions:

  • You must use at least one of the following elements: jws, jwses, module, or modules.

  • Collection elements such as jwses and modules elements can be omitted.

  • If there is only one child element within the collection element, the collection element can also be removed.

    For example, if there is only one jws element, use jws. If there are multiple jws elements, add all of the jws elements under a jwses element.

  • As with the JWSC ant task, if module has only one jws child element, then other sub elements of module can be nested into jwsc and jwsc/transportType.

Example 3-21 shows an example without a module element in which the jws parameter is a child of ws-jwsc.

Example 3-21 jws Element as Child of ws-jwsc Goal

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.test.ws</groupId>
  <artifactId>test-ws-jwsc</artifactId>
  <version>1.0</version>
  <build>
    <plugins>
      <plugin>
        <groupId>com.oracle.weblogic</groupId>
        <artifactId>weblogic-maven-plugin</artifactId>
        <version>12.1.2-0-0</version>
        <executions>
          <execution>
            <id>first-jwsc</id>
            <phase>compile</phase>
            <goals>
              <goal>ws-jwsc</goal>
            </goals>
            <configuration>
              <srcDir>${basedir}/src/main/java</srcDir>
              <destDir>${project.build.directory}/jwscOutput/
                  ${project.build.finalName}</destDir>
              <jws>            <!-- no parent <module> -->
                <file>examples/wsee/jwsc/POCreateImpl.java</file>
                  <compiledWsdl>${project.build.directory}/purchaseorder_wsdl.jar>
                 <transportType>
                   <type>WLHttpTransport</type>
                 </transportType>
              </jws>
            </configuration>
          </execution>       
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

ws-jwsc Parameters

Table 3-25 briefly describes the ws-jwsc parameters. These parameters are more fully described in Table 2-3 "WebLogic-specific Attributes of the clientgen Ant Task" in WebLogic Web Services Reference for Oracle WebLogic Server.

Table 3-25 ws-jwsc Parameters

Name Type Required Description

applicationXml

java.lang.String

false

Specifies the full name and path of the application.xml deployment descriptor of the Enterprise Application. If you specify an existing file, the ws-jwsc goal updates it to include the Web services information. However, jwsc does not automatically copy the updated application.xml file to the destDir; you must manually copy this file to the destDIR. If the file does not exist, jwsc creates it.

The ws-jwsc goal also creates or updates the corresponding weblogic-application.xml file in the same directory. If you do not specify this attribute, jwsc creates or updates the file destDir/META-INF/application.xml, where destDir is the jwsc attribute.

debug

boolean

false

Turns on additional debug output.

destDir

java.lang.String

true

Specifies the full pathname of the directory that will contain the compiled JWS files, XML Schemas, WSDL, and generated deployment descriptor files, all packaged into a JAR or WAR file.

destEncoding

java.lang.String

false

Specifies the character encoding of the output files, such as the deployment descriptors and XML files. Examples of character encodings are SHIFT-JIS and UTF-8. The default value of this attribute is UTF-8.

jws

Jws

false

There is only one <jws> element.

See Table 3-26 for a description of jws parameters.

jwses

Jws

false

It contains more than one< jws> element.

keepGenerated

boolean

false

Specifies whether the Java source files and artifacts generated by this goal should be regenerated if they already exist.

If you specify false, new Java source files and artifacts are always generated and any existing artifacts are overwritten. If you specify true, the goal regenerates only those artifacts that have changed, based on the timestamp of any existing artifacts

listfiles

boolean

false

Specifies whether to list all of the files.

module

Module

false

It contains one <module> element.

See Table 3-27 for a description of module parameters.

modules

Module

false

It contains more than one <module> element.

optimize

boolean

false

Specifies the flag to set when optimization is required. Defaults to true.

sourcepath

java.lang.String

true

The full pathname of top-level directory that contains the Java files referenced by the JWS file, such as JavaBeans used as parameters or user-defined exceptions.

srcDir

java.lang.String

true

Specifies the full pathname of the top-level directory that contains the JWS file you want to compile.

srcEncoding

java.lang.String

false

Specifies the character encoding of the input files, such as the JWS file or configuration XML files.

Examples of character encodings are SHIFT-JIS and UTF-8. The default value of this attribute is the character encoding set for the JVM.

verbose

boolean

false

Specifies verbose output


jws Parameter

As described in "jws", the jws parameter specifies the name of a JWS file that implements your Web service and for which the ws-jwsc goal should generate Java code and supporting artifacts, and then package them into a deployable WAR file inside of an Enterprise Application.

You can specify the jws parameter in two ways:

  • An immediate child element of the ws-jwsc goal. In this case, ws-jwsc generates a separate WAR file for each JWS file. You typically use this method if you are specifying just one JWS file to the ws-jwsc goal.

  • A child element of the module parameter, which in turn is a child of the ws-jwsc goal. In this case, ws-jwsc generates a single WAR file that includes all the generated code and artifacts for all the JWS files grouped within the module parameter.

    This method is useful if you want all JWS files to share supporting files, such as common Java data types.

Table 3-26 describes the child parameters of the jws parameter. The description specifies whether the parameter applies in the case that jws is a child of the ws-jwsc goal, is a child of module, or both.

Table 3-26 jws Parameters

Name Type Required Description Child of ws-jwsc, module, or both

compiledWsdl

java.lang.String

false

Specifies the full pathname of the JAR file generated by the ws-wsdlc goal based on an existing WSDL file.

Only required for the "starting from WSDL" use case.

both

contextPath

java.lang.String

false

Specifies the deployed context of the web service.

ws-jwsc

explode

boolean

false

Specifies the flag to set when you want exploded output. Defaults to true.

ws-jwsc

file

java.lang.String

true

The name of the JWS file that you want to compile. The ws-jwsc goal looks for the file in the srcdir directory.

both

generateWsdl

boolean

true

Specifies whether the generated WAR file includes the WSDL file in the WEB-INF directory. Default value is false.

both

jmstransportservice

boolean

false

Use JMS transport for Web services. It can be omitted. See Table 3-30 for a description of jmstransportservice parameters.

ws-jwsc

name

java.lang.String

false

Specifies the name of the generated WAR file (or exploded directory, if the explode attribute is set to true) that contains the deployable Web service.

ws-jwsc

transportType

transportType

false

Used when it contains only one transport type element. It can be omitted.

See Table 3-29 for a description of transportType parameters.

both

transportTypes

transportType

false

Used when it contains more than one transport type element. It can be omitted.

See Table 3-29 for a description of transportType parameters.

both

wsdlOnly

boolean

false

Specifies that only a WSDL file should be generated for this JWS file. The default value is false.

ws-jwsc


module Parameters

As described in "module", the module parameter groups one or more jws parameters together so that their generated code and artifacts are packaged in a single Web application (WAR) file. The module parameter is a child of the ws-jwsc goal.

Table 3-27 describes the parameters of the module parameter.

Table 3-27 module Parameters

Name Type Required Description

clientgen

java.lang.String

false

There is only one <clientgen> element. It can be omitted.

clientgens

java.lang.String

false

There is more than one <clientgen> element. It can be omitted.

contextPath

java.lang.String

false

Specifies the deployed context of the Web service.

descriptor

java.lang.String

false

Specifies the web.xml descriptor to use if a new one should not be generated. The path should be fully qualified. The files should be separated by ", ".

ejbWsInWar

boolean

false

Specifies whether to package EJB-based Web services in a WAR file instead of a JAR file.

explode

boolean

false

Specifies the flag to set when you want exploded output. Defaults to true.

FileSet

FileSet

false

Used when it contains one FileSet element. It can be omitted.

FileSets

FileSet

false

Used when it contains more than one FileSet element. It can be omitted.

generateWsdl

boolean

true

Specifies whether the generated WAR file includes the WSDL file in the WEB-INF directory. Default value is false.

jws

Jws

false

Used when it contains one jws element. It can be omitted.

jwses

Jws

false

Used when it contains more than one jws element. It can be omitted.

name

java.lang.String

false

Specifies the name of the WAR to use when evaluating the ear file.

wsdlOnly

boolean

false

Specifies that only a WSDL file should be generated for this JWS file. The default value is false.

zipfileset

java.lang.String

false

There is only one <zipfileset> element.


FileSet Parameters

As described in "fileset", the FileSet parameter specifies one or more directories in which the ws-jwsc goal searches for JWS files to compile. The list of JWS files that ws-jwsc finds is then treated as if each file had been individually specified with the jws parameter of module.

The FileSet parameter is a child of the ws-jwsc goal.

Table 3-28 describes the parameters of the FileSet parameter.

Table 3-28 FileSet Parameters

Name Type Required Description

srcDir

java.lang.String

true

Specifies the directories (separated by semi-colons) that the ws-jwsc goal should search for JWS files to compile.

prefix

java.lang.String

false

Prefix to use.

sourceIncludes

java.lang.String

false

Specifies the explicit includes-list for the file set.

sourceExcludes

java.lang.String

false

Specifies the explicit excludes-list for the file set.


TransportType Parameters

As described in "WLHttpTransport", "WLHttpsTransport", and "WLJMSTransport", you use transport parameters to specify the transport type, context path, and service URI sections of the URL used to invoke the Web service, as well as the name of the port in the generated WSDL.

The ws-jwsc goal combines these transport parameters into one, TransportType.

Table 3-28 describes the parameters of the transportType parameter.

Table 3-29 transportType Parameters

Name Type Required Description

transportTypeName

java.lang.String

true

Specifies the value is WLHttpTransport, WLHttpsTransport, or WLJMSTransport.

Default value is WLHttpTransport.

serviceUri

java.lang.String

false

Specifies the Web service URI portion of the URL.

contextPath

java.lang.String

false

Specifies the deployed context of the Web service.

portName

java.lang.String

false

Specifies the name of the port in the generated WSDL.


Table 3-30 describes the parameters of the jmstransportservice parameter.

Table 3-30 jmstransportservice Parameters

Name Type Required Description

destinationName

java.lang.String

false

JNDI name of the destination queue or topic. Default value is com.oracle.webservices.jms.RequestQueue.

destinationType

java.lang.String

false

Valid values include: QUEUE or TOPIC. Default value is QUEUE.

replyToName

java.lang.String

false

JNDI name of the JMS destination to which the response message is sent.

targetService

java.lang.String

false

Port component name of the Web service.

jndiInitialContextFactory

java.lang.String

false

Name of the initial context factory class used for JNDI lookup. Default value is weblogic.jndi.WLInitialContextFactory.

jndiConnectionFactoryName

java.lang.String

 

JNDI name of the connection factory that is used to establish a JMS connection. Default value is com.oracle.webservices.jms.ConnectionFactory.

jndiUrl

java.lang.String

 

JNDI provider URL. Default value is t3://localhost:7001.

deliveryMode

java.lang.String

 

Delivery mode indicating whether the request message is persistent. Valid values are PERSISTENT and NON_PERSISTENT. Default value is PERSISTENT.

timeToLive

long

false

Lifetime, in milliseconds, of the request message. Default value is 180000L.

priority

int

false

JMS priority associated with the request and response message. Default value is 0.

jndiContextParameter

java.lang.String

false

JNDI properties, in a format like: someParameterName1=someValue1 , someParameterName2=someValue2.

bindingVersion

java.lang.String

false

Version of the SOAP JMS binding. Default value is 1.0.

runAsPrincipal

java.lang.String

false

Principal used to run the listening MDB.

runAsRole

java.lang.String

false

Role used to run the listening MDB.

messageType

java.lang.String

false

Message type to use with the request message. Valid values are com.oracle.webservices.api.jms.JMSMessageType.BYTES and com.oracle.webservices.api.jms.JMSMessageType.TEXT. Default value is BYTES.

enableHttpWsdlAccess

boolean

false

Boolean flag that specifies whether to publish the WSDL through HTTP. Default value is true.

mdbPerDestination

boolean

false

Boolean flag that specifies whether to create one listening message-driven bean (MDB) for each requested destination. Default value is true.

activationConfig

java.lang.String

false

Activation configuration properties passed to the JMS provider.

contextPath

java.lang.String

false

The deployed context of the web service.

serviceUri

java.lang.String

false

Web service URI portion of the URL.

portName

java.lang.String

false

The name of the port in the generated WSDL.


Usage Example

The ws-jwsc goal builds a JAX-WS web service.

This goal benefits from the convention-over-configuration approach, allowing you to execute it using the defaults of the project.

To run the ws-jwsc goal, specify the Maven generate-resources phase.

To do this, modify the pom.xml file to specify the generate-resources phase, the ws-jwsc goal, and include any pa parameters you need to set. Then run mvn generate-resources in the same directory of pom.xml.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>maven_plugin.simple</groupId>
  <artifactId>maven_plugin_simple</artifactId>
  <version>1.0</version>
  <build>
    <plugins>
      <plugin>
        <groupId>com.oracle.weblogic</groupId>
        <artifactId>weblogic-maven-plugin</artifactId>
        <version>12.1.2-0-0</version>
        <executions>
          <execution>
            <id>jwsc</id>
            <phase>generate-resources</phase>
            <goals>
              <goal>ws-jwsc</goal>
            </goals>
            <configuration>
              <destDir>${project.build.directory}/jwscOutput/
              <listfiles>true</listfiles>
              <debug>true</debug>
              <jws>            <!-- no parent <module> -->
                <file>examples/wsee/jwsc/POCreateImpl.java</file>
                  <compiledWsdl>${project.build.directory}/purchaseorder_wsdl.jar>
                 <transportType>
                   <type>WLHttpTransport</type>
                 </transportType>
</jws>
              <verbose>true</verbose>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Example 3-22 shows typical ws-jwsc goal output.

Example 3-22 ws-jwsc

mvn -f jwsc_pom.xml generate-resources
INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building maven_plugin_simple 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- weblogic-maven-plugin:12.1.2-0-0:ws-jwsc (jwsc) @ maven_plugin_simple ---
[INFO] Executing standalone...
 
INFO] Executing Maven goal 'jwsc'...
calling method public static void weblogic.wsee.tools.jws.MavenJwsc.execute(org.apache.maven.plugin.logging.Log,
java.util.Map) throws java.lang.Throwable
[EarFile] Application File : C:\maven-doc\jwsc-test-2\output\META-INF\application.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS