How to use ojserver in JDeveloper's 12c maven pom

As we know the latest version of JDeveloper 12c offers a complete support for Maven including handling all ADF-related dependencies in form of ADF libraries. When you create a new application JDeveloper by default asks you to choose one of three available building options, the second of which is Maven. This allows you to create your ADF application with ready to use pom.xml which would handle all compiling, packaging and deploying tasks for you. Oracle has added two specific Maven plugins to automate the building process:

  1. ojmake - compiles your sources
  2. ojdeploy - old, good headless JDeveloper which packages your files and performs all necessary magic to make your ADF app run.

The problem with ojdeploy is that it is being invoked several times during building process which contributes significantly to overall building time. To solve this problem Oracle provided for us a service-like utility which is called ojserver. This command line tool should be started first with the following command:

<jdeveloper_home>/jdeveloper/jdev/bin/>ojserver -start

it starts listening on localhost:2010 (this can be changed through parameters) for build tasks flowing from ojdeploy, which this time should be invoked with two additional parameters:

-ojserver -address localhost:2010

so that brings us back to our pom.xml. In order to use that two parameters in your plugin configuration you should add them in the following way:


      <plugin>
        <groupId>com.oracle.adf.plugin</groupId>
        <artifactId>ojdeploy</artifactId>
        <version>12.1.2-0-0</version>
        <configuration>
          <ojdeploy>
            C:\Oracle\Middleware12c_Jdev\Oracle_Home\jdeveloper\jdev\bin\ojdeploy.exe
          </ojdeploy>
          <workspace>
            C:\JDeveloper\mywork\12c\Application3\Application3.jws
          </workspace>
          <profile>
            Application3_Project1_Application3
          </profile>
          <usemaven>true</usemaven>
<ojserver>true</ojserver>
          <address>localhost:2010</address>
          <nocompile>true</nocompile>
          <nodatasources>true</nodatasources>    
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

Using this approach during my tests I have managed to shorten the overall building time almost twice so this option is definitely worth considering. If you want to learn more about ojserver I recommend an interesting article available here.


Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Oracle ECEMEA Partner Hubs Migration Center Team

We share our skills to maximize your revenue!
Rapidly and successfully assist you to adopt and implement the latest of Oracle Technology in your solutions.

Stay Connected
partner.imc
@
beehiveonline.oracle-DOT-com
Google+

Search

Archives
« March 2015
SunMonTueWedThuFriSat
1
3
4
6
7
8
10
11
12
14
15
16
17
18
21
22
24
25
27
28
29
30
31
    
       
Today