Mavenize an Oracle ADF Application

To Mavenize an Oracle ADF Application first step would be to Setup Maven in Jdeveloper after this we Mavenize Oracle ADF Application .

Follow below steps to Setup Maven in Jdeveloper

1.> Navigate to Tools > Preferences > Maven > Settings

2.> Get user settings file path

- For me it is : C:\Users\username\.m2\settings.xml


3.> Navigate to path and modify settings file server tag as below

 <servers>
    <server>
    <id>maven.oracle.com</id>
    <username>OracleUserName</username>
    <password>OraclePwd</password>
    <configuration>
      <basicAuthScope>
        <host>ANY</host>
        <port>ANY</port>
        <realm>OAM 11g</realm>
      </basicAuthScope>
      <httpConfiguration>
        <all>
          <params>
            <property>
              <name>http.protocol.allow-circular-redirects</name>
              <value>%b,true</value>
            </property>
          </params>
        </all>
      </httpConfiguration>
    </configuration>
   </server>
  </servers>


Once above setups are done we can start with Mavenizing our ADF application.

4.> Create ADF application using JDeveloper.

5.> Once done go to File > New > from Gallery > General>Maven > Application POM



        This will generate a pom file which stores all your application level details and deployment information

6.> Below is how a sample Application pom file looks like

<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0">
  <modelVersion>4.0.0</modelVersion>
  <groupId>xxcom.test.scm</groupId>      -- Unique Group Id
  <artifactId>XxComTestApp</artifactId> -- Application Name
  <version>1.0</version>
  <description>Super POM for TestApp</description> -- Application Description
  <packaging>pom</packaging>
  <build>
    <resources>
      <resource>
        <directory>src/</directory>
        <includes>
          <include>**</include>
        </includes>
      </resource>
    </resources>
    <plugins>
      <plugin>
        <groupId>com.oracle.adf.plugin</groupId>
        <artifactId>ojmake</artifactId>
        <version>12.2.1-4-0</version>
        <configuration>
          <ojmake>
             ${oracleHome}/jdeveloper/jdev/bin/ojmake.exe    -- ojmake file path (Edit path accordingly)
          </ojmake>
          <files>
            ${basedir}/XxComTestApp.jws -- Application Jws name and path
          </files>
        </configuration>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>com.oracle.adf.plugin</groupId>
        <artifactId>ojdeploy</artifactId>
        <version>12.2.1-4-0</version>
        <configuration>
          <ojdeploy>
            ${oracleHome}/jdeveloper/jdev/bin/ojdeploy.exe -- ojdeploy file path (Edit path accordingly)
          </ojdeploy>
          <workspace>
            ${basedir}/XxComTestApp.jws -- Application Jws name and path
          </workspace>
          <profile>
            XxComTestApp -- Application deployment name
          </profile>
          <outputfile>
            ${project.build.directory}\${project.build.finalName}.ear -- Application Deployment file
          </outputfile>
        </configuration>
        <executions>
          <execution>
            <phase>package</phase>
            <goals>
              <goal>deploy</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    <plugin>
<groupId>com.oracle.weblogic</groupId>
<artifactId>weblogic-maven-plugin</artifactId>
<version>12.2.1-2-0</version>
<executions>
  <execution>
   <id>wls-deploy</id>
   <phase>pre-integration-test</phase>
   <goals>
<goal>redeploy</goal>
   </goals>
   <configuration>
<adminurl>t3://xxxxxx-xxxxxx.jcs.ocp.oraclecloud.com:9071</adminurl>
<user>weblogic</user>
<password>xxxxxx</password>
<source>${project.build.directory}/${project.build.finalName}.ear</source>
<targets>dvp_cluster</targets>
<verbose>true</verbose>
<remote>true</remote>
<upload>true</upload>
<name>${project.build.finalName}</name>
   </configuration>
  </execution>
</executions>
</plugin>
    </plugins>
  </build>
  <parent>
    <groupId>com.oracle.adf</groupId>
    <artifactId>adf-parent</artifactId>
    <version>12.2.1-4-0</version>
    <relativePath></relativePath>
  </parent>
  <repositories>
    <repository>
      <name>OracleMaven</name>
      <id>maven.oracle.com</id>
      <url>https://maven.oracle.com</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <name>OracleMaven</name>
      <id>maven.oracle.com</id>
      <url>https://maven.oracle.com</url>
    </pluginRepository>
  </pluginRepositories>
</project>

7.> Once this is done you can Run Maven Package command to test and generate deployment file 






Comments

Popular posts from this blog

Creating Column Filter on a VBCS Table using ListDataProvider(LDP)

Creating Dynamic Tabs in VBCS