Getting started with Weblogic Maven Plugin

What is Weblogic Maven Plugin ?

Weblogic Maven Plugin is a plugin (just a single jar) that comes bundled with Weblogic Application Server which helps to manage the Weblogic server through Maven commands. When I say manage, I mean following actions on Weblogic server -
  • Create/Modify/Delete weblogic domain
  • Start server/Stop server/Restart server
  • Deploy/Undeploy applications
Yes. You read it correctly. Just similar like "tomcat7-maven-plugin" which is to run tomcat within maven, we now have "weblogic-maven-plugin". This means, you can run weblogic server in background during maven builds.

So, let's gets started with using weblogic-maven-plugin.

Installing the weblogic-maven-plugin

For this tutorial, my machine setup is as follows:

Weblogic Server Version                      :12.2.1 (can be downloaded from here)
Weblogic Server Installation directory : D:\Oracle_home\
OS                                                         : Windows 7
Java Version                                          : 1.8.0_121 (As weblogic 12.2.1 requires Java 8 to run)
Maven version                                      : 3.0.4

You can find the plugin's jar file & pom.xml file in following directory :
D:\Oracle_home\wlserver\plugins\maven\com\oracle\weblogic\weblogic-maven-plugin\12.2.1

Now, we are ready to install this plugin in our local maven repository.
  1. Navigate to this directory in command prompt.
  2. Fire below command :

    mvn install:install-file -Dfile=weblogic-maven-plugin-12.2.1.jar -DpomFile=weblogic-maven-plugin-12.2.1.pom



    Maven may download other tons of other dependencies, so be patient. When Build Success comes, you are done. (Have a powernap 👀).
  3. You can invoke plugin lifecycles, as following :

    To make any deployment :
    mvn com.oracle.weblogic:weblogic-maven-plugin:deploy

    To Start the application:
    mvn com.oracle.weblogic:weblogic-maven-plugin:start-app

    To Stop the application:
    mvn com.oracle.weblogic:weblogic-maven-plugin:stop-app
If you want to know more in details about each goal, please check this. Its'a bit old but you should be able to get an idea on how powerful this plugin is.

Hope this post helped. :-)






Comments

Popular posts from this blog

Why do I get Error: could not open `C:\Program Files\Java\jre7\lib\i386\jvm.cfg

Preparing applications for migration to Oracle 11G from Oracle 10G