Skip to content

Commit ddafdf6

Browse files
author
Tim Middleton
authored
Upgrade Coherence Demo to use Coherence CE (#13)
Upgrade Coherence Demo to use Coherence CE
1 parent fef8c32 commit ddafdf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1345
-632
lines changed

README.md

Lines changed: 159 additions & 301 deletions
Large diffs are not rendered by default.

pom.xml

Lines changed: 94 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -6,79 +6,88 @@
66

77
<groupId>com.oracle.coherence</groupId>
88
<artifactId>coherence-demo</artifactId>
9-
<version>3.0.1-SNAPSHOT</version>
9+
<version>4.0.0-SNAPSHOT</version>
1010

1111
<properties>
12+
<!-- The groupId of the Coherence product -->
13+
<coherence.group.id>com.oracle.coherence.ce</coherence.group.id>
14+
1215
<!-- dependency versions -->
1316
<bedrock.version>5.0.11</bedrock.version>
14-
<coherence.version>14.1.1-0-0</coherence.version>
17+
<coherence.version>14.1.1-0-1</coherence.version>
1518
<com.sun.xml.bind.version>2.3.0</com.sun.xml.bind.version>
19+
<copy.rename.maven.plugin.version>1.0</copy.rename.maven.plugin.version>
1620
<derby.version>10.14.2.0</derby.version>
21+
<docker.version>${project.version}</docker.version>
1722
<eclipselink.version>2.7.5</eclipselink.version>
1823
<jackson.version>2.10.1</jackson.version>
1924
<jaeger.version>1.1.0</jaeger.version>
2025
<jaxrs.version>2.1.6</jaxrs.version>
2126
<jersey.version>2.29</jersey.version>
2227
<javax.activation.version>1.2.0</javax.activation.version>
23-
<netty.version>4.1.32.Final</netty.version>
28+
<jib.version>2.3.0</jib.version>
29+
<jib.goal>dockerBuild</jib.goal>
30+
<netty.version>4.1.42.Final</netty.version>
2431
<opentracing.jdbc.version>0.2.10</opentracing.jdbc.version>
2532

2633
<!-- maven configuration -->
2734
<java.version>1.8</java.version>
28-
<maven.compiler.source>8</maven.compiler.source>
35+
<maven.assembly.plugin.version>3.0.0</maven.assembly.plugin.version>
36+
<maven.compiler.source>11</maven.compiler.source>
2937
<maven.compiler.target>8</maven.compiler.target>
30-
<maven.compiler.plugin.version>3.8.0</maven.compiler.plugin.version>
38+
<maven.compiler.release>8</maven.compiler.release>
39+
<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
3140
<maven.dependency.plugin.version>3.1.1</maven.dependency.plugin.version>
3241
<maven.enforcer.plugin.version>1.3.1</maven.enforcer.plugin.version>
3342
<maven.exec.plugin.version>1.6.0</maven.exec.plugin.version>
3443
<maven.gmaven.plugin.version>1.5</maven.gmaven.plugin.version>
35-
<maven.javadoc.plugin.version>3.1.0</maven.javadoc.plugin.version>
44+
<maven.javadoc.plugin.version>3.2.0</maven.javadoc.plugin.version>
3645
<maven.resources.plugin.version>3.1.0</maven.resources.plugin.version>
3746
<maven.shade.plugin.version>3.2.0</maven.shade.plugin.version>
3847
<maven.replacer.plugin.version>1.5.3</maven.replacer.plugin.version>
3948
<maven.source.plugin.version>2.1.2</maven.source.plugin.version>
40-
<maven.version>3.5.4</maven.version>
49+
<maven.version>3.6.0</maven.version>
4150
</properties>
4251

4352
<dependencies>
4453
<!-- coherence -->
4554
<dependency>
46-
<groupId>com.oracle.coherence</groupId>
55+
<groupId>${coherence.group.id}</groupId>
4756
<artifactId>coherence</artifactId>
4857
<version>${coherence.version}</version>
4958
</dependency>
5059

5160
<dependency>
52-
<groupId>com.oracle.toplink</groupId>
53-
<artifactId>coherence-jpa</artifactId>
61+
<groupId>${coherence.group.id}</groupId>
62+
<artifactId>coherence-management</artifactId>
5463
<version>${coherence.version}</version>
5564
</dependency>
56-
65+
5766
<dependency>
58-
<groupId>com.oracle.coherence</groupId>
59-
<artifactId>coherence-management</artifactId>
67+
<groupId>${coherence.group.id}</groupId>
68+
<artifactId>coherence-metrics</artifactId>
6069
<version>${coherence.version}</version>
6170
</dependency>
6271

6372
<dependency>
64-
<groupId>com.oracle.coherence</groupId>
73+
<groupId>${coherence.group.id}</groupId>
6574
<artifactId>coherence-rest</artifactId>
6675
<version>${coherence.version}</version>
6776
<exclusions>
6877
<exclusion>
69-
<groupId>com.oracle.coherence</groupId>
78+
<groupId>${coherence.group.id}</groupId>
7079
<artifactId>coherence</artifactId>
7180
</exclusion>
7281
</exclusions>
7382
</dependency>
7483

7584
<dependency>
76-
<groupId>com.oracle.coherence</groupId>
85+
<groupId>${coherence.group.id}</groupId>
7786
<artifactId>coherence-http-netty</artifactId>
7887
<version>${coherence.version}</version>
7988
<exclusions>
8089
<exclusion>
81-
<groupId>com.oracle.coherence</groupId>
90+
<groupId>${coherence.group.id}</groupId>
8291
<artifactId>coherence</artifactId>
8392
</exclusion>
8493
</exclusions>
@@ -369,25 +378,49 @@
369378
</build>
370379
</profile>
371380

372-
<!-- JDK8 specifics -->
373381
<profile>
374-
<id>javadoc-jdk18</id>
382+
<id>grid-edition</id>
375383
<activation>
376-
<jdk>1.8</jdk>
384+
<property>
385+
<name>grid-edition</name>
386+
</property>
377387
</activation>
388+
<properties>
389+
<coherence.group.id>com.oracle.coherence</coherence.group.id>
390+
</properties>
378391
<build>
379392
<plugins>
380-
<!-- attach javadoc -->
381393
<plugin>
382-
<groupId>org.apache.maven.plugins</groupId>
383-
<artifactId>maven-javadoc-plugin</artifactId>
384-
<version>${maven.javadoc.plugin.version}</version>
394+
<groupId>com.coderplus.maven.plugins</groupId>
395+
<artifactId>copy-rename-maven-plugin</artifactId>
396+
<version>${copy.rename.maven.plugin.version}</version>
385397
<executions>
386398
<execution>
387-
<id>attach-javadocs</id>
399+
<id>copy-and-rename-file</id>
400+
<phase>compile</phase>
388401
<goals>
389-
<goal>jar</goal>
402+
<goal>rename</goal>
390403
</goals>
404+
<configuration>
405+
<fileSets>
406+
<fileSet>
407+
<sourceFile>
408+
${project.build.directory}/classes/tangosol-coherence-override-grid-edition.xml
409+
</sourceFile>
410+
<destinationFile>
411+
${project.build.directory}/classes/tangosol-coherence-override.xml
412+
</destinationFile>
413+
</fileSet>
414+
<fileSet>
415+
<sourceFile>
416+
${project.build.directory}/classes/cache-config-grid-edition.xml
417+
</sourceFile>
418+
<destinationFile>
419+
${project.build.directory}/classes/cache-config.xml
420+
</destinationFile>
421+
</fileSet>
422+
</fileSets>
423+
</configuration>
391424
</execution>
392425
</executions>
393426
</plugin>
@@ -482,96 +515,52 @@
482515
<activation>
483516
<activeByDefault>false</activeByDefault>
484517
<property>
485-
<name>project.docker</name>
518+
<name>docker</name>
486519
</property>
487520
</activation>
488521

489522
<build>
490523
<plugins>
491-
<!-- make a jar with specific artifacts not found in Coherence docker image -->
492-
<plugin>
493-
<groupId>org.apache.maven.plugins</groupId>
494-
<artifactId>maven-shade-plugin</artifactId>
495-
<version>${maven.shade.plugin.version}</version>
496-
<executions>
497-
<execution>
498-
<phase>package</phase>
499-
<goals>
500-
<goal>shade</goal>
501-
</goals>
502-
<configuration>
503-
<artifactSet>
504-
<excludes>
505-
<exclude>com.oracle.coherence:coherence:*</exclude>
506-
</excludes>
507-
</artifactSet>
508-
</configuration>
509-
</execution>
510-
</executions>
511-
</plugin>
512-
513-
<!-- create docker directory -->
514524
<plugin>
515-
<groupId>org.apache.maven.plugins</groupId>
516-
<artifactId>maven-assembly-plugin</artifactId>
517-
<executions>
518-
<execution>
519-
<id>docker</id>
520-
<phase>package</phase>
521-
<goals>
522-
<goal>single</goal>
523-
</goals>
524-
<configuration>
525-
<finalName>docker</finalName>
526-
<appendAssemblyId>false</appendAssemblyId>
527-
<descriptors>
528-
<descriptor>src/assembly/image-assembly.xml</descriptor>
529-
</descriptors>
530-
</configuration>
531-
</execution>
532-
</executions>
533-
</plugin>
534-
535-
<!-- build docker image -->
536-
<plugin>
537-
<groupId>org.codehaus.mojo</groupId>
538-
<artifactId>exec-maven-plugin</artifactId>
539-
<version>${maven.exec.plugin.version}</version>
525+
<groupId>com.google.cloud.tools</groupId>
526+
<artifactId>jib-maven-plugin</artifactId>
527+
<version>${jib.version}</version>
528+
<configuration>
529+
<from>
530+
<image>gcr.io/distroless/java@sha256:f59b26c5ecc735514a38afbf845214383c4e2ba1fdd15a76225339b8ab7da8ef</image>
531+
</from>
532+
<to>
533+
<image>${project.artifactId}</image>
534+
<tags>
535+
<tag>${docker.version}</tag>
536+
</tags>
537+
</to>
538+
<container>
539+
<!-- good defaults intended for containers -->
540+
<jvmFlags>
541+
<jmxFlag>-server</jmxFlag>
542+
<jmxFlag>-Djava.awt.headless=true</jmxFlag>
543+
<jmxFlag>-XX:+UnlockExperimentalVMOptions</jmxFlag>
544+
<jmxFlag>-XX:+UseCGroupMemoryLimitForHeap</jmxFlag>
545+
<jmxFlag>-XX:InitialRAMFraction=2</jmxFlag>
546+
<jmxFlag>-XX:MinRAMFraction=2</jmxFlag>
547+
<jmxFlag>-XX:MaxRAMFraction=2</jmxFlag>
548+
<jmxFlag>-XX:+UseG1GC</jmxFlag>
549+
</jvmFlags>
550+
<mainClass>com.tangosol.net.DefaultCacheServer</mainClass>
551+
<ports>
552+
<port>8080</port>
553+
</ports>
554+
<creationTime>USE_CURRENT_TIMESTAMP</creationTime>
555+
</container>
556+
<containerizingMode>packaged</containerizingMode>
557+
</configuration>
540558
<executions>
541559
<execution>
542-
<id>build-utils-docker-image</id>
543-
<phase>package</phase>
544-
<configuration>
545-
<executable>docker</executable>
546-
<workingDirectory>${project.build.directory}/docker
547-
</workingDirectory>
548-
<arguments>
549-
<argument>build</argument>
550-
<argument>-t</argument>
551-
<argument>${project.artifactId}-sidecar:${project.version}</argument>
552-
<argument>.</argument>
553-
</arguments>
554-
</configuration>
555560
<goals>
556-
<goal>exec</goal>
561+
<goal>${jib.goal}</goal>
557562
</goals>
558-
</execution>
559-
<execution>
560-
<id>docker-tag</id>
561563
<phase>package</phase>
562-
<configuration>
563-
<executable>docker</executable>
564-
<workingDirectory>${project.build.directory}/docker
565-
</workingDirectory>
566-
<arguments>
567-
<argument>tag</argument>
568-
<argument>${project.artifactId}-sidecar:${project.version}</argument>
569-
<argument>${project.artifactId}-sidecar:latest</argument>
570-
</arguments>
571-
</configuration>
572-
<goals>
573-
<goal>exec</goal>
574-
</goals>
575564
</execution>
576565
</executions>
577566
</plugin>

src/assembly/image-assembly.xml

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/main/docker/Dockerfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

src/main/java/com/oracle/coherence/demo/application/AbstractClusterMemberResource.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/*
2+
* File: AbstractClusterMemberResource.java
3+
*
4+
* Copyright (c) 2015, 2020 Oracle and/or its affiliates.
5+
*
6+
* You may not use this file except in compliance with the Universal Permissive
7+
* License (UPL), Version 1.0 (the "License.")
8+
*
9+
* You may obtain a copy of the License at https://opensource.org/licenses/UPL.
10+
*
11+
* Unless required by applicable law or agreed to in writing, software distributed
12+
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
13+
* CONDITIONS OF ANY KIND, either express or implied.
14+
*
15+
* See the License for the specific language governing permissions and limitations
16+
* under the License.
17+
*/
18+
119
package com.oracle.coherence.demo.application;
220

321
import java.util.HashMap;

src/main/java/com/oracle/coherence/demo/application/ApplicationResourceConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* File: ApplicationResourceConfig.java
33
*
4-
* Copyright (c) 2015, 2016 Oracle and/or its affiliates.
4+
* Copyright (c) 2015, 2020 Oracle and/or its affiliates.
55
*
66
* You may not use this file except in compliance with the Universal Permissive
77
* License (UPL), Version 1.0 (the "License.")

0 commit comments

Comments
 (0)