Apache Maven is a software tool for building and managing Java-based projects. Now you can use a Maven plug-in for WebLogic Server (weblogic-maven-plugin
) to perform deployment operations similar to those supported by the command-line utility, weblogic.Deployer
. The plug-in lets you deploy, redeploy, update, and such, applications built using Maven to WebLogic Server from within the Maven environment.
To download and configure Maven on supported platforms, see http://maven.apache.org/download.html
. Be sure to read the set up instructions closely to ensure that Maven is working correctly in your environment.
For detailed information on using Maven to build applications and projects, see the Maven Users Centre at http://maven.apache.org/users/index.html
.
The following sections describe using the weblogic-maven-plugin
for deployment:
Follow these steps for generating, installing, and using the weblogic-maven-plugin
:
Note:
To successfully accomplish these steps, your computer must be connected to the Internet and have the necessary proxy settings configured correctly in thesettings.xml
file (typically $HOME
/.m2/settings.xml
). For further details, see http://maven.apache.org/guides/mini/guide-proxies.html
.Build the plug-in JAR file using the WebLogic JarBuilder Tool (wljarbuilder
) under MW_HOME
/wlserver_10.3/server/lib/
with the following command:
java -jar wljarbuilder.jar -profile weblogic-maven-plugin
The weblogic-maven-plugin.jar
contains a Project Object Model (pom.xml
) file which specifies the groupId
, artifactId
, version
, and packaging
of the weblogic-maven-plugin.jar
:
groupId=com.oracle.weblogic artifactId=weblogic-maven-plugin version=10.3.4 packaging=maven-plugin
These fields identify the plug-in and mark a specific place in a Maven repository, acting like a coordinate system for Maven projects.
Extract the pom.xml
file from weblogic-maven-plugin.jar
under the MW_HOME
/wlserver_10.3/server/lib
directory, and then copy the pom.xml
file to MW_HOME
/wlserver_10.3/server/lib
.
For example:
jar xvf MW_HOME/wlserver_10.3/server/lib/weblogic-maven-plugin.jar META-INF/maven/com.oracle.weblogic/weblogic-maven-plugin/pom.xml cp MW_HOME/wlserver_10.3/server/lib/META-INF/maven/com.oracle.weblogic/ weblogic-maven-plugin/pom.xml MW_HOME/wlserver_10.3/server/lib
Provision the weblogic-maven-plugin.jar
in your local Maven repository with the following command. However, for a shortened command-line goal invocation of the plug-in, follow the directions in step 5 before performing this step.
mvn install:install-file
-Dfile=MW_HOME/wlserver_10.3/server/lib/weblogic-maven-plugin.jar -DpomFile=pom.xml
Typical command output is like the following:
[INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'install'. [INFO] com.oracle.weblogic: checking for updates from central [INFO] org.apache.maven.plugins: checking for updates from central [INFO] org.codehaus.mojo: checking for updates from central Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/ maven-install-plugin/2.2/maven-install-plugin-2.2.pom Downloading: ... [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Mojo Archetype [INFO] task-segment: [install:install-file] (aggregator-style) [INFO] ------------------------------------------------------------------------ Downloading: ... [INFO] [install:install-file {execution: default-cli}] [INFO] Installing c:\oracle\Middleware\wlserver_10.3\ server\lib\weblogic-maven-plugin.jar to C:\DEMO\com\oracle\weblogic\weblogic-maven-plugin\10.3.4\ weblogic-maven-plugin-10.3.4.jar [INFO] Installing C:\pom.xml to C:\DEMO\com\oracle\weblogic\weblogic-maven-plugin\10.3.4\ weblogic-maven-plugin-10.3.4.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 minute 3 seconds [INFO] Finished at: Thu Jul 22 12:11:10 PDT 2010 [INFO] Final Memory: 13M/64M [INFO] ------------------------------------------------------------------------ C:\>
Note:
Because themvn install
command downloads Maven dependencies from the Internet which are required for the successful execution of Maven goals, you must have run mvn install
at least once on your local machine.Use the Maven plug-in by employing either of the following methods:
From the command line—By invoking a goal from the command line.
For example, using the goal full name to deploy:
mvn com.oracle.weblogic:weblogic-maven-plugin:deploy
Or, optionally, if you've configured using the shortened command-line goal invocation (see Step 5):
mvn weblogic:deploy
From a POM file—By including the Maven plug-in in the application's pom.xml
file.
You add the plug-in into any life cycle phase of the project. Optionally, you can add a goal to any of the default Maven life cycle phases by adding an executions
tag in the pom.xml
file. The goal is then bound to that particular phase of the Maven life cycle. For example, as shown in Example C-1, the goal is bound to the "install" phase of the Maven life cycle. By doing this, every time you run the mvn install
command, the deployment plug-in is also called.
Example C-1 Maven Project pom.xml File
<build> <plugins> <plugin> <groupId>com.oracle.weblogic</groupId> <artifactId>weblogic-maven-plugin</artifactId> <version>10.3.4</version> <configuration> <adminurl>t3://localhost:7001</adminurl> <user>weblogic</user> <password>weblogic123</password> <upload>true</upload> <action>deploy</action> <remote>false</remote> <verbose>true</verbose> <source>${project.build.directory}/${project.build.finalName}.${project.packaging}</source> <name>${project.build.finalName}</name> </configuration> <!-- <executions> <execution> <phase>install</phase> <goals> <goal>deploy</goal> </goals> </execution> </executions> --> </plugin> . . . </plugins> </build>
Optionally, you can shorten the full invocation of the plug-in by providing a pom.xml
file, as shown in Example C-2, and modifying the settings.xml
file located in your $HOME
/.m2
directory, before you provision the plug-in in your Maven repository.
Change the settings.xml
file as follows:
<!-- pluginGroups | This is a list of additional group identifiers that will be searched | when resolving plugins by their prefix, for example, when invoking a | command line like "mvn prefix:goal". Maven will automatically add the | group identifiers "org.apache.maven.plugins" and "org.codehaus.mojo" | if theses are not already contained in the list. | --> <pluginGroups> <!-- pluginGroup | Specifies a further group identifier to use for plugin lookup. --> <pluginGroup>com.oracle.weblogic</pluginGroup> </pluginGroups>
Replace the MW_HOME
/wlserver_10.3/server/lib/pom.xml
file with the following:
<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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.oracle.weblogic</groupId> <artifactId>weblogic-maven-plugin</artifactId> <packaging>maven-plugin</packaging> <version>10.3.4</version> <name>Maven Mojo Archetype</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>org.apache.maven</groupId> <artifactId>maven-plugin-api</artifactId> <version>2.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <artifactId>maven-plugin-plugin</artifactId> <version>2.3</version> <configuration> <goalPrefix>weblogic</goalPrefix> </configuration> </plugin> </plugins> </build> </project>
From within MW_HOME
/wlserver_10.3/server/lib/
, provision the weblogic-maven-plugin.jar
in your local Maven repository as follows:
mvn install:install-file
-Dfile=MW_HOME/wlserver_10.3/server/lib/weblogic-maven-plugin.jar -DpomFile=pom.xml
Now, you can use a shortened command-line goal invocation, such as:
mvn weblogic:deploy
Table C-1 lists the weblogic-maven-plugin
deployment goals.
Table C-1 Maven Plug-In Deployment Goals
Short Name | Description |
---|---|
weblogic:deploy |
Deploys or redeploys an application or module. |
weblogic:undeploy |
Stops the deployment and removes staged files from target servers. |
weblogic:redeploy |
Redeploys a running application or part of a running application. |
weblogic:start-app |
Starts an application. |
weblogic:stop-app |
Stops an application. |
weblogic:list-apps |
Lists the deployment names for applications and standalone modules deployed, distributed, or installed in the domain. |
weblogic:update-app |
Updates an application's deployment plan by redistributing the plan files and reconfiguring the application based on the new plan contents. |
weblogic:help |
Lists all the deployment goals. |
com.oracle.weblogic:weblogic-maven-plugin:deploy
weblogic:deploy
Deploys an application or module.
Requires a Maven 2.0 project.
Requires an application ready for deployment.
Table C-2 weblogic:deploy Parameters
Option | Type | Default | Description |
---|---|---|---|
|
String |
|
Deployment name to assign to a newly-deployed application or standalone module. If you do not specify this attribute, WebLogic Server assigns a deployment name to the application, based on its archive file or exploded directory. |
|
String |
|
Required. Archived file or exploded archive directory to deploy. |
|
String |
|
Deployment plan to use when deploying the application or module. |
|
String |
|
Targets on which to distribute and deploy the application or module. The value of this attribute is a comma-separated list of target servers, clusters, or virtual hosts. |
|
Boolean |
|
Copies the source files to the Administration Server's upload directory prior to deployment. |
|
Boolean |
|
Copies deployment files to target servers' staging directories. |
|
Boolean |
|
Does not copy the deployment files to target servers, but leaves them in a fixed location, specified by the |
|
Boolean |
|
Does not copy the deployment files to target servers; instead, you must ensure that deployment files have been copied to the correct subdirectory in the target servers' staging directories. You can manually copy the files or use a third-party tool or script. You can specify only one of the following attributes: |
|
Integer |
|
Number of seconds before WebLogic Server undeploys the currently-running version of this application or module so that clients can start using the new version. |
|
Boolean |
|
The deployment as a shared J2EE library or optional package. |
|
String |
|
Specification version of a J2EE library or optional package. You can use this option only if the library or package does not include a specification version in its manifest file. |
|
String |
|
Implementation version of a J2EE library or optional package. You can use this option only if the library or package does not include an implementation version in its manifest file. |
|
Boolean |
|
Deployment operation uses an existing lock, already acquired by the same user, on the domain. This option 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. |
|
String |
|
Name of an alternate J2EE deployment descriptor ( |
|
String |
|
Name of an alternate WebLogic Server deployment descriptor ( |
|
String |
|
Security model to use for this deployment. Possible security models are: Deployment descriptors only, Customize roles, Customize roles and policies, Security realm configuration (advanced model). Actual valid values for this attribute are |
|
Boolean |
|
Enable validation of security data. |
|
String |
|
Task identifier of a running deployment task. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one. |
|
String |
|
JMS Server targets for resources defined within a JMS application module. The value of this attribute is a comma-separated list of JMS server names. See Using Sub-Module Targeting with JMS Application Modules and Using WLST to Manage JMS Servers and JMS System Resources in Configuring and Managing JMS for Oracle WebLogic Server. |
Example C-3 illustrates using the weblogic:deploy
goal.
C:\>mvn com.oracle.weblogic:weblogic-maven-plugin:deploy
-Dadminurl=t3://myhost:7001 -Duser=weblogic
-Dpassword=mypassword -Dtargets=AdminServer -Dsource=c:\apps\sample.war
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Mojo Archetype
[INFO] task-segment: [com.oracle.weblogic:weblogic-maven-plugin:deploy]
[INFO] ------------------------------------------------------------------------
[INFO] [weblogic:deploy {execution: default-cli}]
weblogic.Deployer invoked with options: -noexit -adminurl t3://myhost:7001
-user weblogic -deploy -source c:\apps\sample.war -targets AdminServer
<Aug 9, 2010 5:54:22 PM PDT> <Info> <J2EE Deployment SPI> <BEA-260121>
<Initiating deploy operation for application,
sample.war [archive: c:\apps\sample.war], to Admin Server .>
Task 0 initiated: [Deployer:149026]deploy application sample.war on AdminServer.
Task 0 completed: [Deployer:149026]deploy application sample.war on AdminServer.
Target state: deploy completed on Server AdminServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Aug 09 17:54:23 PDT 2010
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
For additional usage information, see weblogic.Deployer Command-Line Reference.
com.oracle.weblogic:weblogic-maven-plugin:undeploy
weblogic:undeploy
Undeploys an application or module.
Requires a Maven 2.0 project.
Requires an already deployed application.
Table C-3 weblogic:undeploy Parameters
Option | Type | Default | Description |
---|---|---|---|
|
String |
|
Required. Deployment name of a deployed application or module. If you do not specify this attribute, WebLogic Server assigns a deployment name to the application, based on its archive file or exploded directory. |
|
String |
|
Version identifier of the deployed application. |
|
String |
|
Version identifier of the deployment plan. |
|
String |
|
Archived file or exploded archive directory to undeploy. |
|
String |
|
Deployment plan to use when undeploying. |
|
String |
|
Targets from which the application or module are undeployed. The value of this attribute is a comma-separated list of target servers, clusters, or virtual hosts. |
|
Integer |
|
Number of seconds before WebLogic Server undeploys the currently-running version of this application or module so that clients can start using the new version. |
|
String |
|
Stops the application after existing HTTP clients have completed their work. If you do not specify the |
|
String |
|
Immediately places the application into Administration mode without waiting for current HTTP sessions to complete. |
|
String |
|
Task identifier of a running deployment task. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one. |
|
String |
|
JMS Server targets for resources defined within a JMS application module. The value of this attribute is a comma-separated list of JMS server names. See Using Sub-Module Targeting with JMS Application Modules and Using WLST to Manage JMS Servers and JMS System Resources in Configuring and Managing JMS for Oracle WebLogic Server. |
Example C-4 illustrates using the weblogic:undeploy
goal.
C:\>mvn com.oracle.weblogic:weblogic-maven-plugin:undeploy
-Dadminurl=t3://myhost:7001 -Duser=weblogic
-Dpassword=mypassword -Dtargets=AdminServer -Dname=sample.war
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Mojo Archetype
[INFO] task-segment: [com.oracle.weblogic:weblogic-maven-plugin:undeploy]
[INFO] ------------------------------------------------------------------------
[INFO] [weblogic:undeploy {execution: default-cli}]
weblogic.Deployer invoked with options: -noexit -adminurl t3://myhost:7001
-user weblogic -undeploy -name sample.war -targets AdminServer
<Aug 9, 2010 10:41:16 PM PDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiat
ing undeploy operation for application, sample.war [archive: null],
to AdminServer .>
Task 3 initiated: [Deployer:149026]remove application sample.war on AdminServer.
Task 3 completed: [Deployer:149026]remove application sample.war on AdminServer.
Target state: undeploy completed on Server AdminServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Aug 09 22:41:16 PDT 2010
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
For additional usage information, see weblogic.Deployer Command-Line Reference.
com.oracle.weblogic:weblogic-maven-plugin:redeploy
weblogic:redeploy
Redeploys an application or module.
Requires a Maven 2.0 project.
Requires an application ready for deployment.
Table C-4 weblogic:redeploy Parameters
Option | Type | Default | Description |
---|---|---|---|
|
String |
|
Required. Deployment name of a deployed application or module. If you do not specify this attribute, WebLogic Server assigns a deployment name to the application, based on its archive file or exploded directory. If you do not specify the |
|
String |
|
Archive file or exploded archive directory to redeploy. |
|
String |
|
Deployment plan to use when redeploying. |
|
String |
|
Targets on which to redeploy the application or module. The value of this attribute is a comma-separated list of target servers, clusters, or virtual hosts. |
|
String |
|
Copies the source files to the Administration Server's upload directory prior to redeployment. |
|
String |
|
Removes static files from a server's staging directory. This attribute is valid only for unarchived deployments, and only for applications deployed using |
|
Integer |
|
Number of seconds before WebLogic Server undeploys the currently-running version of this application or module so that clients can start using the new version. |
|
String |
|
One or more files to redeploy. |
|
String |
|
Task identifier of a running deployment task. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one. |
|
String |
|
JMS Server targets for resources defined within a JMS application module. The value of this attribute is a comma-separated list of JMS server names. See Using Sub-Module Targeting with JMS Application Modules and Using WLST to Manage JMS Servers and JMS System Resources in Configuring and Managing JMS for Oracle WebLogic Server. |
Example C-5 illustrates using the weblogic:redeploy
goal.
C:\>mvn com.oracle.weblogic:weblogic-maven-plugin:redeploy
-Dadminurl=t3://myhost:7001 -Duser=weblogic
-Dpassword=mypassword -Dtargets=AdminServer -Dname=sample.war
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Mojo Archetype
[INFO] task-segment: [com.oracle.weblogic:weblogic-maven-plugin:redeploy]
[INFO] ------------------------------------------------------------------------
[INFO] [weblogic:redeploy {execution: default-cli}]
weblogic.Deployer invoked with options: -noexit -adminurl t3://myhost:7001
-user weblogic -redeploy -name sample.war
<Sep 9, 2010 10:12:27 PM PDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiat
ing redeploy operation for application, sample.war [archive: null], to to configurd targets.>
Task 1 initiated: [Deployer:149026]redeploy application sample.war on AdminServer.
Task 1 completed: [Deployer:149026]redeploy application sample.war on AdminServer.
Target state: redeploy completed on ServervE AdminServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Thu Sep 09 22:12:27 PDT 2010
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
For additional usage information, see weblogic.Deployer Command-Line Reference.
com.oracle.weblogic:weblogic-maven-plugin:start-app
weblogic:start-app
Starts an application.
Requires a Maven 2.0 project.
Requires an already deployed application.
Table C-5 weblogic:start-app Parameters
Option | Type | Default | Description |
---|---|---|---|
|
Boolean |
|
Start application in Administration mode, not Production mode (which is the default). Administration mode restricts access to an application to a configured Administration channel. |
|
String |
|
Required. Deployment name of a deployed application or module to start. |
|
String |
|
Version of the application to start. |
|
String |
|
Version of the deployment plan to use when starting the application. |
|
String |
|
Targets on which to start the application or module. The value of this attribute is a comma-separated list of target servers, clusters, or virtual hosts. |
|
Integer |
|
Number of seconds before WebLogic Server undeploys the currently-running version of this application or module so that clients can start using the new version. |
|
String |
|
Task identifier of a running deployment task. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one. |
|
String |
|
JMS Server targets for resources defined within a JMS application module. The value of this attribute is a comma-separated list of JMS server names. See Using Sub-Module Targeting with JMS Application Modules and Using WLST to Manage JMS Servers and JMS System Resources in Configuring and Managing JMS for Oracle WebLogic Server. |
Example C-6 illustrates using the weblogic:start-app
goal.
Example C-6 weblogic:start-app
C:\>mvn com.oracle.weblogic:weblogic-maven-plugin:start-app
-Dadminurl=t3://myhost:7001 -Duser=weblogic
-Dpassword=mypassword -Dtargets=AdminServer -Dname=sample.war
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Mojo Archetype
[INFO] task-segment: [com.oracle.weblogic:weblogic-maven-plugin:start-app]
[INFO] ------------------------------------------------------------------------
[INFO] [weblogic:start-app {execution: default-cli}]
weblogic.Deployer invoked with options: -noexit -adminurl t3://myhost:7001
-user weblogic -start -name sample.war -targets AdminServer
<Aug 9, 2010 10:54:51 PM PDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiat
ing start operation for application, sample.war [archive: null], to AdminServer
.>
Task 6 initiated: [Deployer:149026]start application sample.war on AdminServer.
Task 6 completed: [Deployer:149026]start application sample.war on AdminServer.
Target state: start completed on Server AdminServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Aug 09 22:54:52 PDT 2010
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
For additional usage information, see weblogic.Deployer Command-Line Reference.
com.oracle.weblogic:weblogic-maven-plugin:stop-app
weblogic:stop-app
Stops an application.
Requires a Maven 2.0 project.
Requires an already deployed application.
Table C-6 weblogic:stop-app Parameters
Option | Type | Default | Description |
---|---|---|---|
|
Boolean |
|
Indicates that a running application should switch to Administration mode and accept only Administration requests via a configured Administration channel. If this option is not specified, the running application is stopped and cannot accept Administration or client requests until is it restarted. |
|
String |
|
Required. Deployment name of a deployed application or module to stop. |
|
String |
|
Version identifier of the deployed application. |
|
String |
|
Version identifier of the deployment plan. |
|
String |
|
Targets on which to stop the application or module. The value of this attribute is a comma-separated list of target servers, clusters, or virtual hosts. |
|
Boolean |
|
Stops the application after existing HTTP clients have completed their work. If you do not specify the |
|
Boolean |
|
Immediately places the application into Administration mode without waiting for current HTTP sessions to complete. |
|
Integer |
|
The amount of time, in seconds, that the Work Manager accepts and schedules RMI calls until there are no more RMI requests arriving within the RMI grace period during a |
|
Integer |
|
Number of seconds before WebLogic Server undeploys the currently-running version of this application or module so that clients can start using the new version. |
|
String |
|
Task identifier of a running deployment task. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one. |
|
String |
|
JMS Server targets for resources defined within a JMS application module. The value of this attribute is a comma-separated list of JMS server names. See Using Sub-Module Targeting with JMS Application Modules and Using WLST to Manage JMS Servers and JMS System Resources in Configuring and Managing JMS for Oracle WebLogic Server. |
Example C-7 illustrates using the weblogic:stop-app
goal.
C:\>mvn com.oracle.weblogic:weblogic-maven-plugin:stop-app
-Dadminurl=t3://myhost:7001 -Duser=weblogic
-Dpassword=mypassword -Dtargets=AdminServer -Dname=sample.war
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Mojo Archetype
[INFO] task-segment: [com.oracle.weblogic:weblogic-maven-plugin:stop-app]
[INFO] ------------------------------------------------------------------------
[INFO] [weblogic:stop-app {execution: default-cli}]
weblogic.Deployer invoked with options: -noexit -adminurl t3://myhost:7001
-user weblogic -stop -name sample.war -targets AdminServer
<Aug 9, 2010 10:53:39 PM PDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiat
ing stop operation for application, sample.war [archive: null], to AdminServer .
>
Task 5 initiated: [Deployer:149026]stop application sample.war on AdminServer.
Task 5 completed: [Deployer:149026]stop application sample.war on AdminServer.
Target state: stop completed on Server AdminServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Aug 09 22:53:39 PDT 2010
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
For additional usage information, see weblogic.Deployer Command-Line Reference.
com.oracle.weblogic:weblogic-maven-plugin:list-apps
weblogic:list-apps
Lists the deployment names for applications and standalone modules deployed, distributed, or installed in the domain.
Requires a Maven 2.0 project.
There are no parameters required or optionally taken by this goal.
Example C-8 illustrates using the weblogic:list-apps
goal.
Example C-8 weblogic:list-apps
C:\>mvn com.oracle.weblogic:weblogic-maven-plugin:list-apps
-Dadminurl=t3://myhost:7001 -Duser=weblogic
-Dpassword=mypassword -Dtargets=AdminServer
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Mojo Archetype
[INFO] task-segment: [com.oracle.weblogic:weblogic-maven-plugin:list-apps]
[INFO] ------------------------------------------------------------------------
[INFO] [weblogic:list-apps {execution: default-cli}]
weblogic.Deployer invoked with options: -noexit -adminurl t3://myhost:7001
-user weblogic -listapps
sample.war
Number of Applications Found : 1
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Aug 09 22:52:07 PDT 2010
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
For additional usage information, see weblogic.Deployer Command-Line Reference.
com.oracle.weblogic:weblogic-maven-plugin:update-app
weblogic:update-app
Updates an application's deployment plan by redistributing the plan files and reconfiguring the application based on the new plan contents.
Requires a Maven 2.0 project.
Can have an application already deployed.
Table C-7 weblogic:update-app Parameters
Option | Type | Default | Description |
---|---|---|---|
|
String |
|
Required. Deployment name of a deployed application or module. If you do not specify this attribute, WebLogic Server assigns a deployment name to the application, based on its archive file or exploded directory. |
|
String |
|
Required. Deployment plan to use for updating the application's configuration. The specified deployment plan must be valid for the application's target servers. For example, the plan cannot contain null variables for required resources unless those resources were previously defined in the associated descriptors. Update operations update only those descriptors for which there is a changed, not null value in the deployment plan. If a plan that is used by an update operation contains null variables, the current values in the corresponding descriptors are not updated. |
|
String |
|
Version identifier of the deployment plan. |
|
String |
|
Targets on which to update the application or module. The value of this attribute is a comma-separated list of target servers, clusters, or virtual hosts. |
|
Boolean |
|
Transfers a new deployment plan to the Administration Server before updating the application. |
|
String |
|
Version identifier of the deployed application. |
|
String |
|
Task identifier of a running deployment task. Make sure that the identifier is unique to all other running deployment tasks. The system automatically generates a unique identifier if you do not specify one. |
|
String |
|
JMS Server targets for resources defined within a JMS application module. The value of this attribute is a comma-separated list of JMS server names. See Using Sub-Module Targeting with JMS Application Modules and Using WLST to Manage JMS Servers and JMS System Resources in Configuring and Managing JMS for Oracle WebLogic Server. |
Example C-9 illustrates using the weblogic:update-app
goal.
Example C-9 weblogic:update-app
C:\>mvn com.oracle.weblogic:weblogic-maven-plugin:update-app
-Dadminurl=t3://myhost:7001 -Duser=weblogic
-Dpassword=mypassword -Dname=sample.war -Dremote=true
-Dupload=true -Dplan=c:\apps\sampleWar.plan
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Mojo Archetype 10.3.4
[INFO] ------------------------------------------------------------------------
[INFO] --- weblogic-maven-plugin:10.3.4:update-app (default-cli)
@ weblogic-maven-plugin ---
weblogic.Deployer invoked with options: -noexit -adminurl t3://myhost:7001
-user weblogic -update -plan c:\apps\sampleWar.plan sample.war -name sample.war -upload -remote
<Oct 18, 2010 10:30:47 AM PDT> <Info> <J2EE Deployment SPI> <BEA-260121> <Initia
ting update operation for application, sample.war [archive: null], to configured
targets.>
Task 8 initiated: [Deployer:149026]update application sample.war on AdminServer.
Task 8 completed: [Deployer:149026]update application sample.war on AdminServer.
Target state: update completed on Server AdminServer
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.188s
[INFO] Finished at: Mon Oct 18 10:30:49 PDT 2010
[INFO] Final Memory: 3M/15M
[INFO] ------------------------------------------------------------------------
For additional usage information, see weblogic.Deployer Command-Line Reference.
com.oracle.weblogic:weblogic-maven-plugin:help
weblogic:help
Lists all the supported deployment goals.
Requires a Maven 2.0 project.
Example C-10 illustrates using the weblogic:help
goal.
C:\>mvn com.oracle.weblogic:weblogic-maven-plugin:help
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Mojo Archetype 10.3.4
[INFO] ------------------------------------------------------------------------
[INFO] --- weblogic-maven-plugin:10.3.4:help (default-cli) @ weblogic-maven-plugin ---
The following are the goals available currently in Maven
deploy
list-apps
redeploy
start-app
stop-app
undeploy
update-app
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.344s
[INFO] Finished at: Fri Oct 15 11:01:28 PDT 2010
[INFO] Final Memory: 2M/15M
[INFO] ------------------------------------------------------------------------
Table C-8 describes some common Maven plug-in errors and helps you resolve them.
Table C-8 Maven Plug-In Errors
Configuration Step | Error Message | Resolution |
---|---|---|
Step 1: Generating the plug-in. java –jar wljarbuilder.jar –profile weblogic-maven-plugin |
|
Make sure that you have issued the command from within the |
Step 2: Extracting the |
The |
|
Step 3: Provisioning the If the provisioning is successful, you will see a |
|
The possible issues are:
|
Step 4: Executing Maven goals. If successful, you will see a |
|
The possible issues are:
|