Weblogic Tip #1 - Installing Oracle Weblogic Server using Maven and the Zip distribution

Have you ever wondered if it is possible to install Oracle Weblogic Server using Maven? Well, it is.

  1. Install the Weblogic plugin
  2. Use the Weblogic plugin

Install the Weblogic plugin

Here is a bit of a chicken and the egg story. You will have to hav e an existing Weblogic install to perform this step. Go to the $MW_HOME/wlserver/server/lib directory and issue the following command:


    mvn install:install-file -Dfile=wls-maven-plugin.jar -DpomFile=pom.xml
        

That installs the wls-maven-plugin into your local Maven repository. Now you can use it.

Note this step does only need to be done once. Once the plugin is in your local Maven repository you can keep repeating step #2 below.

Use the Weblogic plugin

Add the following snippet to your POM


    <build>
        <plugins>
            <plugin>
                <groupId>com.oracle.weblogic</groupId>
                <artifactId>wls-maven-plugin</artifactId>
                <version>12.1.2.0</version>
            </plugin>
        <plugins>
    </build>
    <properties>
        <adminurl>t3://localhost:7001</adminurl>
        <domainHome>C:/Wls12.1.2</domainHome>
        <middlewareHome>C:/Wls12.1.2</middlewareHome>
        <weblogicHome>C:/Wls12.1.2/wlserver</weblogicHome>
        <user>admin</user>
        <password>yourpassword</password>
        <name>${project.build.finalName}</name>
        <false</failOnError>
        <timeout>60
    </properties>
        

Note this blog entry assumes WLS 12.1.2, so replace it with the appropriate version where necessary.

Now in the root directory of the project you can issue the following to install Weblogic:

    mvn -N com.oracle.weblogic:wls-maven-plugin:install -DartifactLocation=wls1212_dev.zip
        

This will install Weblogic into the directories specified in the above properties section.

Posted May 21, 2014

Up