3 Using the WebLogic 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 when needed.

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.2.5 is included with WebLogic Server in the following location: ORACLE_HOME\oracle_common\modules\org.apache.maven_3.2.5. This is a copy of the standard Maven 3.2.5 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.

Note:

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

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

    3. mvn com.oracle.maven:oracle-maven-sync:push -DoracleHome=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.2.1-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, wsgen, wsimport, ws-jwsc, ws-wsdlc, and ws-clientgen goals require a POM.

Other goals will work either way. For example, install, wlst, wlst-client, 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.2.1-0-0</version>
        <configuration>
<middlewareHome>/fmwhome/wls12210</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, purge-tasks, redeploy, update-app, start-app, stop-app, wlst, wlst-client, and list-apps

post-integration-testFoot 2 

remove-domain, 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.2.1-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.2.1-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.

install

Installs WebLogic Server.

list-apps

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

purge-tasks

Flushes out retired deployment tasks.

redeploy

Redeploys a running application or part of a running application.

remove-domain

Removes a domain directory.

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.

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.

wlst-client

WLST wrapper that does not require a local server install for WLST online commands.

ws-clientgen

Generates client Web service artifacts from a WSDL.

wsgen

JAX-WS service endpoint implementation class and generates all of the portable artifacts for a JAX-WS Web service.

wsimport

Maven goal that parses a WSDL and binding files and generates the Java code needed to access it

ws-jwsc

Builds a JAX-WS Web service.

ws-wsdlc

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


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 an alternate descriptor. May be used to specify an alternate application.xml for an .ear deployment or an alternate web.xml or ejb.xml for standalone module deployments.

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".
The 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".
The 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.2.1-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 Aug 19 10:52:46 EST 2015
[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. This is a convenience goal for the simple use case. For more complex domain creation, use the wlst goal. If the domain is already created, stdout prints a status message but the goal does not fail.

Note:

Beginning in version 12.2.1, there is a single unified version of WLST that automatically includes the WLST environment from all products in the ORACLE_HOME.

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

Deprecated. As of version 12.2.1, there is a single, unified version of WLST. This parameter is deprecated and ignored.

workingDir

java.lang.String

false

The current working directory where the create-domain goal executes. The default value is: ${project.build.directory}/weblogic-maven-plugin


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/wls12210</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.2.1-0-0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- weblogic-maven-plugin:12.2.1-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 Aug 19 13:13:25 EDT 2015
[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.

altappdd

java.lang.String

false

Specifies an alternate descriptor. May be used to specify an alternate application.xml for an .ear deployment or an alternate web.xml or ejb.xml for standalone module deployments.

appversion

java.lang.String

false

Version of the application to start.

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.

libimplver

java.lang.String

false

Implementation version of a Java EE library or optional package. This option can be used only if the library or package does not include an implementation version in its manifest file.

library

boolean

false

Deploy as a shared Java EE library or optional package.

libspecver

java.lang.String

false

Specification version of a Java EE library or optional package. This option can be used only if the library or package does not include a specification version in its manifest file.

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

partition

java.lang.String

false

Specifies the name of the partition associated with the resource group to which you want to deploy an application or library.

For deploy and distribute operations, you must specify the name of the partition resource group to which you want to deploy or distribute applications or libraries by setting the resourceGroup attribute. If only one resource group exists in the specified partition, then the resourceGroup attribute is optional. The partition parameter is optional for partition administrators.

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

resourceGroup

java.lang.String

false

Specifies the name of the resource group at the partition or domain level to which you want to deploy an application or library.

For deploy and distribute operations, you must specify the name of the resource group to which you want to deploy or distribute applications or libraries by setting the resourceGroup attribute. For partitions, if only one resource group exists in the specified partition, then the resourceGroup attribute is optional.

For other supported deployment actions, you do not specify the resourceGroup attribute, as WebLogic Server derives the resource group from the unique application name.

resourceGroupTemplate

java.lang.String

false

Specifies the name of the resource group template to which you want to deploy an application or library.

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 address of the artifact to deploy. The address can be one of the following:

  • A colon (:) separated list of Maven coordinates of the form: groupId:artifactId:packaging:classifier:version.

  • An archive file or exploded archive directory on the local system. For example, /home/myhome/myapps/helloworld.war.

  • A remote HTTP URL (http://foo/a/b.ear).

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.

usenonexclusivelock

boolean

false

When true, the deployment operation uses an existing lock, already acquired by the same user, on the domain. This parameter is helpful in environments where multiple deployment tools are used simultaneously and one of the tools has already acquired a lock on the domain configuration.

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.2.1-0-0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-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
<Aug 19, 2015> <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 Aug 19 13:41:11 EDT 2015
[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

partition

java.lang.String

false

Specifies the name of the partition associated with the resource group on which you want to distribute an application or library.

For deploy and distribute operations, you must specify the name of the partition resource group to which you want to deploy or distribute applications or libraries by setting the resourceGroup attribute. If only one resource group exists in the specified partition, then the resourceGroup attribute is optional. The partition parameter is optional for partition administrators.

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

resourceGroup

java.lang.String

false

Specifies the name of the resource group at the partition or domain level on which you want to distribute an application or library.

For deploy and distribute operations, you must specify the name of the resource group to which you want to deploy or distribute applications or libraries by setting the resourceGroup attribute. For partitions, if only one resource group exists in the specified partition, then the resourceGroup attribute is optional.

For other supported deployment actions, you do not specify the resourceGroup attribute, as WebLogic Server derives the resource group from the unique application name.

resourceGroupTemplate

java.lang.String

false

Specifies the name of the resource group template on which you want to distribute an application or library.

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 address of the artifact to distribute. The address can be one of the following:

  • A colon (:) separated list of Maven coordinates of the form: groupId:artifactId:packaging:classifier:version.

  • An archive file or exploded archive directory on the local system. For example, /home/myhome/myapps/helloworld.war.

  • A remote HTTP URL (http://foo/a/b.ear).

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/wls12210
 -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.2.1-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
<Aug 19, 2015> <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 Aug 19 14:10:00 EST 2015
[INFO] Final Memory: 15M/429M
[INFO] ------------------------------------------------------------------------

install

Full Name

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

Description

Installs WebLogic Server from a JAR.

Parameters

Table 3-8 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/wls_generic.jar).

  • A remote HTTP URL (http://myarchive/installers/wls_generic.jar).

installCommand

java.lang.String

false

Installs the product with a binary or jar installer (including the quickstart installers.) The following macros are supported:

  • @INSTALLER_FILE@ - the path to the installer file.

  • @INSTALL_TO_LOCATION@ - the target directory (only relevant for the quickstart installer).

  • @JAVA_HOME@ - path to the Java home.

  • @JAVA_TMPDIR@ - path to the Java temporary directory.

  • @RESPONSE_FILE@ - path to the OUI silent installer response file.

  • @INV_PTR_LOC_FILE@ - path to the OUI invPtrLoc file.

JAR installer example:

@JAVA_HOME@/bin/java -Xms512m -Xmx1024m -Djava.io.tmpdir=@JAVA_TMPDIR@      -jar @INSTALLER_FILE@ -silent -responseFile @RESPONSE_FILE@ -invPtrLoc      @INV_PTR_LOC_FILE@

Quick Start JAR installer example:

@JAVA_HOME@/bin/java -Xms512m -Xmx1024m -Djava.io.tmpdir=@JAVA_TMPDIR@      -jar @INSTALLER_FILE@ ORACLE_HOME=@INSTALL_TO_LOCATION@

This parameter is optional.

If specified for a quickstart installer when the supplementalQuickStartLocation parameter is supplied, the same command is used for the supplemental quickstart installer by replacing the @INSTALLER_FILE@ macro with the file location derived from the supplementalQuickStartLocation parameter.

If the @INSTALLER_FILE@ macro is not being used, the install goal replaces the argument following the '-jar' argument in the installCommand string with the supplemental quickstart installer JAR file name.

installDir

java.lang.String

true

Deprecated. Use the middlewareHome parameter instead.

invPtrLoc

java.lang.String

false

The silent installer inventory location file. This is required on Unix-based platforms when using the binary or JAR installers.

middlewareHome

java.lang.String

false

The ORACLE_HOME directory to install into when using the quickstart installer.

quickStartInstaller

boolean

false

Indicates that this is a quickstart installer. The quickstart installer requires you to specify the artifactLocation and installDir parameter. All other parameters are ignored when this parameter is set to true. The default value is false.

response

java.lang.String

false

Deprecated. Use the responseFile parameter instead.

responseFile

java.lang.String

false

The silent installer response file. This is required when using the binary or jar installers.

supplementalQuickStartLocation

java.lang.String

false

The Quick Start supplemental installer.


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.

Example 3-7 shows an example of installing WebLogic Server using a JAR file on a Windows-based system.

Example 3-7 Install From JAR File

mvn com.oracle.weblogic:weblogic-maven-plugin:install
 -DartifactLocation=c:\wls-temp\wls_jrf_generic.jar  
-DinstallDir=C:\test-maven -DresponseFile=c:\wls-temp\response.txt
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:install (default-cli) @ standalone-p
om ---
[INFO] [install]ORACLE_HOME = C:\test-maven\Oracle\Middleware\Oracle_Home
[INFO] Executing:  [cmd:[C:\\Windows\\System32\\cmd.exe, /c, C:\weblogic\dev\AUT
O_D~1\x86_64\JDK180~3\JDK18~1.0_4\jre\bin\java.exe -Xms1024m -Xmx1024m -Djava.io
.tmpdir=C:\Users\user\AppData\Local\Temp\ -jar c:\wls-temp\wls_jrf_g
eneric.jar -silent -responseFile c:\wls-temp\response.txt ]]
[INFO] Process being executed, waiting for completion.
[INFO] [exec] Launcher log file is C:\Users\user\AppData\Local\Temp\OraInsta
ll2015-04-23_09-45-13AM\launcher2015-04-23_09-45-13AM.log.
[INFO] [exec] Extracting files..................................................
................................................................................
...................................
[INFO] [exec] Starting Oracle Universal Installer
[INFO] [exec]
[INFO] [exec] Checking if CPU speed is above 300 MHz.   Actual 2491    Passed
[INFO] [exec] Checking swap space: must be greater than 512 MB    Passed
[INFO] [exec] Checking if this platform requires a 64-bit JVM.   Actual 64 Pa
ssed (64-bit not required)
[INFO] [exec]
[INFO] [exec]
[INFO] [exec] Preparing to launch the Oracle Universal Installer from C:\Users\
user\AppData\Local\Temp\OraInstall2015-04-23_09-45-13AM
[INFO] [exec] Log: C:\Users\user\AppData\Local\Temp\OraInstall2015-04-23_09-
45-13AM\install2015-04-23_09-45-13AM.log
[INFO] [exec] Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights
 reserved.
[INFO] [exec] Reading response file..
[INFO] [exec] -nocheckForUpdates / SKIP_SOFTWARE_UPDATES flag is passed and henc
e skipping software update
[INFO] [exec] Skipping Software Updates...
[INFO] [exec] Starting check : CertifiedVersions
[INFO] [exec] Expected result: One of 6.1,6.2,6.3
[INFO] [exec] Actual Result: 6.1
[INFO] [exec] Check complete. The overall result of this check is: Passed
[INFO] [exec] CertifiedVersions Check: Success.
[INFO] [exec] Starting check : CheckJDKVersion
[INFO] [exec] Expected result: 1.8.0_40
[INFO] [exec] Actual Result: 1.8.0_40-ea
[INFO] [exec] Check complete. The overall result of this check is: Passed
[INFO] [exec] CheckJDKVersion Check: Success.
[INFO] [exec] Validations are enabled for this session.
[INFO] [exec] Verifying data......
[INFO] [exec] Copying Files...
[INFO] [exec] -----------20%----------40%----------60%----------80%-----Visit ht
tp://www.oracle.com/support/policies.html for Oracle Technical Support policies.
 
[INFO] [exec] ---100%
[INFO] [exec]
[INFO] [exec] The installation of Oracle Fusion Middleware 12c Infrastructure 12
.2.1.0.0 completed successfully.
[INFO] [exec] Logs successfully copied to C:\weblogic\src
\inventory\logs.
[INFO] Installer exited with code: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS

Example 3-8 shows an example of installing WebLogic Server using a JAR file and the installCommand parameter on a Windows-based system.

Example 3-8 Install From JAR File With installCommand

mvn com.oracle.weblogic:weblogic-maven-plugin:install 
-DinstallCommand="@JAVA_HOME@/bin/java -Xms512m -Xmx1024m 
-jar  @INSTALLER_FILE@ -silent -responseFile c:\wls-temp\response.txt" 
-DartifactLocation=c:\wls-temp\wls_jrf_generic.jar
-DresponseFile=c:\wls-temp\response.txt
INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:install (default-cli) @ standalone-p
om ---
[INFO] [install]ORACLE_HOME = C:\test-maven\Oracle\Middleware\Oracle_Home
[INFO] Executing:  [cmd:[C:\\Windows\\System32\\cmd.exe, /c, C:\weblogic\dev\AUT
O_D~1\x86_64\JDK180~3\JDK18~1.0_4\jre/bin/java -Xms512m -Xmx1024m -jar  c:\wls-t
emp\wls_jrf_generic.jar -silent -responseFile c:\wls-temp\response.txt]]
[INFO] Process being executed, waiting for completion.
[INFO] [exec] Launcher log file is C:\Users\user\AppData\Local\Temp\OraInsta
ll2015-04-23_10-58-13AM\launcher2015-04-23_10-58-13AM.log.
[INFO] [exec] Extracting files..................................................
................................................................................
.................
[INFO] [exec] Starting Oracle Universal Installer
[INFO] [exec]
[INFO] [exec] Checking if CPU speed is above 300 MHz.   Actual 2491    Passed
[INFO] [exec] Checking swap space: must be greater than 512 MB    Passed
[INFO] [exec] Checking if this platform requires a 64-bit JVM.   Actual 64    Pa
ssed (64-bit not required)
[INFO] [exec]
[INFO] [exec]
[INFO] [exec] Preparing to launch the Oracle Universal Installer from C:\Users\
user\AppData\Local\Temp\OraInstall2015-04-23_10-58-13AM
[INFO] [exec] Log: C:\Users\user\AppData\Local\Temp\OraInstall2015-04-23_10-
58-13AM\install2015-04-23_10-58-13AM.log
[INFO] [exec] Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights
 reserved.
[INFO] [exec] Reading response file..
[INFO] [exec] -nocheckForUpdates / SKIP_SOFTWARE_UPDATES flag is passed and henc
e skipping software update
[INFO] [exec] Skipping Software Updates...
[INFO] [exec] Starting check : CertifiedVersions
[INFO] [exec] Expected result: One of 6.1,6.2,6.3
[INFO] [exec] Actual Result: 6.1
[INFO] [exec] Check complete. The overall result of this check is: Passed
[INFO] [exec] CertifiedVersions Check: Success.
[INFO] [exec] Starting check : CheckJDKVersion
[INFO] [exec] Expected result: 1.8.0_40
[INFO] [exec] Actual Result: 1.8.0_40-ea
[INFO] [exec] Check complete. The overall result of this check is: Passed
[INFO] [exec] CheckJDKVersion Check: Success.
[INFO] [exec] Validations are enabled for this session.
[INFO] [exec] Verifying data......
[INFO] [exec] Copying Files...
[INFO] [exec] -----------20%----------40%----------60%----------80%-----Visit ht
tp://www.oracle.com/support/policies.html for Oracle Technical Support policies.
 
[INFO] [exec] ---100%
[INFO] [exec]
[INFO] [exec] The installation of Oracle Fusion Middleware 12c Infrastructure 12
.2.1.0.0 completed successfully.
[INFO] [exec] Logs are located here: C:\Users\user\AppData\Local\Temp\OraIns
tall2015-04-23_10-58-13AM.
[INFO] Installer exited with code: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[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-9 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.

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-9 shows typical list-apps goal output.

Example 3-9 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.2.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-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: Wed Aug 19 11:33:51 EDT 2015
[INFO] Final Memory: 11M/28M
[INFO] ------------------------------------------------------------------------
C:\Oracle\Middleware\Oracle_Home\wlserver\server\lib>

purge-tasks

Full Name

com.oracle.weblogic:weblogic-maven-plugin:purge-tasks

Description

Flushes out retired deployment tasks.

Parameters

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

debug

boolean

false

When true, compiles debugging information into class files.
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

password

java.lang.String

false

Specifies the administrative password.

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


Use the purge-tasks goal to flush out retired deployment tasks.

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

Example 3-11 shows typical purge-tasks goal output.

Example 3-10 purge-tasks

mvn  com.oracle.weblogic:weblogic-maven-plugin:purge-task
s -Duser=weblogic -Dpassword=password
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:purge-tasks (default-cli) @ standalo
ne-pom ---
weblogic.Deployer invoked with options:  -noexit -user weblogic -adm
inurl t3://localhost:7001
Currently there are no retired tasks.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.139s
[INFO] Finished at: Wed Aug 19 11:33:51 EDT 2015
[INFO] Final Memory: 8M/24M
[INFO] ------------------------------------------------------------------------

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

appversion

java.lang.String

false

Version of the application to start.

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.

libimplver

java.lang.String

false

Implementation version of a Java EE library or optional package. This option can be used only if the library or package does not include an implementation version in its manifest file.

library

boolean

false

Deploy as a shared Java EE library or optional package.

libspecver

java.lang.String

false

Specification version of a Java EE library or optional package. This option can be used only if the library or package does not include a specification version in its manifest file.

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.

partition

java.lang.String

false

Specifies the name of the partition associated with the resource group on which you want to redeploy an application or library.

The partition parameter is optional for partition administrators.

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.

removePlanOverride

boolean

false

Removes an overridden deployment plan during a redeploy or update deployment action.

For applications or libraries deployed to a resource group, you can override the application configuration defined in a resource group template that a resource group references. To remove an application override, specify the removePlanOverride attribute.

resourceGroupTemplate

java.lang.String

false

Specifies the name of the resource group template on which you want to redeploy an application or library.

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 address of the artifact to redeploy. The address can be one of the following:

  • A colon (:) separated list of Maven coordinates of the form: groupId:artifactId:packaging:classifier:version.

  • An archive file or exploded archive directory on the local system. For example, /home/myhome/myapps/helloworld.war.

  • A remote HTTP URL (http://foo/a/b.ear).

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-11 shows typical redeploy goal output.

Example 3-11 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.2.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-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
<Aug 19, 2015> <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: Wed Aug 19 11:33:51 EDT 2015

remove-domain

Full Name

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

Description

Removes a domain directory. The domain must not be running for this goal to succeed. This is a convenience goal for the simple use case. If the domain is already removed, stdout prints a status message but the goal does not fail.

Parameters

Table 3-12 remove-domain Parameters

Name Type Required Description

domainHome

java.lang.String

true

The path to the domain directory.

workingDir

java.lang.String

false

Specifies the current working directory.

Default value is: ${project.build.directory}/weblogic-maven-plugin)


Use the remove-domain goal to remove a domain directory.

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

Example 3-13 shows typical remove-domain goal output.

Example 3-12 remove-domain

mvn com.oracle.weblogic:weblogic-maven-plugin:remove-domain
-DdomainHome=C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain
:
[INFO] [remove-domain]Executing: [cmd:[C:\\Windows\\System32\\cmd.exe, /c, rmdir
 /Q /S C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain]]
[INFO] Process being executed, waiting for completion.
[INFO] [remove-domain][cmd:[C:\\Windows\\System32\\cmd.exe, /c, rmdir /Q /S C:\O
racle\Middleware\Oracle_Home\user_projects\domains\base_domain]] exit code=0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:01.074s
[INFO] Finished at: Wed Aug 19 11:33:51 EDT 2015
[INFO] Final Memory: 8M/20M
[INFO] ------------------------------------------------------------------------

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

partition

java.lang.String

false

Specifies the name of the partition associated with the resource group on which you want to start an application or library.

The partition parameter is optional for partition administrators.

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.

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 all targets to which the application is deployed.

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 start 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-13 shows typical start-app goal output.

Example 3-13 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.2.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-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
<Aug 19, 2015> <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: Wed Aug 19 11:33:51 EDT 2015
[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. This is a convenience goal for the simple use case. If the server is already started, stdout prints a status message but the goal does not fail.

Parameters

Table 3-14 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-14 shows typical start-server goal output.

Example 3-14 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.2.1-0-0
[INFO] ------------------------------------------------------------------------[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-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 Aug 19 11:33:51 EDT 2015
[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-15 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.

partition

java.lang.String

false

Specifies the name of the partition associated with the resource group on which you want to stop an application or library.

The partition parameter is optional for partition administrators.

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.

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.

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-15 shows typical stop-app goal output.

Example 3-15 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.2.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-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
<Aug 19, 2015> <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: Wed Aug 19 11:33:51 EDT 2015
[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. This is a convenience goal for the simple use case. If the server is already stopped, stdout prints a status message but the goal does not fail.

Parameters

Table 3-16 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 the domainHome 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-16 shows typical stop-server goal output.

Example 3-16 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.2.1-0-0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-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 Aug 19 11:33:51 EDT 2015
[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-17 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.

partition

java.lang.String

false

Specifies the name of the partition associated with the resource group on which you want to update an application or library.

The partition parameter is optional for partition administrators.

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.

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

resourceGroupTemplate

java.lang.String

false

Specifies the name of the resource group template from which you want to undeploy an application or library.

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.

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-17 shows typical undeploy goal output.

Example 3-17 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.2.1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-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
<Aug 19, 2015> <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: Wed Aug 19 11:33:51 EDT 2015
[INFO] Final Memory: 9M/26M
[INFO] ------------------------------------------------------------------------

uninstall

Full Name

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

Description

Uninstalls WebLogic Server.

Parameters

Table 3-18 uninstall Parameters

Name Type Required Description

invPtrLoc

java.io.File

true

This parameter is deprecated and ignored.

middlewareHome

java.lang.String

true

The Oracle Middleware installation directory. This parameter is required when uninstalling a server installed using the Quickstart installer. Otherwise, it is ignored and the location in the responseFile is used.

response

java.io.File

true

Deprecated. Use the responseFile parameter.

responseFile

java.io.File

true

The silent installer response file. This is required when using the binary or JAR installers.


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/wls12210</middlewareHome>
</configuration>
</execution>

Example 3-18 shows an example of uninstalling WebLogic Server in a JAR file installation.

Example 3-18 uninstall in JAR Installation

mvn com.oracle.weblogic:weblogic-maven-plugin:uninstall -DresponseFile=c:\wls-temp\response.txt
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:uninstall (default-cli) @ standalone
-pom ---
[INFO] [uninstall]ORACLE_HOME = C:\test-maven\Oracle\Middleware\Oracle_Home
[INFO] [uninstall]ORACLE_HOME = C:\test-maven\Oracle\Middleware\Oracle_Home
[INFO] Executing:  [cmd:[C:\\Windows\\System32\\cmd.exe, /c, C:\test-maven\Oracl
e\Middleware\Oracle_Home\oui\bin\deinstall.cmd -noconsole -deinstall -silent -re
sponseFile c:\wls-temp\response.txt]]
[INFO] Process being executed, waiting for completion.
[INFO] Installer exited with code: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

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

partition

java.lang.String

false

Specifies the name of the partition associated with the resource group on which you want to update an application or library.

The partition parameter is optional for partition administrators.

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.

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

removePlanOverride

boolean

false

Removes an overridden deployment plan during a redeploy or update deployment action.

For applications or libraries deployed to a resource group, you can override the application configuration defined in a resource group template that a resource group references. To remove an application override, specify the removePlanOverride attribute.

resourceGroupTemplate

java.lang.String

false

Specifies the name of the resource group template on which you want to update an application or library.

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

The targets on which to update the application or module. This attribute can be a comma-separated list. If no targets are specified, all targets are updated.

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-19 shows typical wlst goal output.

Example 3-19 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.2.1-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
<Aug 19, 2015> <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 Aug 19 11:33:51 EDT 2015
[INFO] Final Memory: 18M/435M
[INFO] ------------------------------------------------------------------------

wlst

Full Name

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

Description

This goal is a wrapper for the WLST scripting tool. It requires a server install for WLST online commands.

Note:

Beginning in version 12.2.1, there is a single unified version of WLST that automatically includes the WLST environment from all products in the ORACLE_HOME.

Parameters

Table 3-20 wlst Parameters

Name Type Required Description

args

java.lang.String

false

Deprecated. Use the scriptArgs parameter to specify the arguments as a list of scriptArg elements.

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!')".

Because Python uses indentation to demarcate nested code blocks, scripts that contain multiple lines must be specified in the POM without any indentation within the pom.xml, unless required for code block demarcation.

scriptArgs

java.lang.String

false

Specifies the command-line arguments to pass to the WLST Jython interpreter as a list of string values. If the argument contains any embedded whitespace, the caller must include enclosing single quotes or escaped double quotes within the scriptArg element's value. If scriptArgs is specified, the args parameter (deprecated) is ignored.

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

This parameter is deprecated and ignored in this release.

workingDir

java.lang.String

false

The current working directory where the wlst-script and create-domain goal executes. The default value is: ${project.build.directory}/weblogic-maven-plugin


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/wls12210</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-20 shows typical wlst goal output.

Example 3-20 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.2.1-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>

wlst-client

Full Name

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

Description

This goal is a WLST wrapper that does not require a local server install for WLST online commands. If a local server install is not present, this goal supports only WLST online commands.

Parameters

Table 3-21 wlst-client Parameters

Name Type Required Description

args

java.lang.String

false

Deprecated. Use the scriptArgs parameter to specify the arguments as a list of scriptArg elements.

Specifies a string value containing command-line arguments to pass to the WLST Python interpreter. The arguments are delimited by spaces. An argument that contains embedded spaces should be quoted either with single quotes or with escaped double quotes. For example, here is a string for args that contains two parameters:

"'Thomas Paine' \"Now is the time that tries men's souls.\""

debug

boolean

false

When true, displays additional status information.

Default value is: false

executeScriptBeforeFile

boolean

false

When true, specifies whether a script, if supplied, executes before or after the file, if supplied. Either a file or a script is required, and both are allowed. See filename and script parameters.

Default value is: true

failOnError

boolean

false

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

Default value is: true

fileName

java.lang.String

false

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

middlewareHome

java.lang.String

false

The path to the Oracle Middleware install directory.

This parameter is required for any WLST offline commands. If a WLST script uses offline commands without specifying a valid middlewareHome, this wlst-client goal fails.

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!')".

Because Python uses indentation to demarcate nested code blocks, scripts that contain multiple lines must be specified in the POM without any indentation within the pom.xml, unless required for code block demarcation.

scriptArgs

java.lang.String

false

Specifies the command-line arguments to pass to the WLST Jython interpreter as a list of string values. If the argument contains any embedded whitespace, the caller must include enclosing single quotes or escaped double quotes within the scriptArg element's value. If scriptArgs is specified, the args parameter (deprecated) is ignored.


Running Scripts With Fusion Middleware Dependencies

If you use the wlst-client goal to run WLST scripts that contain Fusion Middleware dependencies, you must first include the com.oracle.fmwshare dependency to pull in the necessary libraries needed by those scripts.

The com.oracle.fmwshare dependency must be listed before any Fusion Middleware dependencies.

For example, to run a WLST script for SOA, add a dependency on com.oracle.fmwshare and SOA, similar to the following:

<plugin>
 <groupId>com.oracle.weblogic</groupId>
 <artifactId>weblogic-maven-plugin</artifactId>
 <version>12.2.1-0-0</version>
 <executions>
  <execution>
   <id>soa-wlst-client</id>
   <goals>
    <goal>wlst-client</goal>
   </goals>
   <configuration>
    <fileName>${project.basedir}/misc/doSoaStuff.py</fileName>
    <scriptArgs>
     <scriptArg>${adminUserName}</scriptArg>
     <scriptArg>${adminPassword}</scriptArg>
     <scriptArg>${adminUrl}</scriptArg>
    </scriptArgs>
   </configuration>
  </execution>
 </executions>
 <dependencies>
  <dependency>
   <groupId>com.oracle.fmwshare</groupId>
   <artifactId>fmwshare-wlst-dependencies</artifactId>
   <version>12.2.1-0-0</version>
   <type>pom</type>
  </dependency>
  <dependency>
   <groupId>com.oracle.soa</groupId>
   <artifactId>soa-wlst-dependencies</artifactId>
   <version>12.2.1-0-0</version>
   <type>pom</type>
  </dependency>
 </dependencies>
</plugin>
 

Usage Example

The wlst-client 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-client goal does not require a local server install for WLST online commands.

The wlst-client 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-client goal to execute an external WLST script specified with the fileName configuration parameter, you can specify a sequence of WLST commands within the pom.xml file using the script configuration element, or you can use both mechanisms.

For example:

<execution>
<id>wls-wlst-server</id>
<phase>post-integration-test</phase>
<goals>
<goal>wlst-client</goal>
</goals>
<configuration>
<fileName>${project.basedir}/misc/configure_resources.py</fileName>
<args>t3://some-host: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-20 shows typical wlst-client goal output.

Example 3-21 wlst-client

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

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:wlst (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  weblogic-maven-plugin: wlst                                            ++
[INFO] ++====================================================================++
 
*** Creating DataSource ***
 
Connecting to t3://some-host: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

As another example, assume that you have the following simple WLST script:

try:
  connect('weblogic','password','t3://10.151.69.120:7001')
  listApplications() 
  print('TEST PASS')
except:
  print('TEST FAIL') 

You can supply this WLST script with the fileName configuration parameter, as shown in Example 3-22.

Example 3-22 wlst-client Script Example

C:\Oracle\Middleware\Oracle_Home\oracle_common\plugins\maven\com\oracle\maven\or
acle-maven-sync\12.2.1>mvn com.oracle.weblogic:weblogic-maven-plugin:wlst-client
  -DfileName=test.py
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:wlst-client (default-cli) @ standalo
ne-pom ---
[INFO] [wlst-client]No middlewareHome specified.
Connecting to t3://10.151.69.120:7001 with userid weblogic ...
Successfully connected to Admin Server "AdminServer" that belongs to domain "bas
e_domain".
 
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.
 
 jaxwsejb30ws
TEST PASS
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.197s
[INFO] Finished at: Wed Aug 19 11:33:51 EDT 2015
[INFO] Final Memory: 18M/45M
[INFO] ------------------------------------------------------------------------

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>

exit() is Trapped

exit() exits WLST from the user session and closes the scripting shell. By default, WLST calls System.exit(0) for the current WLST JVM when exiting WLST. Because wlst-client runs inside the same JVM as the Maven build process, the entire Maven build process would exit. To provide for this, the Maven implementation traps WLST exit() calls and throws an exception.

Calling exit() explicitly from a WLST script is discouraged.

For example, assume you were to modify the previous WLST script example to include exit(), as follows:

try:
  connect('weblogic','password','t3://10.151.69.120:7001')
  listApplications() 
  exit()
  print('TEST PASS')
except:
  print('TEST FAIL') 

When the Maven implementation traps exit(), it throws an exception:

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.
 
 jaxwsejb30ws
 
 
Exiting WebLogic Scripting Tool.
 
TEST FAIL
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.250s
[INFO] Finished at: Wed Aug 19 11:33:51 EDT 2015
[INFO] Final Memory: 19M/45M
[INFO] ------------------------------------------------------------------------

ws-clientgen

Deprecated

This goal is deprecated in this release.

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-22 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-22 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-23 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.io.File

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-25 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-23 describes the parameters of the bindings parameter.

Table 3-23 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-24 describes the parameters of the xmlCatalog parameter.

Table 3-24 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-25 describes the parameters of the jmstransportclient parameter.

Table 3-25 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.2.1-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-23 shows typical ws-clientgen goal output.

Example 3-23 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.2.1-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

wsgen

Full Name

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

Description

Maven goal that reads a JAX-WS service endpoint implementation class and generates all of the portable artifacts for a JAX-WS Web service. Use the wsgen goal when you are starting from Java classes.

You can then package the service endpoint interface and implementation class, value types, and generated classes, if any, into a WAR file, and deploy the WAR to a Web container.

The wsgen goal provides a wrapper for the JAX-WS Maven wsgen plug-in goal.

Parameters

Table 3-26 describes the wsgen parameters.

Table 3-26 wsgen Parameters

Name Type Required Description

args

java.lang.String

false

Specifies optional command-line options. Multiple elements can be specified, and each token must be placed in its own list.

destDir

java.io.File

false

Specifies the full pathname of where to place output generated classes. Use xnocompile to turn this off. The default is ${project.build.outputDirectory}).

encoding

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 is platform dependent.

extension

boolean

false

extension is always set to true and you do not need to set it. Extensions are not limited to Oracle JAX-WS vendor extensions.

executable

java.lang.String

false

Name of the executable. Can be wsgen.

genWsdl

boolean

false

Specifies that a WSDL file should be generated in ${resourceDestDir}. By default, the WSDL is not generated.

inlineSchemas

boolean

false

Generates inline schemas in a generated WSDL. The default is false.

The genWsdl parameter must be set to true.

jmstransportservice

boolean

false

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

keep

boolean

false

Specifies whether to keep generated files. The default is true.

metadata

java.io.File

false

Metadata file for the wsgen task, as described in External Web Service Metadata in JAX-WS Release Documentation. Unmatched files are ignored.

portName

java.lang.String

false

Specify the port name to use in the generated WSDL. The genWsdl parameter must be set to true.

protocol

java.lang.String

false

Use in conjunction with genWsdl to specify the protocol to use in the wsdl:binding. The genWsdl parameter must be set to true.

Valid values are soap1.1 and Xsoap1.2.

The default is soap soap1.1. Xsoap1.2 is non-standard and you can use it only in conjunction with the extension option.

resourceDestDir

java.io.File

false

Specifies the directory to contain the generated WSDL files. The default is ${project.build.directory}/generated-sources/wsdl. The genWsdl parameter must be set to true.

sei

java.lang.String

false

Specifies the service endpoint implementation class name.

servicename

java.lang.String

false

Specify the service name (wsdl:servicename) to use in the generated WSDL. The genWsdl parameter must be set to true.

sourceDestDir

java.io.File

false

Specify where to place generated source files. This parameter also sets keep to true. The default is ${project.build.directory}/generated-sources/wsgen.

verbose

boolean

false

Output messages about what the tool is doing.
Default value is: false.

vmArgs

java.util.List

false

Specify optional JVM options. You can specify multiple elements, and each token must be placed in its own list.

xdonotoverwrite

boolean

false

No description provided

xnocompile

boolean

false

Turns off compilation after code generation, and lets the generated sources be compiled by Maven during the compilation phase. The default is false.

This parameter also sets keep to true.


Usage Example

The wsgen goal reads a JAX-WS service endpoint implementation class and generates all of the portable artifacts for a JAX-WS Web service.

Specify the Maven process-classes life cycle phase. Then, run mvn process-classes in the same directory of the POM file.

To do this, modify the pom.xml file to specify the process-classes life cycle phase, the wsgen 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>
  <sourceDirectory>.</sourceDirectory>
    <plugins>
      <plugin>
        <groupId>com.oracle.weblogic</groupId>
        <artifactId>weblogic-maven-plugin</artifactId>
        <version>12.2.1-0-0</version>
        <executions>
          <execution>
            <id>wsgen</id>
            <phase>process-classes</phase>
            <goals>
              <goal>wsgen</goal>
            </goals>
            <configuration>
              <destDir>${project.build.directory}/wsgenOutput/</destDir>
             <sei>myexample.IPInfo</sei>             
            <verbose>true</verbose>
            <genWsdl>true</genWsdl>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Example 3-24 shows typical wsgen goal output.

Example 3-24 wsgen

mvn -Dfile=pom.xml process-classes
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven_plugin_simple 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ maven_plug
in_simple ---
[debug] execute contextualize
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources,
i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Oracle\Middleware\Oracle_Home\orac
le_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.2.1\src\main\resou
rces
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ maven_plugin_
simple ---
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. b
uild is platform dependent!
[INFO] Compiling 1 source file to C:\Oracle\Middleware\Oracle_Home\oracle_common
\plugins\maven\com\oracle\maven\oracle-maven-sync\12.2.1\target\classes
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:wsgen (wsgen) @ maven_plugin_simple
---
[INFO] Processing: myexample.IPInfo
[WARNING] Using platform encoding (Cp1252), build is platform dependent!
[INFO] jaxws:wsgen args: [-keep, -s, 'C:\Oracle\Middleware\Oracle_Home\oracle_co
mmon\plugins\maven\com\oracle\maven\oracle-maven-sync\12.2.1\target\generated-so
urces\wsgen', -d, 'C:\Oracle\Middleware\Oracle_Home\oracle_common\plugins\maven\
com\oracle\maven\oracle-maven-sync\12.2.1\target\wsgenOutput', -verbose, -extens
ion, -wsdl, -r, 'C:\Oracle\Middleware\Oracle_Home\oracle_common\plugins\maven\co
m\oracle\maven\oracle-maven-sync\12.2.1\target\generated-sources\wsdl', myexampl
e.IPInfo]
myexample\jaxws\GetIpAddress.java
myexample\jaxws\GetIpAddressResponse.java
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21.309s
[INFO] Finished at: Wed Aug 19 11:33:51 EDT 2015
[INFO] Final Memory: 8M/32M
[INFO] ------------------------------------------------------------------------

In this example, the wsgen goal creates the following files:

target
  classes
   META-INF
      wsdl
        IPInfoService.wsdl
        IPInfoService_schema1.xsd  
      myexample
        IPInfo.class
  generated-sources
      wsdl 
        IPInfoService.wsdl
        IPInfoService_schema1.xsd
      wsgen
        myexample
          jaxws
            GetIpAddress.java
            GetIpAddressResponse.java
  wsgenoutput
        myexample
          jaxws
            GetIpAddress.class
            GetIpAddressResponse.class

wsimport

Full Name

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

Description

Maven goal that parses a WSDL and binding files and generates the Java code needed to access it. Use the wsimport goal when you are starting from a WSDL.

The wsimport goal provides a wrapper for the JAX-WS Maven wsimport goal.

Parameters

Table 3-27 describes the wsimport parameters.

Table 3-27 wsimport Parameters

Name Type Required Description

args

java.lang.String

false

Specifies optional command-line options. Multiple elements can be specified, and each token must be placed in its own list.

bindingDirectory

java.io.File

false

Directory containing binding files.

bindingFiles

java.util.List

false

List of files to use for bindings. If not specified, all .xml files in the bindingDirectory are used.

catalog

java.io.File

false

Catalog file to resolve external entity references support TR9401, XCatalog, and OASIS XML Catalog format.

destDir

java.io.File

false

Specifies the full pathname of where to place output generated classes. Use xnocompile to turn this off. The default is ${project.build.outputDirectory}).

encoding

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 is platform dependent.

executable

java.lang.String

false

Name of the executable. Can be wsimport.

extension

boolean

false

extension is always set to true and you do not need to set it. Extensions are not limited to Oracle JAX-WS vendor extensions.

genJWS

boolean

false

Generate stubbed JWS implementation file. The default is false.

httpproxy

java.lang.String

false

Set HTTP/HTTPS proxy. Format is [user[:password]@]proxyHost[:proxyPort].

implDestDir

java.io.File

false

Specify where to generate JWS implementation file.

implPortName

java.lang.String

false

Local portion of port name for generated JWS implementation. Implies genJWS=true. Note: It is a QName string, formatted as: "{" + Namespace URI + "}" + local part.

implServiceName

java.lang.String

false

Local portion of service name for generated JWS implementation. Implies genJWS=true. Note: It is a QName string, formatted as: "{" + Namespace URI + "}" + local part.

jmstransportclient

JMSTransportClient

false

Invoking a WebLogic Web service using JMS transport.

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

jmsUri

jmsUri

false

Override jmsUri defined in a WSDL file. Requires extension=true.

keep

boolean

false

Specifies whether to keep generated files. The default is true.

packageName

java.lang.String

false

The package in which the source files will be generated.

quiet

boolean

false

Suppress wsimport output. The default is false.

sourceDestDir

java.io.File

false

Specify where to place generated source files. This parameter also sets keep to true. The default is ${project.build.directory}/generated-sources/wsimport.

staleFile

java.io.File

false

The folder containing flag files used to determine if the output is stale.

If you do not specify a folder, the default is ${project.build.directory}/jaxws/stale.

target

java.lang.String

false

Generate code as per the given JAXWS specification version. Setting "2.0" will cause JAX-WS to generate artifacts that run with JAX-WS 2.0 runtime.

verbose

boolean

false

Output messages about what the tool is doing.
Default value is: false.

vmArgs

java.lang.String

false

Specify optional JVM options. You can specify multiple elements, and each token must be placed in its own list.

wsdlDirectory

java.io.File

false

Directory containing WSDL files.

wsdlFiles

java.util.List

false

List of files to use for WSDLs. If not specified, all .wsdl files in the wsdlDirectory will be used.

wsdlLocation

java.lang.String

false

@WebService.wsdlLocation and @WebServiceClient.wsdlLocation value.

Can end with asterisk, in which case relative path of the WSDL will be appended to the given wsdlLocation.

Example:

...
 <configuration>
     <wsdlDirectory>src/mywsdls</wsdlDirectory>
     <wsdlFiles>
         <wsdlFile>a.wsdl</wsdlFile>
         <wsdlFile>b/b.wsdl</wsdlFile>
         <wsdlFile>${basedir}/src/mywsdls/c.wsdl</wsdlFile>
     </wsdlFiles>
     <wsdlLocation>http://example.com/mywebservices/*</wsdlLocation>
 </configuration>
 ...

wsdlLocation for a.wsdl will be http://example.com/mywebservices/a.wsdl

wsdlLocation for b/b.wsdl will be http://example.com/mywebservices/b/b.wsdl

wsdlLocation for ${basedir}/src/mywsdls/c.wsdl will be file://absolute/path/to/c.wsdl

Note: External binding files cannot be used if asterisk notation is in place.

wsdlUrls

java.util.List

false

List of external WSDL URLs to be compiled.

xadditionalHeaders

boolean

false

Maps headers not bound to the request or response messages to Java method parameters.

xauthFile

java.io.File

false

Specify the location of authorization file.

xdebug

boolean

false

Turn on debug message. The default is false.

xdisableAuthenticator

boolean

false

Disable Authenticator used by JAX-WS RI, xauthfile will be ignored if set.

xdisableSSLHostnameVerification

boolean

false

Disable the SSL Hostname verification while fetching WSDL(s).

xjcArgs

java.util.List

false

Specify optional XJC-specific parameters that should simply be passed to xjc using -B option of WsImport command.

Multiple elements can be specified, and each token must be placed in its own list.

xnoAddressingDataBinding

boolean

false

Binding W3C EndpointReferenceType to Java. By default WsImport follows spec and does not bind EndpointReferenceType to Java and uses the spec provided W3CEndpointReference.

xnocompile

boolean

false

Turns off compilation after code generation, and lets the generated sources be compiled by Maven during the compilation phase. The default is true.

This parameter also sets keep to true.

xuseBaseResourceAndURLToLoadWSDL

boolean

false

No description provided by JAX-WS Maven wsimport.


Usage Example

The wsimport goal parses a WSDL and binding files and generates Java code needed to access the Web service.

You can use the wsimport goal in two ways:

  • To generate the client-side artifacts. Then, implement the client to invoke the Web service.

  • To create your own implementation of the Web service. Use wsimport goal with the genJWS parameter to generate portable artifacts and a stubbed implementation file. You then implement the service endpoint.

Specify the Maven generate-sources life cycle phase. Then, run mvn generate-sources in the same directory of the POM file.

Assume that you want to import the WSDL shown in Example 3-25.

Example 3-25 WSDL to Import

<?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at
 http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.9-b14041
 svn-revision#14041. --><!-- Generated by JAX-WS RI at
 http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.9-b14041
 svn-revision#14041. --><definitions
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-uti
lity-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_
2="http://schemas.xmlsoap.org/ws/2004/09/policy"
 xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 xmlns:tns="http://ws.web.wls.my.org/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns="http://schemas.xmlsoap.org/wsdl/"
 targetNamespace="http://ws.web.wls.my.org/" name="SampleWs">
    <types>
        <xsd:schema>
            <xsd:import namespace="http://ws.web.wls.my.org/" schemaLocation="x.xsd"/>
        </xsd:schema>
    </types>
    <message name="hello">
        <part name="parameters" element="tns:hello"/>
    </message>
    <message name="helloResponse">
        <part name="parameters" element="tns:helloResponse"/>
    </message>
    <portType name="SampleWs">
        <operation name="hello">
            <input wsam:Action="http://ws.web.wls.my.org/SampleWs/helloRequest" message="tns:hello"/>
            <output wsam:Action="http://ws.web.wls.my.org/SampleWs/helloResponse" message="tns:helloResponse"/>
        </operation>
    </portType>
    <binding xmlns:soapjms="http://www.w3.org/2010/soapjms/" name="SampleWsPortBinding" type="tns:SampleWs">
        <soapjms:jndiInitialContextFactory>weblogic.jndi.WLInitialContextFactory</soapjms:jndiInitialContextFactory>
        <soapjms:jndiConnectionFactoryName>com.oracle.webservices.api.jms.ConnectionFactory</soapjms:jndiConnectionFactoryName>
        <soapjms:jndiUrl>t3://localhost:7001</soapjms:jndiUrl>
        <soapjms:bindingVersion>SOAP_JMS_1_0</soapjms:bindingVersion>
        <soapjms:destinationName>com.oracle.webservices.api.jms.RequestQueue</soapjms:destinationName>
        <soapjms:targetService>SampleWs</soapjms:targetService>
        <soapjms:timeToLive>180000</soapjms:timeToLive>
        <soapjms:deliveryMode>PERSISTENT</soapjms:deliveryMode>
        <soapjms:priority>0</soapjms:priority>
        <soapjms:messageType>BYTES</soapjms:messageType>
        <soapjms:destinationType>QUEUE</soapjms:destinationType>
        <soap:binding transport="http://www.w3.org/2010/soapjms/" style="document"/>
        <operation name="hello">
            <soap:operation soapAction=""/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="SampleWs">
        <port name="SampleWsPort" binding="tns:SampleWsPortBinding">
            <soap:address location="jms:jndi:com.oracle.webservices.api.jms.RequestQueue?targetService=Sampl
eWs&amp;jndiURL=t3://localhost:7001&amp;messageType=BYTES&amp;deliveryMode=PERSISTENT"/>
        </port>
    </service>
</definitions>

To import this WSDL, modify the pom.xml file to specify the generate-sources life cycle phase, the wsimport goal, the WSDL location, and include any parameters you need to set. This example uses a local WSDL file for demonstration purposes.

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.2.1-0-0</version>
        <executions>
          <execution>
          <id>wsimport-jmssample</id>
           <goals>
           <goal>wsimport</goal>
           </goals>
            <phase>generate-sources</phase>
            <configuration>
               <wsdlFiles>
                 <wsdlFile>${basedir}/import-example/SampleWs.wsdl</wsdlFile>
               </wsdlFiles>
               <genJWS>true</genJWS>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Example 3-26 shows typical wsimport goal output.

Example 3-26 wsimport

mvn -Dfile=pom.xml generate-sources
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven_plugin_simple 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- weblogic-maven-plugin:12.2.1-0-0:wsimport (wsimport-jmssample) @ mave
n_plugin_simple ---
[INFO] Processing: file:/C:/Oracle/Middleware..../import-example/SampleWs.wsdl
[WARNING] Using platform encoding (Cp1252), build is platform dependent!
[INFO] jaxws:wsimport args: [-keep, -s,
'C:\Oracle\Middleware\...\import-example\target\generated-sources\wsimport', -d,
 'C:\Oracle\Middleware...\import-example\target\classes', -extension,
 -Xnocompile, -jms, -jmsuri, jms:jndi:null?targetServi
ce=null, -httpproxy:some-proxy-name, -generateJWS, -implDestDir, 
'C:\Oracle\Middleware...\import-example',
"file:/C:/Oracle/Middleware...import-example/SampleWs.wsdl"]
parsing WSDL...
 
 
 
Generating code...
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 20.888s
[INFO] Finished at: Wed Aug 19 11:33:51 EDT 2015
[INFO] Final Memory: 7M/23M
[INFO] ------------------------------------------------------------------------

In this example, the wsimport goal creates the following files:

org
  my
   wls
    web
     ws
      SampleWs_SampleWsPortImpl.java
target
  classes
  generated-sources
   wsimport
    org
     my
      wls
       web
        ws
         Hello.java
         HelloResponse.java
         ObjectFactory.java
         package-info.java
         SampleWs.java
         SampleWs_Service.java
  jaxws
   stale
    .2b48c6ef28bc8a45aa2da4246c0c4ac90cf82c57

ws-wsdlc

Deprecated

This goal is deprecated in this release.

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-28 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-28 ws-wsdlc Parameters

Name Type Required Description

bindings

java.lang.String

false

Customization files that specify JAX-WS and JAXB custom binding declarations or SOAP handler files.

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.2.1-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-27 shows typical ws-wsdlc goal output.

Example 3-27 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.2.1-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

Deprecated

This goal is deprecated in this release.

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-28. See Introduction to the POM for information on Maven projects with multiple modules.

Example 3-28 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.2.1-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-29 shows an example without a module element in which the jws parameter is a child of ws-jwsc.

Example 3-29 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.2.1-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-29 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-29 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-30 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-31 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-30 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-30 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-34 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-33 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-33 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-31 describes the parameters of the module parameter.

Table 3-31 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-32 describes the parameters of the FileSet parameter.

Table 3-32 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-32 describes the parameters of the transportType parameter.

Table 3-33 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-34 describes the parameters of the jmstransportservice parameter.

Table 3-34 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.2.1-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-30 shows typical ws-jwsc goal output.

Example 3-30 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.2.1-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