GoldenGate for Java is not installed in a public Maven repository.
How do I set up my Maven build environment to handle the GoldenGate libraries?
GoldenGate for Java is not installed in a public Maven repository.
How do I set up my Maven build environment to handle the GoldenGate libraries?
These libraries require a click-through license agreement and can be downloaded here:
http://www.oracle.com/technetwork/middleware/goldengate/downloads/index.html
You need the Oracle GoldenGate Application Adapters
for whichever platform you're working on. The commands below assumes you've downloaded the file ggs_Adapters_Linux_x64.zip
, version 12.2.0.1. Adjust your version numbers accordingly.
First, extract the required files:
jar xvf ggs_Adapters_Linux_x64.zip ggs_Adapters_Linux_x64.tar
tar -zxvf ggs_Adapters_Linux_x64.tar ggjava/resources/lib/*
Then, use the install-plugin
to install three jar files and set the version and group information appropriately.
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=ggjava/resources/lib/ggdbutil-12.2.0.1.0.012.jar -DgroupId=com.oracle.goldengate -DartifactId=ggdbutil -Dversion=12.2.0.1.0.012 -Dpackaging=jar
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=ggjava/resources/lib/gguserexitapi-12.2.0.1.0.012.jar -DgroupId=com.oracle.goldengate -DartifactId=gguserexitapi -Dversion=12.2.0.1.0.012 -Dpackaging=jar
mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -Dfile=ggjava/resources/lib/ggutil-12.2.0.1.0.012.jar -DgroupId=com.oracle.goldengate -DartifactId=ggutil -Dversion=12.2.0.1.0.012 -Dpackaging=jar
To your pom.xml, add this property:
<properties>
<goldengate.version>12.2.0.1.0.012</goldengate.version>
</properties>
and these dependencies:
<dependency>
<groupId>com.oracle.goldengate</groupId>
<artifactId>ggdbutil</artifactId>
<version>${goldengate.version}</version>
</dependency>
<dependency>
<groupId>com.oracle.goldengate</groupId>
<artifactId>gguserexitapi</artifactId>
<version>${goldengate.version}</version>
</dependency>
<dependency>
<groupId>com.oracle.goldengate</groupId>
<artifactId>ggutil</artifactId>
<version>${goldengate.version}</version>
</dependency>
You can install them manually like Mark Harrison suggests but that'll only get them to your local repository. If you're going to use that codebase with other people and want to avoid everyone to have to do the same you have to options:
First and recommended, install a maven repository manager such as Nexus or Artifactory and push the jars there. Once there, you just have to configure your local ~/.m2/settings.xml to pull artifacts from your repo manager. The settings would look something like this:
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<profiles>
<profile>
<repositories>
<repository>
<id>repo</id>
<name>repo</name>
<url>https://some.host.com/artifactory/repo</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>plugin-repo</id>
<name>plugin-repo</name>
<url>https://some.host.com/artifactory/repo</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
<servers>
<server>
<id>artifactory</id>
<username>user</username>
<password>pass</password>
</server>
</servers>
</settings>
Worth to mention, this is a one time only per env configuration, against having to install every 3rd party jar you use every time you incorporate one to your project. With this approach, when you have a new 3rd party jar, you just deploy it to the repo manager, through their Web UI, or with a command:
mvn deploy:deploy-file -DgroupId=<group-id> \
-DartifactId=<artifact-id> \
-Dversion=<version> \
-Dpackaging=<type-of-packaging> \
-Dfile=<path-to-file> \
-DrepositoryId=<id-to-map-on-server-section-of-settings.xml> \
-Durl=<url-of-the-repository-to-deploy>
(more details here https://maven.apache.org/guides/mini/guide-3rd-party-jars-remote.html)
The Second Approach, would be to simply add the dependencies pointing to a relative path from where the pom.xml is, like this:
<dependency>
<artifactId>..</artifactId>
<groupId>..</groupId>
<scope>system</scope>
<systemPath>${basedir}/lib/dependency.jar</systemPath>
</dependency>
The rationale behind preferring this instead of the install is again conveniency for everyone sharing this code base. You just simply upload the jar to your code repo with the dependency pointing to that location, an no one has to install/run anything to get the project compiling.