Thursday, December 10, 2020

Oracle Maven Configuration

 Recently a acustomer asked me to Build a Continuous Integration Environment step by step.

In the past I've done something similar using ant and maven but this time I'd like to produce a guide.

Installation

Maven is a Java based tool, so the very first requirement is to have JDK installed on your machine. 

JDK Installation

Provide to install jdk 1.8.x version and setup variables, in the end the command "java -version" have to run and you have to set up JAVA_HOME environment variable

Maven Installation

Download Maven from apache site and provide to install following official maven instructions. Additionally you can setup this environment variables (Following I will describe using linux sintax):
  • MAVEN_HOME = <path to the installation folder (/opt/apache/maven/3.6.3)>
  • MAVEN = $MAVEN_HOME\bin
  • PATH = $PATH:$MAVEN
To verfy Maven installation run: mvn --verson
You can create also a variable to map the repository path and java options:
  • MAVEN_REPO = <reposiroty path (/opt/apache/maven/repository)>
  • MAVEN_OPS = -Xmx2048m -Xms1024m -XX:MaxPermSize=512m -Djava.awt.headless=true
To setup local repository we need to modify $MAVEN_HOME/conf/settings.xml file adding localRepository element at the beginning:

<settings ....>
  <localRepository>/opt/apache/maven/repository</localRepository>
  ...
  ...
</settings>

Configuration

To configure oracle repository server and profile on your maven settings file you can follow these official links. Each link is refferred to the Middleware version in use:
Documentation steps are very similar for each version, using 12.2.1.4 release additionally you need to follow Doc ID 2714468.1 directive (patching, commands and goes on).

In my case, customer use 12.2.1.2 Middleware Version and I will follow 12.2.1.2 steps.

ORACLE_HOME

Open a shell and fix the oracle home to the jdeveloper installation:

ORACLE_HOME = /opt/oracle/Middleware/jdeveloper/12.2.1.2

Access the Oracle Maven Repository

To access the Oracle Maven Repository, you must first register for access on Oracle Technology Network.

The registration application is located at:


This application displays the license agreement for access to the Oracle Maven Repository. You must accept the license agreement to access the Oracle Maven Repository.

Adding the Oracle Maven Repository

Open $MAVEN_HOME/conf/settings.xml file and setup the repository:

	<repositories>
	  <repository>
		<id>maven.oracle.com</id>
		<releases>
		  <enabled>true</enabled>
		</releases>
		<snapshots>
		  <enabled>false</enabled>
		</snapshots>
		<url>https://maven.oracle.com</url>
		<layout>default</layout>
	  </repository>
	</repositories>
	<pluginRepositories>
	  <pluginRepository>
		<id>maven.oracle.com</id>
		<url>https://maven.oracle.com</url>
	  </pluginRepository>
	</pluginRepositories>

Configuring the HTTP Wagon

Using latest Maven release, open $MAVEN_HOME/conf/settings.xml file and configure server wagon to connect to OPT:

	<servers>
            <server>
		<id>maven.oracle.com</id>
		<username>YOUR Oracle OTP User</username>
		<password>YOUR Oracle OTP password</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>    

Add a profile

Open $MAVEN_HOME/conf/settings.xml file and setup a profile as follow:

  <profiles>
      <profile>
      <id>maven.oracle.com</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>maven.oracle.com</id>
          <url>https://maven.oracle.com</url>
          <layout>default</layout>
          <releases>
            <enabled>true</enabled>
          </releases>
        </repository>
      </repositories>
    </profile>
</profiles>

Setup Proxy (if you need)


  <proxies>
    <proxy>
      <id>MyProxy</id>
      <active>true</active>
      <protocol>http</protocol>
      <username>YOUR PROXY USER</username>
      <password>YOUR PROXY USER PASSWORD</password>
      <host>PROXY HOST</host>
      <port>PROXY PORT</port>
      <nonProxyHosts>127.0.0.1|localhost| OTHER PROXY EXCLUSIONS</nonProxyHosts>
    </proxy>
 </proxies>

Synchronization Plug-In


The plug-in is located in your Oracle WebLogic Server 12c home and consists of two files:

  • The Maven Project Object Model (POM) file, which describes the plug-in. It is located at:

    ORACLE_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.2.1/oracle-maven-sync-12.2.1.pom
    
  • The JAR file, which contains the plug-in. It is located at:

    ORACLE_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.2.1/oracle-maven-sync-12.2.1.jar

Install and deploy the plug-in

from the ORACLE_HOME/oracle_common/plugins/maven/com/oracle/maven/oracle-maven-sync/12.2.1 run:

mvn install:install-file -DpomFile=oracle-mave
n-sync-12.2.1.pom -Dfile=oracle-maven-sync-12.2.1.jar

Oracle Maven Synchronization Plug-In

Run the followiong command:

mvn help:describe -Dplugin=com.oracle.maven:oracle-maven-sync -Ddetail




Wednesday, December 2, 2020

JMeter an Oracle ADF 12c Test Load Tests

 JMeter is a usefull opensource product that you can use to test everything runs on the web: web application, web services and goes on.

 You can user this ool to perform load tests, discover application issue and provide a fix or be ensure that everything it's ok.

Thursday, October 15, 2020

Weblogic EJB Remote Call: referencing Bean form a java class

Recently, working on a customer project, needs to call a Custom EJB by a common java class. Both (java class and ejb) are deploied on weblogic into a jar shared library that represents the ejb module to include into an application.

Thursday, July 23, 2020

Oracle MFT 12c verbose log on ftp trasnfert

Product: Oracle Managed File Transfer 12c

Set TRACE:32 for a verbose log, from EM console -> mft server
On following classes/package:

oracle.mft.ENGINE
oracle.mft.SECURITY
oracle.mft.TRANSPORT
oracle.mft.adapter (make sure all sub-levels are set to Inherited)

Go to SOA Infrastructure and set the following loggers to TRACE:32:

oracle.soa -> oracle.soa.adapter:
-> oracle.soa.adapter.file
-> oracle.soa.adapter.ftp


On restart it will return on default setup if you don't specify to make permanent the log level.

Monday, July 13, 2020

Java locale settings

At this link you can find a usefull article that explaayn how to set local in a java applciation.
It Is possible enforce locale settings on JVM startup adding followiong parameters

java -Duser.language=fr -Duser.country=CA Default

Using weblogic you can add this parameters on server startup as follow: