Weblogic 10.3 and Maven Integration

(Update: I’m moving this article and the t3 channel creation step to my permanent blog here)

So another one for my notes. After searching in-vain for proper way to integrate the Weblogic 10.3 with maven, I think the solution below is working very well for me. We are going to use the weblogic-maven-plugin from codehaus. All the current solution including the plugin documentation requires either installing a bunch of

Requirements:

  • You have a WL 10.3 installation
  • JDK5
  • Maven 2.0.9 or above

Required Steps

We will break it down into three main steps. One of the steps could be avoided if the weblogic-maven-plugin authors did not hard-code weblogic dependencies which are not available in the Maven repositories anyway (or if maven could support excluding plugin dependencies).

  1. Building the uber weblogic jar and publishing it to your local or organization repository.
  2. Downloading the weblogic-maven-plugin pom and jar.
  3. Configuring WL 10.3 a non-ssl admin channel

Step 1. Building the uber weblogic jar

There is a way to build a full weblogic client jar, so we don’t have to figure out what jars we need. For this of course you need a WL 10.3 installation. The instruction are actually given here (weblogic jarbuilder tool). If you follow the steps then you should have a wlfullclient.jar, in the WL_HOME/sever/lib folder. Here is how it looks like:

C:\>java -jar ...
...
Created new jar file: C:\..\server\lib\wlfullclient.jar
...
Now, we will use maven to install this for this example in our local repository (you can use deploy to publish it to your org. repo, such as Nexus).
$ mvn install:install-file -Dfile=wlfullclient.jar \
    -DgroupId=weblogic -DartifactId=wlfullclient \
    -Dversion=10.3 -Dpackaging=jar -DgeneratePom=true

Note the use of the character "\" is just a *nix newline escape, basically the whole thing above should be on one line.
 

Step 2. Download and modify the weblogic-maven-plugin POM and jar

As mentioned before, we need to modify the pom because of hard coded dependency to weblogic. So what we do here is:

  • Download the POM
  • Change the version in the pom and delete the 2 weblogic dependencies
  • Then install the Pom and the associated jar into our repository (local).

Download the POM & Jar

Download the POM from here (weblogic-maven-plugin pom) and then also download the jar. So first we download the POM and change as shown below:

<project xmlns=http://maven.apache.org/POM/4.0.0>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <artifactId>mojo</artifactId>
    <groupId>org.codehaus.mojo</groupId>
    <version>14</version>
  </parent>
  <prerequisites>
    <maven>2.0</maven>
  </prerequisites>
  <artifactId>weblogic-maven-plugin</artifactId>
  <packaging>maven-plugin</packaging>
  <name>Weblogic Maven Plugin</name>
  <version>2.9.1-001</version>  <!-- CHANGED -->
  ...
  <dependencies>
        ...
    <!-- COMMENT OUT THE 2 WL DEPENDENCIES
    <dependency>
      <groupId>weblogic</groupId>
      <artifactId>weblogic</artifactId>
      <version>[9.0,11.0)</version>
    </dependency>
    <dependency>
      <groupId>weblogic</groupId>
      <artifactId>webservices</artifactId>
      <version>[9.0,11.0)</version>
    </dependency>
     -->
       ...
  </dependencies>
  ...
</project>

Notice the comment CHANGED lines. Now we install this pom and the downloaded jar into our local repository because of the changes.

mvn install:install-file -Dfile=weblogic-maven-plugin-2.9.1.jar \
                         -DpomFile=weblogic-maven-plugin-2.9.1-001.pom \
                         -DgroupId=org.codehaus.mojo \
                         -DartifactId=weblogic-maven-plugin \
                         -Dversion=2.9.1-001 \
                         -Dpackaging=maven-plugin

Important things to note above:

  • -DpomFile  the pom file is the edited one as we did before, I called the edited pom weblogic-maven-plugin-2.9.1-001.pom
  • The version -Dversion=2.9.1-001
  • And the packaging (very important) -Dpackaging=maven-plugin

Now, of course in your project you would use this version of the installed plugin.

Step 3. Create an admin channel in Weblogic 10.3

Ok, we need to do this step because for some reason WL 10.3, you can no longer do the deploys using the t3. Only SSL is allowed, and for some reason the uber jar does not include a particular implementation and I did not have the time to investigate it. <TODO>Another post describing the process</TODO> (Update: The steps is described here.)

Putting it all together

Ok, after you have done all the 3 steps, here is how the configuration looks like. Enjoy and leave a comment if this was useful or need more clarification.

    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>weblogic-maven-plugin</artifactId>
      <version>2.9.1-001</version>
      <inherited>true</inherited>
      <configuration>
        <adminServerHostName>localhost</adminServerHostName>
        <adminServerPort>7001</adminServerPort>
        <adminServerProtocol>t3</adminServerProtocol>
        <userId>weblogic</userId>
        <password>weblogic</password>
        <upload>true</upload>
        <remote>true</remote>
        <verbose>true</verbose>
        <debug>false</debug>
        <targetNames>my_admin_server</targetNames>
        <noExit>true</noExit>
      </configuration>
      <dependencies>
        <dependency>
          <groupId>weblogic</groupId>
          <artifactId>wlfullclient</artifactId>
          <version>10.3</version>
          <scope>provided</scope>
        </dependency>
      </dependencies>
    </plugin>

Few things to note here:

  • The adminServerPort corresponds to 7001, this is the port I configured in the Step 3 (admin channel)
  • Also note, the wlfullclient dependency I chose to add it here, instead of the edited pom in Step 2. Of course this requires Maven 2.0.9 and above.
  • Also the plugin version is 2.9.1-001 the one we installed in Step 2.

So that’s it.

Advertisements

13 Comments

  1. Sridhar said

    Hi,
    Thanks for your steps. These are very usefull to me. But i need step 3 in clear.
    Please expalin me to create Admin channel in weblogic 10.3
    Thanks in advance,
    Sridhar

  2. Renuka said

    Hi,

    Please give us details of step3 which is still TODO.

    Thanks,

    Renuka

  3. […] 08/24/2009 This was posted in my old blog here, since the part 2 of the article is available on this blog. I’m moving the content here, with […]

  4. mohan said

    Ok, I have posted the step on my new blog here:
    http://www.blogwitter.com/2009/08/24/weblogic-10-3-creating-t3-admin-channel/

  5. […] 08/24/2009 This was posted in my old blog here, since the part 2 of the article is available on this blog. I’m moving the content here, with […]

  6. wkabmwboj said

    itcfRm nhnibfhdxxtt, [url=http://wpsxwgjhkwtd.com/]wpsxwgjhkwtd[/url], [link=http://fgqtyhbdwtbe.com/]fgqtyhbdwtbe[/link], http://jspqqylloqao.com/

  7. Roy49 said

    I actually opted for two answers depending on whether the averaging is done on distance or time. ,

  8. JXL21 said

    It can then place the translated address on the appropriate bus. ,

  9. Gab said

    I still get a weblogic/Deployer major.minor version error 😦

  10. Marcus said

    The new blog seems to be down. Can someone describe step 3?

  11. Ninja said

    The new blog is down! could someone please give the details!

  12. Isaac said

    Enable tunneling in the weblogic console

    Environment/Servers/AdminServer/Protocols

    I had to add a couple of steps to get it all working

    1. Add dependencty com.bea.core.descriptor-1.2.00.jar in addition to the wlfullclient

    2. Move my maven repository to a location with no spaces. It defaults to “documents and settings” so that will not work.

  13. Isaac said

    3. open the weblogic-maven-plugin-2.9.1.jar and update the version in the descriptor (META-INF\maven\plugin.xml) to include the -001 in the version. Otherwise I got an error saying the plugin specified the wrong version.

RSS feed for comments on this post · TrackBack URI

Comments are closed.

%d bloggers like this: