3 Using the WebLogic Maven Plug-In
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 Building Java EE Projects for WebLogic Server with Maven in Developing Applications Using Continuous Integration.
- Installing Maven
To use theweblogic-maven-plugin
plug-in, you must first have a functional Maven installation and a Maven repository. - Configuring the WebLogic Maven Plug-In
Use the pre-built JAR file and accompanying POM file to install and configureweblogic-maven-plugin
. - Maven Plug-In Goals
See an alphabetical listing of all the Maven plug-in goals.
Installing Maven
To use the weblogic-maven-plugin
plug-in, you must first have a functional Maven installation and a Maven repository.
A distribution of Maven is included with WebLogic Server in the following location: ORACLE_HOME
\oracle_common\modules\org.apache.maven_relnum
. This is a copy of the standard Maven release, without any modifications. For information about the specific version of Maven that is included in WebLogic Server, see Third-Party Products in Oracle Fusion Middleware in Oracle® Fusion Middleware Licensing Information User Manual.
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
.
Parent topic: Using the WebLogic Maven Plug-In
Configuring the WebLogic Maven Plug-In
Use the pre-built JAR file and accompanying POM file to install and configure weblogic-maven-plugin
.
Complete the following steps to install and configure weblogic-maven-plugin
:
-
Install the Oracle Maven sync plug-in and run the push goal:
-
Change the directory to:
ORACLE_HOME
\oracle_common\plugins\maven\com\oracle\maven\oracle-maven-sync\12.2.1
-
mvn install:install-file -DpomFile=oracle-maven-sync-12.2.1.pom -Dfile=oracle-maven-sync-12.2.1.jar
-
mvn com.oracle.maven:oracle-maven-sync:push -DoracleHome=c:\oracle\middleware\oracle_home\
-
-
To validate successful installation of the plug-in, use the Maven
help:describe
goal. For more information, see the Apache help plug-in describe goal documentation.mvn help:describe -DgroupId=com.oracle.weblogic -DartifactId=weblogic-maven-plugin -Dversion=12.2.1-4-0
Parent topic: Using the WebLogic Maven Plug-In
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:
- Add a build section to your POM if you do not already have one.
- Add a plug-in section to the build section for the WebLogic Maven plug-in.
- 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.
The following 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 |
|
compile |
|
test |
NA |
package |
|
pre-integration-testFoot 1 |
|
post-integration-testFoot 2 |
|
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.
Parent topic: Configuring the WebLogic Maven Plug-In
Basic Configuration POM File
Example 3-2 illustrates a basic Java EE 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>
Parent topic: Configuring the WebLogic Maven Plug-In
Maven Plug-In Goals
See an alphabetical listing of all the 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 |
---|---|
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. Does not require a local server installation. |
|
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 |
|
Deploys WebLogic Server applications and modules to a running server. Supports all deployment formats; for example, WAR, JAR, RAR, and such. |
|
Prepares deployment files for deployment by copying deployment files to target servers and validating them. |
|
Installs WebLogic Server. |
|
Lists the deployment names for applications and standalone modules deployed, distributed, or installed in the domain. |
|
Flushes out retired deployment tasks. |
|
Redeploys a running application or part of a running application. |
|
Removes a domain directory. |
|
Starts an application deployed on WebLogic 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. |
|
Stops an application. |
|
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. |
|
Undeploys the application from WebLogic Server. Stops the deployment unit and removes staged files from target servers. |
|
Uninstalls WebLogic Server. |
|
Updates an application's deployment plan by redistributing the plan files and reconfiguring the application based on the new plan contents. |
|
WLST wrapper for Maven. |
|
WLST wrapper that does not require a local server install for WLST online commands. |
|
Generates client Web service artifacts from a WSDL. |
|
JAX-WS service endpoint implementation class and generates all of the portable artifacts for a JAX-WS Web service. |
|
Maven goal that parses a WSDL and binding files and generates the Java code needed to access it |
|
Builds a JAX-WS Web service. |
|
Generates a set of artifacts and a partial Java implementation of the Web service from a WSDL. |
- appc
- create-domain
- deploy
- distribute-app
- install
- list-apps
- purge-tasks
- redeploy
- remove-domain
- start-app
- start-server
- stop-app
- stop-server
- undeploy
- uninstall
- update-app
- wlst
- wlst-client
- ws-clientgen
- wsgen
- wsimport
- ws-wsdlc
- ws-jwsc
Parent topic: Using the WebLogic Maven Plug-In
appc
Full Name
com.oracle.weblogic:weblogic-maven-plugin:appc
Description
Generates and compiles the classes needed to deploy EJBs and JSPs to WebLogic Server. Also validates the deployment descriptors for compliance with the current specifications at both the individual module level and the application level. Does not require a local server installation.
Parameters
Table 3-4 appc Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
Specifies an alternate descriptor. May be used to specify an alternate |
|
|
false |
Specifies the path to an alternative WebLogic Server application deployment descriptor. |
|
|
false |
When true, does not include deployment descriptors in client JARs generated for EJBs. Default value is: |
|
|
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. |
|
|
false |
Specifies a directory where generated client JARs will be written. |
|
|
false |
This parameter is deprecated in this release. |
|
|
false |
Specifies the Java compiler for compiling class files from the generated Java source code. The Java compiler program should be in your |
|
|
false |
The class that invokes the compiler. Default value is: |
|
|
false |
When true, continues compilation even when there are errors in the JSP files. Default value is: |
|
|
false |
When true, compiles debugging information into class files. Default value is: |
|
|
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 |
Specifies the directory where compiled class files are written. Use this parameter to place compiled classes in a directory that is already in your |
|
|
false |
This parameter is deprecated in this release. |
|
|
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 |
When true, generates IDL for EJB remote interfaces. Default value is: |
|
|
false |
Specifies the directory where IDL files will be written. Default: the target directory or JAR |
|
|
false |
When true, generates factory methods for valuetypes. Default value is: |
|
|
false |
Specifies the method signatures used to trigger IDL code generation. |
|
|
false |
When true, does not generate abstract interfaces and methods or attributes that contain them. Default value is: |
|
|
false |
Does not generate valuetypes or the methods and attributes that contain them. Default value is: |
|
|
false |
When true, generates IDL somewhat compatible with Orbix C++. Default value is: |
|
|
false |
When true, overwrites existing IDL files. Default value is: |
|
|
false |
When true, displays additional status information for IDL generation. Default value is: |
|
|
false |
When true, generates IDL somewhat compatible witih Visibroker C++. Default value is: |
|
|
false |
When true, ignores the plan file if it does not exist. |
|
|
false |
When true, generates CORBA stubs for EJBs. Default value is: |
|
|
false |
Specifies the directory where IIOP stub files will be written. Default: the target directory or JAR |
|
|
false |
When true, preserves the generated |
|
|
false |
A comma-separated list of libraries. |
|
|
false |
Registers all the files in the specified directory as libraries. |
|
|
false |
When true, adds JSP line numbers to generated class files to aid in debugging. Default value is: |
|
|
false |
This parameter is deprecated in this release. Use the standard Maven mechanism to specify the Manifest during packaging. |
|
|
false |
Specifies the maximum number of generated Java files to be compiled at one time. |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
When true, does not exit from the execution of the |
|
|
false |
This parameter is deprecated in this release. |
|
|
false |
When true, suppresses compiler warnings. Default value is: |
|
|
false |
This parameter is deprecated in this release. |
|
|
false |
When true, compiles with optimization on. Default value is: |
|
|
false |
Specifies an alternate output archive or directory. When not set, the output is placed in the source archive or directory. |
|
|
false |
Specifies the path to an optional deployment plan. |
|
|
false |
When true, turns off output except for errors. |
|
|
false |
Passes a list of options to the compiler. |
|
|
false |
This parameter is deprecated in this release and ignored. Use the standard Maven dependency model instead to manipulate the effective CLASSPATH. |
|
|
false |
Specifies the path to the source files. Default value is: |
|
|
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. |
|
|
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. |
|
|
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. |
|
|
false |
When true, displays additional status information during the compilation process. Default value is: |
|
|
false |
When true, enables verbose output from the Java compiler. Default value is: |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
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]
Parent topic: Maven Plug-In Goals
create-domain
Full Name
com.oracle.weblogic:weblogic-maven-plugin:create-domain
Description
Creates a domain for WebLogic Server using a domain template. This goal supports specifying the domain directory (the last directory determines the domain name) and the administrative username and password. For more complex domain creation, use the wlst
goal.
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 theORACLE_HOME
.
Parameters
Table 3-5 create-domain Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
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, |
|
|
false |
Specifies the domain template file to use to create the domain. The default domain template included with WebLogic Server is used when this parameter is not specified. |
|
|
false |
When 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: |
|
|
true |
The path to the Oracle Middleware install directory. |
|
|
true |
Specifies the administrative password. |
|
|
false |
This parameter is deprecated and ignored in this release. |
|
|
true |
Specifies the administrative user name. |
|
|
false |
This parameter is deprecated and ignored in this release. |
|
|
false |
Deprecated. As of version 12.2.1, there is a single, unified version of WLST. This parameter is deprecated and ignored. |
|
|
false |
The current working directory where the create-domain goal executes. The default value is: |
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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. Default value is: |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
Specifies an alternate descriptor. May be used to specify an alternate |
|
|
false |
Version of the application to start. |
|
|
false |
When true, displays debug-level messages to the standard output. Default value is: |
|
|
false |
When true, enables validation of security data. Default value is: |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, indicates that the user wants to copy the application in the server staging area externally or using a third-party tool. When specified, WebLogic Server looks for the application under |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. Default value is: |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
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. |
|
|
false |
Deploy as a shared Java EE library or optional package. |
|
|
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. |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, does not copy the deployment files to target servers, but leaves them in a fixed location, specified by the source parameter. By default, nostage is true for the Administration Server and stage is true for the Managed Server targets. |
|
|
false |
When true, ignores all version related code paths on the Administration Server. Default value is: |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the -list action. Default value is: |
|
|
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 |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the path to the deployment plan. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the source parameter specifies a path on the server, unless the upload parameter is also used. Default value is: |
|
|
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 For other supported deployment actions, you do not specify the |
|
|
false |
Specifies the name of the resource group template to which you want to deploy an application or library. |
|
|
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: |
|
|
false |
Specifies the security model to be used for this deployment, overriding the default security model for the security realm. Possible values are: |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the address of the artifact to deploy. The address can be one of the following:
|
|
|
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. |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. Possible values have the form: |
|
|
false |
Specifies a comma-separated list of targets for the current operation. The default is |
|
|
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: |
|
|
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 |
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 |
Specifies the administrative user name. |
|
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. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information. Default value is: |
|
|
false |
When true, prints the version information. Default value is: |
|
|
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
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. Default value is: |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
When true, displays debug-level messages to the standard output. Default value is: |
|
|
false |
When true, enables validation of security data. Default value is: |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, indicates that the user wants to copy the application in the server staging area externally or using a third-party tool. When specified, WebLogic Server looks for the application under |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. Default value is: |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, does not copy the deployment files to target servers, but leaves them in a fixed location, specified by the source parameter. By default, nostage is true for the Administration Server and stage is true for the Managed Server targets. |
|
|
false |
When true, ignores all version related code paths on the Administration Server. Default value is: |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the -list action. Default value is: |
|
|
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 |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the path to the deployment plan. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the source parameter specifies a path on the server, unless the upload parameter is also used. Default value is: |
|
|
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 For other supported deployment actions, you do not specify the |
|
|
false |
Specifies the name of the resource group template on which you want to distribute an application or library. |
|
|
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: |
|
|
false |
Specifies the security model to be used for this deployment, overriding the default security model for the security realm. Possible values are: |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the address of the artifact to distribute. The address can be one of the following:
|
|
|
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. |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. Possible values have the form: |
|
|
false |
Specifies a comma-separated list of targets for the current operation. When not specified, all configured targets are used. For a new application, the default target is the Administration Server. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of -1 means wait forever. Default value is: |
|
|
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 |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information. Default value is: |
|
|
false |
When true, prints the version information. Default value is: |
|
|
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=password -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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
install
Full Name
com.oracle.weblogic:weblogic-maven-plugin:install
Description
Installs WebLogic Server from a JAR file.
Parameters
Table 3-8 install Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
true |
Specifies the address of the installation. The address can be one of the following:
|
|
|
false |
Installs the product with a binary or jar installer (including the quickstart installers.) The following macros are supported:
JAR installer example:
Quick Start JAR installer example:
This parameter is optional. If specified for a quickstart installer when the If the |
|
|
true |
Deprecated. Use the |
|
|
false |
The silent installer inventory location file. This is required on Unix-based platforms when using the binary or JAR installers. |
|
|
false |
The ORACLE_HOME directory to install into when using the quickstart installer. |
|
|
false |
Indicates that this is a quickstart installer. The quickstart installer requires you to specify the |
|
|
false |
Deprecated. Use the |
|
|
false |
The silent installer response file. This is required when using the binary or jar installers. |
|
|
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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. Default value is: |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
When true, displays debug-level messages to the standard output. Default value is: |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. Default value is: |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
When true, ignore all version-related code paths on the Administration Server. Default value is: |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
|
|
false |
Specifies the administrative password. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
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: |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information. Default value is: |
|
|
false |
When true, prints the version information. Default value is: |
|
|
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>
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. Default value is: |
|
|
false |
When true, compiles debugging information into class files. Default value is: |
|
|
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: |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information during the deployment process. Default value is: |
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 -purgetasks -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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. Default value is: |
|
|
false |
Version of the application to start. |
|
|
false |
Removes the files specified in this parameter while leaving the application activated. This parameter is valid only for unarchived deployments. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. Default value is: |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
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. |
|
boolean |
false |
Deploy as a shared Java EE library or optional package. |
|
|
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. |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
Specifies the name of the partition associated with the resource group on which you want to redeploy an application or library. The |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the path to the deployment plan. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Removes an overridden deployment plan during a 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 |
|
|
false |
Specifies the name of the resource group template on which you want to redeploy an application or library. |
|
|
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: |
|
|
false |
Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the address of the artifact to redeploy. The address can be one of the following:
|
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. Possible values have the form: |
|
|
false |
Specifies a comma-separated list of targets for the current operation. The default target is |
|
|
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: |
|
|
false |
When true, copies the specified source files to the Administration Server's |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information during the deployment process. Default value is: |
|
|
false |
When true, prints the version information. Default value is: |
|
|
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
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
true |
The path to the domain directory. |
|
|
false |
Specifies the current working directory. Default value is: |
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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
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 |
Specifies the listen address and listen port of the Administration Server. Default value is: |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed. |
|
|
false |
When true, displays debug-level messages to the standard output. Default value is: |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. Default value is: |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, ignores all version-related code paths on the Administration Server. Default value is: |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
|
|
false |
Specifies the name of the partition associated with the resource group on which you want to start an application or library. The |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Specifies the number of seconds before WebLogic Server undeploys the currently running version of this application or module so that clients can start using a new version. When not specified, a graceful retirement policy is assumed. Default value is: |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. Possible values have the form: |
|
|
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. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information during the deployment process. Default value is: |
|
|
false |
When true, prints the version information. Default value is: |
|
|
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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies the script to start WebLogic Server. If this parameter is not specified, it will default to either |
|
|
false |
Specifies the path to the WebLogic Server domain. Default value is: |
|
|
false |
Specifies the URL that, when pinged, will verify that the server is running. |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies in seconds, the timeout for the script. Valid when the |
|
|
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
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
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 |
Specifies the listen address and listen port of the Administration Server. Default value is: |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed. |
|
|
false |
When true, displays debug-level messages to the standard output. Default value is: |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. Default value is: |
|
|
false |
When true, stops the application after existing |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
When true, ignores pending |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, ignores all version-related code paths on the Administration Server. Default value is: |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
|
|
false |
Specifies the name of the partition associated with the resource group on which you want to stop an application or library. The |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. Possible values have the form: |
|
|
false |
Specifies a comma-separated list of targets for the current operation. When not specified, all configured targets are used. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information. Default value is: |
|
|
false |
When true, prints the version information. Default value is: |
|
|
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>
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. Default value is: |
|
|
false |
Specifies the script to stop WebLogic Server. This will default to |
|
|
false |
Specifies the path to the WebLogic Server domain. Default value is: |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the log file to which the script output will be redirected. When not specified, it defaults to |
|
|
true |
Specifies the administrative password. |
|
|
false |
Specifies, in seconds, the timeout for the script. This is valid when the |
|
|
true |
Specifies the administrative user name. |
|
|
false |
When true, the plug-in should wait for the script to complete. Default value is: |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
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: |
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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. Default value is: |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed. |
|
|
false |
When true, displays debug-level messages to the standard output. Default value is: |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. Default value is: |
|
|
false |
When true, stops the application after existing |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
When true, ignores pending |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, ignores all version-related code paths on the Administration Server. Default value is: |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
|
|
false |
Specifies the name of the partition associated with the resource group on which you want to update an application or library. The |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Specifies the name of the resource group template from which you want to undeploy an application or library. |
|
|
false |
Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. Possible values have the form: |
|
|
false |
Specifies a comma-separated list of targets for the current operation. When not specified, all configured targets are used. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information during the deployment process. Default value is: |
|
|
false |
When true, prints the version information. Default value is: |
|
|
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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
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 |
|
true |
This parameter is deprecated and ignored. |
|
|
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. |
|
|
true |
Deprecated. Use the responseFile parameter. |
|
|
true |
The silent installer response file. This is required when using the binary or JAR installers. |
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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies the listen address and listen port of the Administration Server. Default value is: |
|
|
false |
When true, prints advanced usage options. |
|
|
false |
Specifies the version identifier of the application. When not specified, the currently active version of the application is assumed. |
|
|
false |
When true, displays debug-level messages to the standard output. Default value is: |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
When true, displays examples of how to use this plug-in. |
|
|
false |
When true, forces the Mojo to fail the build upon encountering an error if it would otherwise just log the error. Default value is: |
|
|
false |
Specifies an optional, user-supplied, unique deployment task identifier. |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies the deployment name to assign to a newly-deployed application or standalone module. |
|
|
false |
When true, ignores all version-related code paths on the Administration Server. Default value is: |
|
|
false |
When true, initiates multiple tasks and then monitors them later with the |
|
|
false |
Specifies the name of the partition associated with the resource group on which you want to update an application or library. The |
|
|
false |
Specifies the administrative password. |
|
|
false |
Specifies the location of the deployment plan. |
|
|
false |
Specifies the version of the deployment plan. When not specified, the currently active version of the application's deployment plan is assumed. |
|
|
false |
When true, specifies that the plug-in is not running on the same machine as the Administration Server. In this case, the |
|
|
false |
Removes an overridden deployment plan during a 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 |
|
|
false |
Specifies the number of seconds in the grace period for RMI requests during graceful shutdown. Can be used only when the |
|
|
false |
This parameter is deprecated in this release and ignored. |
|
|
false |
Specifies JMS Server targets for resources defined within a JMS application module. Possible values have the form: |
|
|
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. |
|
|
false |
Specifies the maximum number of seconds WebLogic Server will wait for the deployment task to complete. The default value of |
|
|
false |
When true, copies the source files to the Administration Server's upload directory prior to deployment. Use this setting when running the plug-in remotely (using the |
|
|
false |
Specifies the administrative user name. |
|
|
false |
Specifies the location of a user configuration file to use for the administrative user name and password instead of specifying the user name and password directly in plain text. |
|
|
false |
Specifies the location of a user key file to use for encrypting and decrypting the user name and password stored in the user configuration file. |
|
|
false |
When true, displays additional status information. Default value is: |
|
|
false |
When true, prints the version information. Default value is: |
|
|
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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
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.
Parameters
Table 3-20 wlst Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
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.\"" |
|
|
false |
When true, displays additional status information. Default value is: |
|
|
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 Default value is: |
|
|
false |
When true, the Maven build fails if the Default value is: |
|
|
false |
Specifies the file path of the WLST Python script to execute. Either a |
|
|
true |
The path to the Oracle Middleware install directory. |
|
|
false |
Specifies the path to a Java properties file. The property names become defined variables in the WLST Python interpreter and are initialized to the values supplied. For example, if the properties file contains the line |
|
|
false |
Specifies an inline WLST Python script, for example, " 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. |
|
|
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. |
|
|
false |
This parameter is deprecated and ignored in this release. |
|
|
false |
This parameter is deprecated and ignored in this release. |
|
|
false |
This parameter is deprecated and ignored in this release. |
|
|
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>
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Deprecated. Use the scriptArgs parameter to specify the arguments as a list of scriptArg elements. |
|
|
false |
When true, displays additional status information. Default value is: |
|
|
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 Default value is: |
|
|
false |
When true, the Maven build fails if the Default value is: |
|
|
false |
Specifies the file path of the WLST Python script to execute. Either a |
|
|
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 |
|
|
false |
Specifies the path to a Java properties file. The property names become defined variables in the WLST Python interpreter and are initialized to the values supplied. For example, if the properties file contains the line |
|
|
false |
Specifies an inline WLST Python script, for example, " 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. |
|
|
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
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] ------------------------------------------------------------------------
Parent topic: Maven Plug-In Goals
ws-clientgen
Full Name
com.oracle.weblogic:weblogic-maven-plugin:ws-clientgen
Description
Maven goal to generate JAX-WS client Web service artifacts from a WSDL.
The ws-clientgen
goal provides a Maven wrapper for the clientgen Ant task, which is described in WebLogic Web Services Reference for Oracle WebLogic Server.
Note:
The ws-clientgen
goal does not work with the JAX-RPC-only JWS annotations described in WebLogic-Specific Annotations.
Parameters
Table 3-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 |
---|---|---|---|
|
|
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 See Table 3-23 for a description of |
|
|
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 |
|
|
false |
Controls where the WSDL should be copied in the ws-clientgen goal 's destination dir. |
|
|
false |
Turns on additional debug output. |
|
|
false |
Uses Ant debug levels. |
|
|
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 |
|
|
false |
Specifies whether the ws-clientgen goal continues executing in the event of an error. The default value is True. |
|
|
false |
Specifies whether to execute javac using the JDK compiler externally. The default value is false. |
|
|
false |
Specifies whether the ws-clientgen goal should generate the XML catalog artifacts in the client runtime environment. This value defaults to true. |
|
|
false |
Specifies whether to include the Ant run-time libraries in the classpath. |
|
|
false |
Specifies whether to include the default run-time libraries from the executing VM in the classpath. |
|
|
false |
Invoking a WebLogic Web service using JMS transport. Table 3-25 describes the parameters of the |
|
|
false |
Specifies the package name into which the generated client interfaces and stub files are packaged. |
|
|
false |
There is only one FileSet. There is more than one FileSet. |
|
|
false |
Turns on verbose output |
|
|
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. |
|
|
false |
Controls the value of the wsdlLocation attribute generated on the |
|
|
false |
Specifies the authorization file. |
|
|
false |
Not used. |
Table 3-23 describes the parameters of the bindings
parameter.
Table 3-23 Binding Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
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 |
---|---|---|---|
|
|
false |
Specifies the directories (separated by semi-colons) that the |
Table 3-25 describes the parameters of the jmstransportclient
parameter.
Table 3-25 jmstransportclient Parameters
Name | Type | Required | Description |
---|---|---|---|
|
|
false |
JNDI name of the destination queue or topic. Default value is |
|
|
false |
Valid values include: QUEUE or TOPIC. Default value is QUEUE. |
|
|
false |
JNDI name of the JMS destination to which the response message is sent. |
|
|
false |
Port component name of the Web service. |
|
|
false |
Name of the initial context factory class used for JNDI lookup. Default value is |
|
|
JNDI name of the connection factory that is used to establish a JMS connection. Default value is |
|
|
|
JNDI provider URL. Default value is |
|
|
|
Delivery mode indicating whether the request message is persistent. Valid values are PERSISTENT and NON_PERSISTENT. Default value is PERSISTENT. |
|
|
long |
false |
Lifetime, in milliseconds, of the request message. Default value is 180000L. |
|
int |
false |
JMS priority associated with the request and response message. Default value is 0. |
|
|
false |
JNDI properties, in a format like: someParameterName1=someValue1 , someParameterName2=someValue2. |
|
|
false |
Version of the SOAP JMS binding. Default value is 1.0. |
|
|
false |
Principal used to run the listening MDB. |
|
|
false |
Role used to run the listening MDB. |
|
|
false |
Message type to use with the request message. Valid values are |
|
|
false |
Boolean flag that specifies whether to publish the WSDL through HTTP. Default value is true. |
|
|
false |
Boolean flag that specifies whether to create one listening message-driven bean (MDB) for each requested destination. Default value is true. |
|
|
false |
Activation configuration properties passed to the JMS provider. |
|
|
false |
The deployed context of the web service. |
|
|
false |
Web service URI portion of the URL. |
|
|
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 runmvn generate-resources
in the same directory of pom.xml.To do this, modify the
pom.xml
file to specify thegenerate-resources
life cycle phase, thews-clientgen
goal, and include any parameters you need to set. Consider the following example:<?xml version="1.0" encoding="UTF-8" standalone="no"?> <project> <modelVersion>4.0.0</modelVersion> <groupId>maven_plugin.simple</groupId> <artifactId>maven_plugin_simple</artifactId> <version>1.0</version> <build> <plugins> <plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>weblogic-maven-plugin</artifactId> <version>12.1.3-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.1.3-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
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies optional command-line options. Multiple elements can be specified, and each token must be placed in its own list. |
|
|
false |
Specifies the full pathname of where to place output generated classes. Use |
|
|
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. |
|
|
false |
|
|
|
false |
Name of the executable. Can be |
|
|
false |
Specifies that a WSDL file should be generated in |
|
|
false |
Generates inline schemas in a generated WSDL. The default is The |
|
|
false |
Use JMS transport for Web services. It can be omitted. See Table 3-34 for a description of |
|
|
false |
Specifies whether to keep generated files. The default is |
|
|
false |
Metadata file for the |
|
|
false |
Specify the port name to use in the generated WSDL. The |
|
|
false |
Use in conjunction with Valid values are The default is soap |
|
|
false |
Specifies the directory to contain the generated WSDL files. The default is |
|
|
false |
Specifies the service endpoint implementation class name. |
|
|
false |
Specify the service name ( |
|
|
false |
Specify where to place generated source files. This parameter also sets |
|
boolean |
false |
Output messages about what the tool is doing. Default value is: |
|
|
false |
Specify optional JVM options. You can specify multiple elements, and each token must be placed in its own list. |
|
|
false |
No description provided |
|
|
false |
Turns off compilation after code generation, and lets the generated sources be compiled by Maven during the compilation phase. The default is This parameter also sets |
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.1.3\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.1.3\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
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Specifies optional command-line options. Multiple elements can be specified, and each token must be placed in its own list. |
|
|
false |
Directory containing binding files. |
|
|
false |
List of files to use for bindings. If not specified, all |
|
|
false |
Catalog file to resolve external entity references support TR9401, XCatalog, and OASIS XML Catalog format. |
|
|
false |
Specifies the full pathname of where to place output generated classes. Use |
|
|
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. |
|
|
false |
Name of the executable. Can be |
|
|
false |
|
|
|
false |
Generate stubbed JWS implementation file. The default is |
|
|
false |
Set HTTP/HTTPS proxy. Format is [ |
|
|
false |
Specify where to generate JWS implementation file. |
|
|
false |
Local portion of port name for generated JWS implementation. Implies |
|
|
false |
Local portion of service name for generated JWS implementation. Implies |
|
|
false |
Invoking a WebLogic Web service using JMS transport. Table 3-25 describes the parameters of the |
|
|
false |
Override jmsUri defined in a WSDL file. Requires |
|
|
false |
Specifies whether to keep generated files. The default is |
|
|
false |
The package in which the source files will be generated. |
|
|
false |
Suppress wsimport output. The default is |
|
|
false |
Specify where to place generated source files. This parameter also sets |
|
|
false |
The folder containing flag files used to determine if the output is stale. If you do not specify a folder, the default is |
|
|
false |
Generate code as per the given JAXWS specification version. Setting " |
|
|
false |
Output messages about what the tool is doing. Default value is: |
|
|
false |
Specify optional JVM options. You can specify multiple elements, and each token must be placed in its own list. |
|
|
false |
Directory containing WSDL files. |
|
|
false |
List of files to use for WSDLs. If not specified, all .wsdl files in the |
|
|
false |
Can end with asterisk, in which case relative path of the WSDL will be appended to the given 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> ...
Note: External binding files cannot be used if asterisk notation is in place. |
|
|
false |
List of external WSDL URLs to be compiled. |
|
|
false |
Maps headers not bound to the request or response messages to Java method parameters. |
|
|
false |
Specify the location of authorization file. |
|
|
false |
Turn on debug message. The default is |
|
|
false |
Disable Authenticator used by JAX-WS RI, |
|
|
false |
Disable the SSL Hostname verification while fetching WSDL(s). |
|
|
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. |
|
|
false |
Binding W3C |
|
|
false |
Turns off compilation after code generation, and lets the generated sources be compiled by Maven during the compilation phase. The default is This parameter also sets |
|
|
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 thegenJWS
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&jndiURL=t3://localhost:7001&messageType=BYTES&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: 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
Parent topic: Maven Plug-In Goals
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 |
---|---|---|---|
|
|
false |
Customization files that specify JAX-WS and JAXB custom binding declarations or SOAP handler files. |
|
|
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 |
|
|
false |
Specifies the flag to set when debugging the process. Default value is false. |
|
|
false |
Uses Ant debug levels. |
|
|
false |
Specifies the directory into which the stubbed-out JWS implementation file is generated. |
|
|
false |
Specifies the directory into which the Javadoc that describes the JWS interface is generated. |
|
|
true |
Specifies the directory into which the JAR file that contains the JWS interface and data binding artifacts should be generated. |
|
|
false |
Specifies the flag to set if you want exploded output. Defaults to true. |
|
|
false |
Specifies whether the ws-clientgen goal continues executing in the event of an error. The default value is true |
|
|
false |
Specifies whether to execute javac using the JDK compiler externally. The default value is false. |
|
|
false |
Specifies whether to include the Ant run-time libraries in the classpath. The default value is true. |
|
|
false |
Specifies whether to include the default run-time libraries from the executing VM in the classpath. The default value is false. |
|
|
false |
Specifies the flag to set if you want optimization. Defaults to true. |
|
|
false |
Specifies the package into which the generated JWS interface and implementation files should be generated. |
|
|
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 The |
|
|
false |
Specifies the name of the Web service from which the JWS interface file should be generated. |
|
|
true |
Specifies the name of the WSDL from which to generate the JAR file that contains the JWS interface and data binding artifacts. |
|
|
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 thegenerate-resources
life cycle phase, thews-wsdlc
goal, and include any parameters you need to set. Then runmvn 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
Parent topic: Maven Plug-In Goals
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
, ormodules
. -
Collection elements such as
jwses
andmodules
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, usejws
. If there are multiplejws
elements, add all of thejws
elements under ajwses
element. -
As with the JWSC ant task, if
module
has only onejws
child element, then other sub elements ofmodule
can be nested intojwsc
andjwsc/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 |
---|---|---|---|
|
|
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. |
|
|
false |
Turns on additional debug output. |
|
|
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. |
|
|
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. |
|
|
false |
There is only one <jws> element. See Table 3-30 for a description of |
|
|
false |
It contains more than one< jws> element. |
|
|
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 |
|
|
false |
Specifies whether to list all of the files. |
|
|
false |
It contains one <module> element. See Table 3-31 for a description of |
|
|
false |
It contains more than one <module> element. |
|
|
false |
Specifies the flag to set when optimization is required. Defaults to true. |
|
|
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. |
|
|
true |
Specifies the full pathname of the top-level directory that contains the JWS file you want to compile. |
|
|
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. |
|
|
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 thews-jwsc
goal. -
A child element of the
module
parameter, which in turn is a child of thews-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 |
---|---|---|---|---|
|
|
false |
Specifies the full pathname of the JAR file generated by the Only required for the "starting from WSDL" use case. |
both |
|
|
false |
Specifies the deployed context of the web service. |
ws-jwsc |
|
|
false |
Specifies the flag to set when you want exploded output. Defaults to true. |
ws-jwsc |
|
|
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 |
|
|
true |
Specifies whether the generated WAR file includes the WSDL file in the WEB-INF directory. Default value is false. |
both |
|
|
false |
Use JMS transport for Web services. It can be omitted. See Table 3-34 for a description of |
ws-jwsc |
|
|
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 |
|
|
false |
Used when it contains only one transport See Table 3-33 for a description of |
both |
|
|
false |
Used when it contains more than one transport See Table 3-33 for a description of |
both |
|
|
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 |
---|---|---|---|
|
|
false |
There is only one <clientgen> element. It can be omitted. |
|
|
false |
There is more than one <clientgen> element. It can be omitted. |
|
|
false |
Specifies the deployed context of the Web service. |
|
|
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 ", ". |
|
|
false |
Specifies whether to package EJB-based Web services in a WAR file instead of a JAR file. |
|
|
false |
Specifies the flag to set when you want exploded output. Defaults to true. |
|
|
false |
Used when it contains one FileSet element. It can be omitted. |
|
|
false |
Used when it contains more than one FileSet element. It can be omitted. |
|
|
true |
Specifies whether the generated WAR file includes the WSDL file in the WEB-INF directory. Default value is false. |
|
|
false |
Used when it contains one jws element. It can be omitted. |
|
|
false |
Used when it contains more than one jws element. It can be omitted. |
|
|
false |
Specifies the name of the WAR to use when evaluating the ear file. |
|
|
false |
Specifies that only a WSDL file should be generated for this JWS file. The default value is false. |
zipfileset |
|
false |
There is only one <zipfileset> element. |
FileSet Parameters
As described in jwsfileset, 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 |
---|---|---|---|
|
|
true |
Specifies the directories (separated by semi-colons) that the ws-jwsc goal should search for JWS files to compile. |
|
|
false |
Prefix to use. |
|
|
false |
Specifies the explicit includes-list for the file set. |
|
|
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 |
---|---|---|---|
|
|
true |
Specifies the value is WLHttpTransport, WLHttpsTransport, or WLJMSTransport. Default value is WLHttpTransport. |
|
|
false |
Specifies the Web service URI portion of the URL. |
|
|
false |
Specifies the deployed context of the Web service. |
|
|
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 |
---|---|---|---|
|
|
false |
JNDI name of the destination queue or topic. Default value is |
|
|
false |
Valid values include: QUEUE or TOPIC. Default value is QUEUE. |
|
|
false |
JNDI name of the JMS destination to which the response message is sent. |
|
|
false |
Port component name of the Web service. |
|
|
false |
Name of the initial context factory class used for JNDI lookup. Default value is |
|
|
JNDI name of the connection factory that is used to establish a JMS connection. Default value is |
|
|
|
JNDI provider URL. Default value is |
|
|
|
Delivery mode indicating whether the request message is persistent. Valid values are PERSISTENT and NON_PERSISTENT. Default value is PERSISTENT. |
|
|
|
false |
Lifetime, in milliseconds, of the request message. Default value is 180000L. |
|
|
false |
JMS priority associated with the request and response message. Default value is 0. |
|
|
false |
JNDI properties, in a format like: someParameterName1=someValue1 , someParameterName2=someValue2. |
|
|
false |
Version of the SOAP JMS binding. Default value is 1.0. |
|
|
false |
Principal used to run the listening MDB. |
|
|
false |
Role used to run the listening MDB. |
|
|
false |
Message type to use with the request message. Valid values are |
|
|
false |
Boolean flag that specifies whether to publish the WSDL through HTTP. Default value is true. |
|
|
false |
Boolean flag that specifies whether to create one listening message-driven bean (MDB) for each requested destination. Default value is true. |
|
|
false |
Activation configuration properties passed to the JMS provider. |
|
|
false |
The deployed context of the web service. |
|
|
false |
Web service URI portion of the URL. |
|
|
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
Parent topic: Maven Plug-In Goals