Skip to content

Commit

Permalink
Upgrade Coherence Demo to use Coherence CE (#13)
Browse files Browse the repository at this point in the history
Upgrade Coherence Demo to use Coherence CE
  • Loading branch information
tmiddlet2666 authored Jun 23, 2020
1 parent fef8c32 commit ddafdf6
Show file tree
Hide file tree
Showing 43 changed files with 1,345 additions and 632 deletions.
460 changes: 159 additions & 301 deletions README.md

Large diffs are not rendered by default.

199 changes: 94 additions & 105 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,79 +6,88 @@

<groupId>com.oracle.coherence</groupId>
<artifactId>coherence-demo</artifactId>
<version>3.0.1-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>

<properties>
<!-- The groupId of the Coherence product -->
<coherence.group.id>com.oracle.coherence.ce</coherence.group.id>

<!-- dependency versions -->
<bedrock.version>5.0.11</bedrock.version>
<coherence.version>14.1.1-0-0</coherence.version>
<coherence.version>14.1.1-0-1</coherence.version>
<com.sun.xml.bind.version>2.3.0</com.sun.xml.bind.version>
<copy.rename.maven.plugin.version>1.0</copy.rename.maven.plugin.version>
<derby.version>10.14.2.0</derby.version>
<docker.version>${project.version}</docker.version>
<eclipselink.version>2.7.5</eclipselink.version>
<jackson.version>2.10.1</jackson.version>
<jaeger.version>1.1.0</jaeger.version>
<jaxrs.version>2.1.6</jaxrs.version>
<jersey.version>2.29</jersey.version>
<javax.activation.version>1.2.0</javax.activation.version>
<netty.version>4.1.32.Final</netty.version>
<jib.version>2.3.0</jib.version>
<jib.goal>dockerBuild</jib.goal>
<netty.version>4.1.42.Final</netty.version>
<opentracing.jdbc.version>0.2.10</opentracing.jdbc.version>

<!-- maven configuration -->
<java.version>1.8</java.version>
<maven.compiler.source>8</maven.compiler.source>
<maven.assembly.plugin.version>3.0.0</maven.assembly.plugin.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<maven.compiler.plugin.version>3.8.0</maven.compiler.plugin.version>
<maven.compiler.release>8</maven.compiler.release>
<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
<maven.dependency.plugin.version>3.1.1</maven.dependency.plugin.version>
<maven.enforcer.plugin.version>1.3.1</maven.enforcer.plugin.version>
<maven.exec.plugin.version>1.6.0</maven.exec.plugin.version>
<maven.gmaven.plugin.version>1.5</maven.gmaven.plugin.version>
<maven.javadoc.plugin.version>3.1.0</maven.javadoc.plugin.version>
<maven.javadoc.plugin.version>3.2.0</maven.javadoc.plugin.version>
<maven.resources.plugin.version>3.1.0</maven.resources.plugin.version>
<maven.shade.plugin.version>3.2.0</maven.shade.plugin.version>
<maven.replacer.plugin.version>1.5.3</maven.replacer.plugin.version>
<maven.source.plugin.version>2.1.2</maven.source.plugin.version>
<maven.version>3.5.4</maven.version>
<maven.version>3.6.0</maven.version>
</properties>

<dependencies>
<!-- coherence -->
<dependency>
<groupId>com.oracle.coherence</groupId>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence</artifactId>
<version>${coherence.version}</version>
</dependency>

<dependency>
<groupId>com.oracle.toplink</groupId>
<artifactId>coherence-jpa</artifactId>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence-management</artifactId>
<version>${coherence.version}</version>
</dependency>

<dependency>
<groupId>com.oracle.coherence</groupId>
<artifactId>coherence-management</artifactId>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence-metrics</artifactId>
<version>${coherence.version}</version>
</dependency>

<dependency>
<groupId>com.oracle.coherence</groupId>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence-rest</artifactId>
<version>${coherence.version}</version>
<exclusions>
<exclusion>
<groupId>com.oracle.coherence</groupId>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>com.oracle.coherence</groupId>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence-http-netty</artifactId>
<version>${coherence.version}</version>
<exclusions>
<exclusion>
<groupId>com.oracle.coherence</groupId>
<groupId>${coherence.group.id}</groupId>
<artifactId>coherence</artifactId>
</exclusion>
</exclusions>
Expand Down Expand Up @@ -369,25 +378,49 @@
</build>
</profile>

<!-- JDK8 specifics -->
<profile>
<id>javadoc-jdk18</id>
<id>grid-edition</id>
<activation>
<jdk>1.8</jdk>
<property>
<name>grid-edition</name>
</property>
</activation>
<properties>
<coherence.group.id>com.oracle.coherence</coherence.group.id>
</properties>
<build>
<plugins>
<!-- attach javadoc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin.version}</version>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>${copy.rename.maven.plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<id>copy-and-rename-file</id>
<phase>compile</phase>
<goals>
<goal>jar</goal>
<goal>rename</goal>
</goals>
<configuration>
<fileSets>
<fileSet>
<sourceFile>
${project.build.directory}/classes/tangosol-coherence-override-grid-edition.xml
</sourceFile>
<destinationFile>
${project.build.directory}/classes/tangosol-coherence-override.xml
</destinationFile>
</fileSet>
<fileSet>
<sourceFile>
${project.build.directory}/classes/cache-config-grid-edition.xml
</sourceFile>
<destinationFile>
${project.build.directory}/classes/cache-config.xml
</destinationFile>
</fileSet>
</fileSets>
</configuration>
</execution>
</executions>
</plugin>
Expand Down Expand Up @@ -482,96 +515,52 @@
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>project.docker</name>
<name>docker</name>
</property>
</activation>

<build>
<plugins>
<!-- make a jar with specific artifacts not found in Coherence docker image -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>${maven.shade.plugin.version}</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<excludes>
<exclude>com.oracle.coherence:coherence:*</exclude>
</excludes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>

<!-- create docker directory -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>docker</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>docker</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/image-assembly.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>

<!-- build docker image -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>${maven.exec.plugin.version}</version>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<version>${jib.version}</version>
<configuration>
<from>
<image>gcr.io/distroless/java@sha256:f59b26c5ecc735514a38afbf845214383c4e2ba1fdd15a76225339b8ab7da8ef</image>
</from>
<to>
<image>${project.artifactId}</image>
<tags>
<tag>${docker.version}</tag>
</tags>
</to>
<container>
<!-- good defaults intended for containers -->
<jvmFlags>
<jmxFlag>-server</jmxFlag>
<jmxFlag>-Djava.awt.headless=true</jmxFlag>
<jmxFlag>-XX:+UnlockExperimentalVMOptions</jmxFlag>
<jmxFlag>-XX:+UseCGroupMemoryLimitForHeap</jmxFlag>
<jmxFlag>-XX:InitialRAMFraction=2</jmxFlag>
<jmxFlag>-XX:MinRAMFraction=2</jmxFlag>
<jmxFlag>-XX:MaxRAMFraction=2</jmxFlag>
<jmxFlag>-XX:+UseG1GC</jmxFlag>
</jvmFlags>
<mainClass>com.tangosol.net.DefaultCacheServer</mainClass>
<ports>
<port>8080</port>
</ports>
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
</container>
<containerizingMode>packaged</containerizingMode>
</configuration>
<executions>
<execution>
<id>build-utils-docker-image</id>
<phase>package</phase>
<configuration>
<executable>docker</executable>
<workingDirectory>${project.build.directory}/docker
</workingDirectory>
<arguments>
<argument>build</argument>
<argument>-t</argument>
<argument>${project.artifactId}-sidecar:${project.version}</argument>
<argument>.</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
<goal>${jib.goal}</goal>
</goals>
</execution>
<execution>
<id>docker-tag</id>
<phase>package</phase>
<configuration>
<executable>docker</executable>
<workingDirectory>${project.build.directory}/docker
</workingDirectory>
<arguments>
<argument>tag</argument>
<argument>${project.artifactId}-sidecar:${project.version}</argument>
<argument>${project.artifactId}-sidecar:latest</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
Expand Down
43 changes: 0 additions & 43 deletions src/assembly/image-assembly.xml

This file was deleted.

22 changes: 0 additions & 22 deletions src/main/docker/Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/*
* File: AbstractClusterMemberResource.java
*
* Copyright (c) 2015, 2020 Oracle and/or its affiliates.
*
* You may not use this file except in compliance with the Universal Permissive
* License (UPL), Version 1.0 (the "License.")
*
* You may obtain a copy of the License at https://opensource.org/licenses/UPL.
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied.
*
* See the License for the specific language governing permissions and limitations
* under the License.
*/

package com.oracle.coherence.demo.application;

import java.util.HashMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* File: ApplicationResourceConfig.java
*
* Copyright (c) 2015, 2016 Oracle and/or its affiliates.
* Copyright (c) 2015, 2020 Oracle and/or its affiliates.
*
* You may not use this file except in compliance with the Universal Permissive
* License (UPL), Version 1.0 (the "License.")
Expand Down
Loading

0 comments on commit ddafdf6

Please sign in to comment.