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
<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.2Access 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
No comments:
Post a Comment