12 December 2011

WebLogic Server 12c - Identifying versions of modules, libraries, frameworks


Now that WebLogic Server 12c has been released, it's interesting to look at the various libraries, modules and open-source frameworks it uses.

One approach to doing this is to use the wls-cat utility to search for a known class from the framework, module or open-source framework you are interested in looking at, and observing where the class is loaded from and the corresponding library version.

JavaServer Faces

One important item to note here is that as of the WebLogic Server 12c release, the JSF implementation has been added directly to the WebLogic Server classpath.  This is a change from the WebLogic Server 11g release where the JSF implementation was provided as an optional shared-library, which needed to be deployed in order for applications to use JSF.  With WebLogic Server 12c, JSF is now an integral part of the server and can be used without the necessity of deploying and referencing the shared-library.

javax.faces.webapp.FacesServlet:


com.sun.faces.facelets.Facelet:


Using:
  • JSF 2.1
  • Mojarra 2.1.5

Java Persistence API / EclipseLink

javax.persistence.Entity:



org.eclipse.persistence.jpa.JpaEntityManager:


Using:
  • JPA 2.0
  • EclipseLink 2.3

Context and Dependency Injection/Weld

javax.enterprise.inject.Model:



org.jboss.weld.Container:


Using:
  • CDI 1.0
  • Weld 1.1.3-SP1

SLF4J

org.slf4j.Logger:


Using:
  • SLF4J 1.6.1

WebLogic Server 12c - Maven Usage Notes


Note: apologies for the formatting, this posting was a cut and paste from a .docx document and thus has all the styles inlined.   In the interests of time, I thought it was better to just post it as-is and make it available, rather than try and reformat it.  Which I know I'd keep pushing off until eternity. 

This document provides a short overview of installing, configuring and using the new wls-maven-plugin provided in WebLogic Server 12c.

Convention Over Configuration


With the wls-maven-plugin:12.1.1.0 we have followed the theme of Maven and used a convention-over-configuration approach.  This means that for a set of the commonly used configuration elements, we have adopted a sensible, consistent set of default values that can be used across all of the goals.  This reduces the amount of configuration necessary to use the plugin and helps achieve uniform goal executions, even in different environments.

The common configuration elements are:

middlewareHome: ${project.basedir}/Oracle/Software
weblogicHome: “wlserver” or “wlserver_12.1”, depending on the install type
domainHome: ${project.basedir}/Oracle/Domains
source: ${project.build.directory}/${project.build.finalName}.${project.packaging}
adminurl: t3://localhost:7001

While these configuration parameters have default values, they can all be overridden in a pom.xml file or on the command line as need be.

However by having them be sensible defaults, they can be left out of a configuration section and used consistently across all of the goals.

As an example, it’s possible to issue the following commands that all use the same WLS installation and domain without specifying any repetitive values:

$ wls:install -
DartifactLocation=/Users/sbutton/Downloads/wls/wls_1211/wls1211_dev.zip
$ wls:create-domain –Duser=weblogic –Dpassword=welcome1
$ wls:start-server


Installing the Plugin


For WLS 12c, the wls-maven-plugin is provided as a pre-built jar file and the
accompanying pom.xml file is also provided as an easily accessible file in the same directory. 

$MW_HOME/wlserver/server/lib/wls-maven-plugin.jar
$MW_HOME/wlserver/server/lib/pom.xml

The wls-maven-plugin is installed using the following commands:

$ cd $MW_HOME/wlserver/server/lib
$ mvn install
$ mvn install:install-file –Dfile=wls-maven-plugin.jar –DpomFile=pom.xml

The default pom.xml file now has the required setting to enable the use of the “wls” goal prefix enabled by default. 

To use the “wls” goalPrefix, you will need to edit the Maven settings.xml file and add the following entry:

<pluginGroups>
     <pluginGroup>com.oracle.weblogic</pluginGroup>
 </pluginGroups>

Once you have installed the plugin, you can very simply validate it using the wls:help goal.

$ mvn wls:help

This goal does not require a project or pom.xml and will display the list of goals available in the wls-maven-plugin if the plugin has been successfully installed.


Basic Configuration of Plugin


Below is an example of a basic Java EE 6 Web Application pom.xml file that enables the use of the wls-maven-plugin.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>demo.sab</groupId>
    <artifactId>maven-demo</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <name>maven-demo</name>

    <properties>
        <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            ...
            ...

            <!-- WebLogic Server 12c Maven Plugin -->
            <plugin>

                <groupId>com.oracle.weblogic</groupId>

                <artifactId>wls-maven-plugin</artifactId>

                <version>12.1.1.0</version>

            </plugin>
        </plugins>
    </build>

</project>

 

Install


This goal installs WLS into a local directory to enable it to be used execute the other goals, as well as a installation to create a WLS domain that can be used to deploy and test the application represented as the Maven project.

To install, you need a distribution to install.  This is specified using the <artifactLocation> configuration element in the wls-maven-plugin section of the pom.xml, or specify it using the –DartifactLocation property when Maven is invoked.

The target directory for the installation is specified using the optional weblogicHome configuration element.  This is set to ${basedir}/Oracle/Software by default.  Specifying a <middlewareHome> value will direct the install to be performed in the specified location.

I will focus on the zip distribution since it reflects a development usage model.

The location of the zip distribution can be specified as one of the following:

a)    local file reference

For a local file reference, you specify the path on the local file system

<!-- WebLogic Server 12c Maven Plugin -->
<plugin>
    <groupId>com.oracle.weblogic</groupId>
    <artifactId>wls-maven-plugin</artifactId>
    <version>12.1.1.0</version>
    <configuration>
        <artifactLocation>
           /Users/sbutton/Downloads/wls/wls_1211/wls1211_dev.zip
        </artifactLocation>
    </configuration>
 </plugin>

The execution of the wls:install goal is shown below.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:install
[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:install (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  wls-maven-plugin: install                                         ++
[INFO] ++====================================================================++
[INFO] Installing /Users/sbutton/Downloads/wls/wls_1211/wls1211_dev.zip into /Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software
[INFO] Installing the product, this may take some time.
[INFO] Executing: [cmd:[/bin/bash, -c, chmod +x ./configure.sh; ./configure.sh]]
[INFO] Process being executed, waiting for completion.
[INFO] [exec] **************************************************
[INFO] [exec] WebLogic Server 12c (12.1.1.0) Zip Configuration
[INFO] [exec]
[INFO] [exec] MW_HOME:   /Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software
[INFO] [exec] JAVA_HOME: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
[INFO] [exec] **************************************************
...
...
...
[INFO] [exec] BUILD SUCCESSFUL
[INFO] [exec] Total time: 0 seconds
[INFO] [configure script] exit code: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:53.210s
[INFO] Finished at: Wed Nov 23 15:46:53 CST 2011
[INFO] Final Memory: 3M/81M
[INFO] ------------------------------------------------------------------------


b)   URL reference

<!-- WebLogic Server 12c Maven Plugin -->
<plugin>
    <groupId>com.oracle.weblogic</groupId>
    <artifactId>wls-maven-plugin</artifactId>
    <version>12.1.1.0</version>
    <configuration>
        <artifactLocation>
            http://test.us.oracle.com:7001/downloads/wls1211_dev.zip
        </artifactLocation>
    </configuration>
 </plugin>

The execution of the wls:install goal is shown below.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:install
[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:install (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  wls-maven-plugin: install                                         ++
[INFO] ++====================================================================++
[INFO] Installing http://test.us.oracle.com:7001/downloads/wls1211_dev.zip into /Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software
[INFO] Attempt to download artifact from maven repo failed - Artifact not found
[INFO] Attempt to download the weblogic server instance directly from url.
[INFO] Downloading the file ...
...
...
...
[INFO] [exec] BUILD SUCCESSFUL
[INFO] [exec] Total time: 0 seconds
[INFO] [configure script] exit code: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:23.710s
[INFO] Finished at: Wed Nov 23 15:53:21 CST 2011
[INFO] Final Memory: 3M/81M
[INFO] ------------------------------------------------------------------------


c)    Maven Artifact

Here the distribution is retrieved from the local Maven repository itself.  This means it needs to have been installed into the repository or pulled over from a remote repository at some point.

To install wls1211-dev.zip into Maven repository the following type of command can be used:

sbutton:~ $ mvn install:install-file -Dfile=wls1211_dev.zip
-DgroupId=com.oracle.weblogic -DartifactId=wls-dev
-Dpackaging=zip -Dversion=12.1.1.0

[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install-file (default-cli) @ standalone-pom ---
[INFO] Installing /Users/sbutton/Downloads/wls/wls_1211/wls1211_dev.zip to /Users/sbutton/.m2/repository/com/oracle/weblogic/wls-dev/12.1.1.0/wls-dev-12.1.1.0.zip
[INFO] Installing /var/folders/cL/cLTyZKXjGgmQhEpoV+U-DE+++TI/-Tmp-/mvninstall7575420374983698784.pom to /Users/sbutton/.m2/repository/com/oracle/weblogic/wls-dev/12.1.1.0/wls-dev-12.1.1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.089s
[INFO] Finished at: Wed Nov 23 15:30:17 CST 2011
[INFO] Final Memory: 3M/81M
[INFO] ------------------------------------------------------------------------

This installs wls1211-dev.zip as a Maven artifact with the following coordinate:

com.oracle.weblogic:wls-dev:zip:12.1.1.0

To use this Maven artifact as the distribution to install, the plugin looks like the below.

<!-- WebLogic Server 12c Maven Plugin -->
<plugin>
    <groupId>com.oracle.weblogic</groupId>
    <artifactId>wls-maven-plugin</artifactId>
    <version>12.1.1.0</version>
    <configuration>
        <artifactLocation>
            com.oracle.weblogic:wls-dev:zip:12.1.1.0
        </artifactLocation>
    </configuration>
 </plugin>

The execution of the wls:install goal is shown below.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:install
[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:install (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  wls-maven-plugin: install                                         ++
[INFO] ++====================================================================++
[INFO] Installing com.oracle.weblogic:wls-dev:zip:12.1.1.0 into /Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software
[INFO] Installing the product, this may take some time.
[INFO] Executing: [cmd:[/bin/bash, -c, chmod +x ./configure.sh; ./configure.sh]]
[INFO] Process being executed, waiting for completion.
[INFO] [exec] **************************************************
[INFO] [exec] WebLogic Server 12c (12.1.1.0) Zip Configuration
[INFO] [exec]
[INFO] [exec] MW_HOME:   /Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software
[INFO] [exec] JAVA_HOME: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
[INFO] [exec] **************************************************
[INFO] [exec]
...
...
...
[INFO] [exec]
[INFO] [exec] Your environment has been set.
[INFO] [exec]
[INFO] [exec] BUILD SUCCESSFUL
[INFO] [exec] Total time: 0 seconds
[INFO] [configure script] exit code: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:57.549s
[INFO] Finished at: Wed Nov 23 15:35:32 CST 2011
[INFO] Final Memory: 4M/81M
[INFO] ------------------------------------------------------------------------
Unless the <middlewareHome> configuration paramter is specified, the installation is performed in the ${basedir}/Oracle/Software directory.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ ls -l
total 8
drwxr-xr-x  3 sbutton  staff   102 23 Nov 15:44 Oracle
-rw-r--r--  1 sbutton  staff  3597 23 Nov 15:43 pom.xml
drwxr-xr-x  3 sbutton  staff   102 23 Nov 15:03 src

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ ls -l Oracle/Software/
total 64
-rw-r--r--    1 sbutton  staff   5808 23 Nov 15:45 README.txt
-rw-r--r--    1 sbutton  staff   3064 23 Nov 15:45 configure.cmd
-rwxr-xr-x    1 sbutton  staff   2857 23 Nov 15:45 configure.sh
-rw-r--r--    1 sbutton  staff   3189 23 Nov 15:45 configure.xml
-rw-r--r--    1 sbutton  staff    133 23 Nov 15:45 domain-registry.xml
drwxr-xr-x  508 sbutton  staff  17272 23 Nov 15:46 modules
-rw-r--r--    1 sbutton  staff   1138 23 Nov 15:45 registry.template
-rw-r--r--    1 sbutton  staff   1320 23 Nov 15:46 registry.xml
drwxr-xr-x    3 sbutton  staff    102 23 Nov 15:45 utils
drwxr-xr-x    7 sbutton  staff    238 23 Nov 15:46 wlserver

Create-Domain


This goal creates a standard WLS domain from the specific WLS installation. 

The location of the domain is specified using the optional <domainHome> configuration element.  By default <domainHome> is set to ${basedir}/Oracle/Domains so it will be created in an Oracle/Domains subdirectory of the root directory of the Maven project.

The WLS installation to be used is specified using the optional <middlewareHome> configuration element.  This is set to ${basedir}/Oracle/Software by default, so if the default location has been used to execute the install goal, it can be left out of this goal.

To create a domain, a user and password are required.  These can be specified as configuration parameters using the <user> and <password> properties or they can be specified on the command line.

<!-- WebLogic Server 12c Maven Plugin -->
<plugin>
    <groupId>com.oracle.weblogic</groupId>
    <artifactId>wls-maven-plugin</artifactId>
    <version>12.1.1.0</version>
    <configuration>
        <artifactLocation>
            com.oracle.weblogic:wls-dev:zip:12.1.1.0
        </artifactLocation>
        <user>weblogic</user>
        <password>welcome1</user>
    </configuration>
 </plugin>

The execution of the wls:install goal is shown below.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:create-domain
[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:create-domain (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  wls-maven-plugin: create-domain                                   ++
[INFO] ++====================================================================++
[INFO] Domain creation script:
readTemplate('/Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/Oracle/Software/wlserver/common/templates/domains/wls.jar')
cd('/Security/base_domain/User/weblogic')
set('Name', 'weblogic')
set('Password', '***')
writeDomain('/Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/Oracle/Domains/mydomain')
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39.345s
[INFO] Finished at: Wed Nov 23 16:01:13 CST 2011
[INFO] Final Memory: 24M/81M
[INFO] ------------------------------------------------------------------------

Unless the <domainHome> configuration property is specified, the domain will be created in the ${basedir}/Oracle/Domains directory of the project.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ ls -l Oracle/Domains/mydomain
total 16
drwxr-xr-x   3 sbutton  staff  102 23 Nov 16:01 autodeploy
drwxr-xr-x  10 sbutton  staff  340 23 Nov 16:01 bin
drwxr-xr-x  10 sbutton  staff  340 23 Nov 16:01 config
drwxr-xr-x   3 sbutton  staff  102 23 Nov 16:01 console-ext
-rw-r--r--   1 sbutton  staff  462 23 Nov 16:01 fileRealm.properties
drwxr-xr-x   7 sbutton  staff  238 23 Nov 16:01 init-info
drwxr-xr-x   3 sbutton  staff  102 23 Nov 16:01 lib
drwxr-xr-x   6 sbutton  staff  204 23 Nov 16:01 security
drwxr-xr-x   3 sbutton  staff  102 23 Nov 16:01 servers
-rwxr-x---   1 sbutton  staff  293 23 Nov 16:01 startWebLogic.sh

Start-Server


This goal executes a startWebLogic command on a given domain, starting the WebLogic Server instance for use.

This goal also uses the <middlewareHome> and <domainHome> configuration elements to specify the location of the WLS installation and domain to use. 

If you have followed the convention-over-configuration approach and adopted the default values, these configuration elements do not need to be specified.

If you have installed WLS or created a domain in a different location, you must specify the location using the <middlewareHome> and <domainHome> configuration elements in the pom.xml or specify them as parameters on the command line.

Using the convention-over-configuration approach, the default domain ${basedir}/Oracle/Domains/mydomain using the WLS installation in ${basedir}/Oracle/Software can be started as shown below.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:start-server
[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:start-server (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  wls-maven-plugin: start-server                                    ++
[INFO] ++====================================================================++
.[INFO] Starting server in domain /Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/Oracle/Domains/mydomain
[INFO] Check stdout file for details: /Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/Oracle/Domains/mydomain/server-2388282492279558044.out
[INFO] Process being executed, waiting for completion.
.........
[INFO] Server started successful
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.137s
[INFO] Finished at: Wed Nov 23 16:23:07 CST 2011
[INFO] Final Memory: 4M/81M
[INFO] ------------------------------------------------------------------------

Deploy


The deploy goal deploys an application.

The convention-over-configuration approach uses the defaults available for middlewareHome, adminurl, and the source file to deploy allowing the goal to be executed without any additional configuration.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:deploy
[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:deploy (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  wls-maven-plugin: deploy                                          ++
[INFO] ++====================================================================++
weblogic.Deployer invoked with options:  -noexit -user weblogic -deploy -source /Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/target/maven-demo.war
<Nov 23, 2011 4:36:51 PM CST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, maven-demo [archive: /Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/target/maven-demo.war], to configured targets.>
Task 0 initiated: [Deployer:149026]deploy application maven-demo on AdminServer.
Task 0 completed: [Deployer:149026]deploy application maven-demo on AdminServer.
Target state: deploy completed on Server AdminServer

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.803s
[INFO] Finished at: Wed Nov 23 16:36:52 CST 2011
[INFO] Final Memory: 6M/81M
[INFO] ------------------------------------------------------------------------

Stop-Server


The stop-server goal stops an executing server using the stopWebLogic script on the specified domain.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:stop-server
[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:stop-server (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  wls-maven-plugin: stop-server                                     ++
[INFO] ++====================================================================++
[INFO] Stop server in domain: /Users/sbutton/Projects/Java/wls-maven-doc/maven-demo/Oracle/Domains/mydomain
[INFO] Process being executed, waiting for completion.
[INFO] [exec] Stopping Weblogic Server...
[INFO] [exec]
[INFO] [exec] Initializing WebLogic Scripting Tool (WLST) ...
[INFO] [exec]
[INFO] [exec] Welcome to WebLogic Server Administration Scripting Shell
[INFO] [exec]
[INFO] [exec] Type help() for help on available commands
[INFO] [exec]
[INFO] [exec] Connecting to t3://localhost:7001 with userid weblogic ...
[INFO] [exec] Successfully connected to Admin Server 'AdminServer' that belongs to domain 'mydomain'.
[INFO] [exec]
[INFO] [exec] Warning: An insecure protocol was used to connect to the
[INFO] [exec] server. To ensure on-the-wire security, the SSL port or
[INFO] [exec] Admin port should be used instead.
[INFO] [exec]
[INFO] [exec] Shutting down the server AdminServer with force=false while connected to AdminServer ...
[INFO] [exec] WLST lost connection to the WebLogic Server that you were
[INFO] [exec] connected to, this may happen if the server was shutdown or
[INFO] [exec] partitioned. You will have to re-connect to the server once the
[INFO] [exec] server is available.
[INFO] [exec] Disconnected from weblogic server: AdminServer
[INFO] [exec] Disconnected from weblogic server:
[INFO] [exec]
[INFO] [exec]
[INFO] [exec] Exiting WebLogic Scripting Tool.
[INFO] [exec]
[INFO] [exec] Done
[INFO] [exec] Stopping Derby Server...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.921s
[INFO] Finished at: Wed Nov 23 16:41:14 CST 2011
[INFO] Final Memory: 4M/81M
[INFO] ------------------------------------------------------------------------

APPC



The appc goal executes the WebLogic Server application compiler tool to prepare the application for deployment.

This benefits from the convention-over-configuration model, allowing it to be executed using the defaults of the project.

An example of the goal being executed is shown below.  Note this example uses the –verbose flag to highlight the activities the appc utility is performing.  This is not normally necessary.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:appc -Dverbose
[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:appc (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  wls-maven-plugin: appc                                            ++
[INFO] ++====================================================================++
<Nov 23, 2011 4:43:08 PM CST> <Info> <J2EE> <BEA-160230> <Created working directory: /var/folders/cL/cLTyZKXjGgmQhEpoV+U-DE+++TI/-Tmp-/appcgen_1322028788639_maven-demo.war>
[JspcInvoker]Checking web app for compliance.
[jspc]  -webapp specified, searching . for JSPs
[jspc] Compiling /index.jsp
<Nov 23, 2011 4:43:12 PM CST> <Info> <J2EE> <BEA-160220> <Compilation completed successfully.>
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.281s
[INFO] Finished at: Wed Nov 23 16:43:12 CST 2011
[INFO] Final Memory: 16M/81M
[INFO] ------------------------------------------------------------------------ 

WLST


The WLST goal enables the WebLogic Scripting Tool (WLST) to be used to execute scripts that configure resources or perform other operational actions on a WebLogic Server domain.  The WLST used by the wlst Maven goal is the standard environment WebLogic Server WLST environment so all existing scripts should be able to be used.

Benefitting again from the convention-over-configuration, the middlewareHome and domainHome locations do not need to be specified if the defaults are used.

The WLST goal can execute an external script specified using the <fileName> configuration element or a sequence of WLST calls can be specified within the pom.xml using the <script> configuration element.

<!-- WebLogic Server 12c Maven Plugin -->
<plugin>
    <groupId>com.oracle.weblogic</groupId>
    <artifactId>wls-maven-plugin</artifactId>
    <version>12.1.1.0</version>
    <configuration>
        <artifactLocation>
            com.oracle.weblogic:wls-dev:zip:12.1.1.0
        </artifactLocation>
        <user>weblogic</user>
        <password>welcome1</user>
        <filename>create-datasource.py</fileName>
    </configuration>
 </plugin>

An execution of the wlst goal is shown below.

sbutton:~/Projects/Java/wls-maven-doc/maven-demo $ mvn wls:wlst -DfileName=create-datasource.py
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-demo 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- wls-maven-plugin:12.1.1.0:wlst (default-cli) @ maven-demo ---
[INFO] ++====================================================================++
[INFO] ++  wls-maven-plugin: wlst                                            ++
[INFO] ++====================================================================++

*** Creating DataSource ***

Connecting to t3://localhost:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'mydomain'.

Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.

Location changed to edit tree. This is a writable tree with
DomainMBean as the root. To make changes you will need to start
an edit session via startEdit().

For more help, use help(edit)

Starting an edit session ...
Started edit session, please be sure to save and activate your
changes once you are done.
Activating all your changes, this may take a while ...
The edit lock associated with this edit session is released
once the activation is completed.
Activation completed
Location changed to serverRuntime tree. This is a read-only tree with ServerRuntimeMBean as the root.
For more help, use help(serverRuntime)

**** DataSource Details ****

Name:                        cp
Driver Name:            Oracle JDBC driver
DataSource:            oracle.jdbc.xa.client.OracleXADataSource
Properties:            {user=demo}
State:                        Running

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.686s
[INFO] Finished at: Wed Nov 23 16:55:25 CST 2011
[INFO] Final Memory: 13M/81M
[INFO] ------------------------------------------------------------------------