Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#211 Support Java 17 and update build #263

Merged
merged 3 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
java-version: 17

- name: Build with Maven on Windows
if: matrix.os == 'windows-2019'
Expand All @@ -44,10 +45,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'temurin'
java-version: 17

- name: Build with Maven on Windows
if: matrix.os == 'windows-2019'
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ For more information, please visit the [EMF.cloud Website](https://www.eclipse.o

The following libraries/frameworks need to be installed on your system:

| | |
| ---------------------------------------------------------------------------- | --------- |
| [Java](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) | `11` |
| [Maven](https://maven.apache.org/) | `<=3.8.4` |
| | | |
| ---------------------------------------------------------------------------- | --------- | ------------------------------------------------ |
| [Java](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html) | `>= 11` | we support the two last LTS versions (11 and 17) |
| [Maven](https://maven.apache.org/) | `<=3.8.4` | |

_Remark:_ There is currently a build problem with the latest Maven version `3.8.5`, which causes a build error for the `p2` build. (See also issues #201 and will be investigated and fixed with issue #203).

Expand Down
2 changes: 1 addition & 1 deletion examples/org.eclipse.emfcloud.modelserver.example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<plugin>
<groupId>com.googlecode.addjars-maven-plugin</groupId>
<artifactId>addjars-maven-plugin</artifactId>
<version>1.0.5</version>
<version>${addjars.maven.version}</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
49 changes: 28 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,24 @@
<package.type>eclipse-plugin</package.type>
<package.type.test>eclipse-test-plugin</package.type.test>

<!-- Maven Plugin Versions: General maven plugin versions -->
<tycho.version>2.2.0</tycho.version>
<jacoco.version>0.8.6</jacoco.version>
<maven.compiler.version>3.8.1</maven.compiler.version>
<maven.clean.version>3.1.0</maven.clean.version>
<maven.checkstyle.version>3.1.1</maven.checkstyle.version>
<!-- Build Plugin Versions -->
<tycho.version>2.7.5</tycho.version>
<jacoco.version>0.8.8</jacoco.version>
<maven.compiler.version>3.10.1</maven.compiler.version>
<maven.clean.version>3.2.0</maven.clean.version>
<maven.checkstyle.version>3.2.0</maven.checkstyle.version>
<puppycrawl.checkstyle.version>8.44</puppycrawl.checkstyle.version>
<emfcloud.checkstyle.version>0.1.0-SNAPSHOT</emfcloud.checkstyle.version>
<maven.resources.version>3.2.0</maven.resources.version>
<maven.surefire.version>3.0.0-M5</maven.surefire.version>
<maven.failsafe.version>3.0.0-M5</maven.failsafe.version>
<maven.source.plugin>3.2.0</maven.source.plugin>
<maven.dependency.version>3.1.2</maven.dependency.version>
<maven.shade.version>3.2.4</maven.shade.version>
<maven.antrun.version>3.0.0</maven.antrun.version>
<maven.deploy.version>3.0.0-M1</maven.deploy.version>
<codehaus.mojo.maven.version>3.2.0</codehaus.mojo.maven.version>
<maven.surefire.version>3.0.0-M6</maven.surefire.version>
<maven.failsafe.version>3.0.0-M6</maven.failsafe.version>
<maven.source.plugin>3.2.1</maven.source.plugin>
<maven.dependency.version>3.3.0</maven.dependency.version>
<maven.shade.version>3.3.0</maven.shade.version>
<maven.antrun.version>3.1.0</maven.antrun.version>
<maven.deploy.version>3.0.0</maven.deploy.version>
<codehaus.mojo.maven.version>3.3.0</codehaus.mojo.maven.version>
<addjars.maven.version>1.0.5</addjars.maven.version>

<!-- Dependency Versions: Version of dependencies provided by the target
platform in p2. We try to match the p2-version if possible. -->
Expand All @@ -102,9 +103,10 @@
<emfjson.jackson.version>2.0.0</emfjson.jackson.version>
<commons.io.version>2.8.0</commons.io.version>
<junit.version>4.13.2</junit.version>
<mockito.core.version>2.23.0</mockito.core.version>
<hamcrest.core.version>1.3</hamcrest.core.version>
<maven.dependency.version>3.2.0</maven.dependency.version>
<mockito.version>4.8.1</mockito.version>
<hamcrest.version>2.2</hamcrest.version>
<net.bytebuddy.version>1.12.16</net.bytebuddy.version>
<org.objenesis.version>3.3</org.objenesis.version>
<json-patch.version>1.13</json-patch.version>

<!-- External Dependency Versions: Versions of dependencies that are not
Expand All @@ -118,7 +120,7 @@
<jetty.version>9.4.44.v20210927</jetty.version>
<jetty.websocket.version>9.4.44.v20210927</jetty.websocket.version>
<javalin.version>4.3.0</javalin.version>
<mockito.inline.version>3.2.4</mockito.inline.version>
<mockito.inline.version>4.8.1</mockito.inline.version>
<gmazzo.okhttp.mock.version>1.5.0</gmazzo.okhttp.mock.version>

<!-- Release Dependencies for M2 -->
Expand All @@ -139,6 +141,7 @@
<plugins>
<!-- Compilation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.version}</version>
</plugin>
Expand Down Expand Up @@ -275,7 +278,6 @@
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<includePackedArtifacts>true</includePackedArtifacts>
<targetDefinitionIncludeSource>honor</targetDefinitionIncludeSource>
<environments>
<environment>
Expand Down Expand Up @@ -482,12 +484,17 @@
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.core.version}</version>
<version>${mockito.version}</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>${mockito.version}</version>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>${hamcrest.core.version}</version>
<version>${hamcrest.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
Expand Down
5 changes: 3 additions & 2 deletions releng/org.eclipse.emfcloud.modelserver.releng.p2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
<appArgLine>-application org.eclipse.ant.core.antRunner -buildfile packaging-p2composite.ant p2.composite.add -Dsite.label=${p2.site.label} -Dproject.build.directory=${project.build.directory} -DunqualifiedVersion=${unqualifiedVersion} -DbuildQualifier=${buildQualifier} -Dsoftware.download.area=${rsync.local.dir}</appArgLine>
<repositories>
<repository>
<id>2021-06</id>
<id>2022-03</id>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this update here? and if it is needed why not update to 2022-12?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should reflect the actual used targetplatform application, which was not properly updated last time, I just aligned it here.

About 2022-12, we cannot update yet as with 2022-06 they removed Jetty 9 and switched entirely to Jetty 10. We should do this separately as this will be a rather big change (see also #234).
There is also an update regarding the maven plugin for the targetplatform, which is now more stable and got additional features, so I tend to go away from orbit then with the next update.

<layout>p2</layout>
<url>http://download.eclipse.org/releases/2021-06</url>
<url>http://download.eclipse.org/releases/2022-03</url>
</repository>
</repositories>
<dependencies>
Expand Down Expand Up @@ -121,6 +121,7 @@
</plugin>
<!-- Skip cleaning of this module otherwise the release build is not working on the jenkins instance -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven.clean.version}</version>
<configuration>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde?>
<!-- generated with https://github.com/eclipse-cbi/targetplatform-dsl -->
<target name="EMF.cloud Model Server Targetplatform" sequenceNumber="1651661937">
<target name="EMF.cloud Model Server Targetplatform" sequenceNumber="1673534083">
<locations>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.platform.feature.group" version="4.23.0.v20220308-0722"/>
<unit id="org.eclipse.emf.transaction.feature.group" version="1.12.0.201805140824"/>
<unit id="org.eclipse.emf.sdk.feature.group" version="2.29.0.v20220226-1304"/>
<repository location="http://download.eclipse.org/releases/2022-03"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="javax.servlet" version="3.1.0.v201410161800"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20220302172233/repository"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.apache.logging.log4j" version="2.17.1.v20220106-2156"/>
<unit id="com.google.gson" version="2.8.9.v20220111-1409"/>
<unit id="com.google.inject" version="5.0.1.v20210324-2015"/>
<unit id="com.google.guava" version="30.1.0.v20210127-2300"/>
<unit id="com.google.gson" version="2.9.1.v20220915-1632"/>
<unit id="com.google.inject" version="5.0.1.v20221112-0806"/>
<unit id="com.google.guava" version="30.1.0.v20221112-0806"/>
<unit id="org.apache.commons.io" version="2.8.0.v20210415-0900"/>
<unit id="org.mockito" version="2.23.0.v20200310-1642"/>
<unit id="net.bytebuddy.byte-buddy" version="1.9.0.v20181107-1410"/>
<unit id="net.bytebuddy.byte-buddy-agent" version="1.9.0.v20181106-1534"/>
<unit id="org.objenesis" version="2.6.0.v20180420-1519"/>
<unit id="org.hamcrest" version="1.1.0.v20090501071000"/>
<unit id="com.fasterxml.jackson.core.jackson-annotations" version="2.12.1.v20210128-1726"/>
<unit id="com.fasterxml.jackson.core.jackson-core" version="2.12.1.v20210128-1726"/>
<unit id="com.fasterxml.jackson.core.jackson-databind" version="2.12.1.v20210128-1726"/>
<unit id="org.mockito.mockito-core" version="4.8.1.v20221103-2317"/>
<unit id="net.bytebuddy.byte-buddy" version="1.12.18.v20221114-2102"/>
<unit id="net.bytebuddy.byte-buddy-agent" version="1.12.18.v20221114-2102"/>
<unit id="org.objenesis" version="3.3.0.v20221103-2317"/>
<unit id="com.fasterxml.jackson.core.jackson-annotations" version="2.13.2.v20220426-1653"/>
<unit id="com.fasterxml.jackson.core.jackson-core" version="2.13.2.v20220426-1653"/>
<unit id="com.fasterxml.jackson.core.jackson-databind" version="2.13.2.v20220426-1653"/>
<unit id="org.junit" version="4.13.2.v20211018-1956"/>
<unit id="javax.servlet" version="3.1.0.v201410161800"/>
<unit id="org.aopalliance" version="1.0.0.v201105210816"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20220302172233/repository"/>
<unit id="org.aopalliance" version="1.0.0.v20220404-1927"/>
<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20221123021534/repository"/>
</location>
<location includeMode="planner" includeAllPlatforms="false" includeSource="true" includeConfigurePhase="false" type="InstallableUnit">
<unit id="org.eclipse.emfcloud.emfjson-jackson" version="2.0.0"/>
Expand All @@ -39,4 +41,4 @@
<repository location="https://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.44.v20210927/"/>
</location>
</locations>
</target>
</target>
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,23 @@ location "http://download.eclipse.org/releases/2022-03" {
}

location "https://download.eclipse.org/tools/orbit/downloads/drops/R20220302172233/repository" {
javax.servlet [3.1.0,4.0.0)
}

location "https://download.eclipse.org/tools/orbit/downloads/drops/R20221123021534/repository" {
org.apache.logging.log4j [2.17.1,3.0.0)
com.google.gson [2.8.9,3.0.0)
com.google.inject [5.0.1,6.0.0)
com.google.guava [30.1.0,31.0.0)
org.apache.commons.io [2.8.0,3.0.0)
org.mockito [2.23.0,3.0.0)
net.bytebuddy.byte-buddy [1.9.0,2.0.0)
net.bytebuddy.byte-buddy-agent [1.9.0,2.0.0)
org.objenesis [2.6.0,3.0.0)
org.hamcrest [1.1.0,2.0.0)
org.mockito.mockito-core [4.8.1,5.0.0)
net.bytebuddy.byte-buddy [1.12.18,2.0.0)
net.bytebuddy.byte-buddy-agent [1.12.18,2.0.0)
org.objenesis [3.3.0,4.0.0)
com.fasterxml.jackson.core.jackson-annotations [2.12.1,3.0.0)
com.fasterxml.jackson.core.jackson-core [2.12.1,3.0.0)
com.fasterxml.jackson.core.jackson-databind [2.12.1,3.0.0)
org.junit [4.13.2,5.0.0)
javax.servlet [3.1.0,4.0.0)
org.aopalliance [1.0.0,2.0.0)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ Require-Bundle: com.fasterxml.jackson.core.jackson-annotations;bundle-version="[
org.eclipse.emfcloud.modelserver.tests;bundle-version="[0.7.0,1.0.0)",
org.eclipse.emfcloud.emfjson-jackson;bundle-version="[2.0.0,3.0.0)",
org.junit;bundle-version="[4.12.0,5.0.0)",
org.mockito;bundle-version="[2.23.0,3.0.0)",
org.mockito.mockito-core;bundle-version="[4.8.1,5.0.0)",
net.bytebuddy.byte-buddy;bundle-version="[1.9.0,2.0.0)",
net.bytebuddy.byte-buddy-agent;bundle-version="[1.9.0,2.0.0)",
org.objenesis;bundle-version="[2.6.0,3.0.0)",
org.hamcrest;bundle-version="[1.1.0,2.0.0)"
org.objenesis;bundle-version="[3.3.0,4.0.0)"
Bundle-ClassPath: .
Bundle-Vendor: EclipseSource
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ Require-Bundle: com.fasterxml.jackson.core.jackson-annotations;bundle-version="[
org.eclipse.emfcloud.emfjson-jackson;bundle-version="[2.0.0,3.0.0)",
org.junit;bundle-version="[4.12.0,5.0.0)"
Export-Package: org.eclipse.emfcloud.modelserver.edit
Import-Package: org.eclipse.emfcloud.modelserver.tests.util
Bundle-Vendor: EclipseSource
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Require-Bundle: com.fasterxml.jackson.core.jackson-annotations;bundle-version="[
org.eclipse.emfcloud.modelserver.tests;bundle-version="[0.7.0,1.0.0)",
org.eclipse.emfcloud.emfjson-jackson;bundle-version="[2.0.0,3.0.0)",
org.junit;bundle-version="[4.12.0,5.0.0)",
org.mockito;bundle-version="[2.23.0,3.0.0)",
org.objenesis;bundle-version="[2.6.0,3.0.0)"
org.mockito.mockito-core;bundle-version="[4.8.1,5.0.0)",
org.objenesis;bundle-version="[3.3.0,4.0.0)"
Import-Package: javax.inject;version="1.0.0",
org.apache.logging.log4j;version="[2.17.1,3.0.0)",
org.apache.logging.log4j.core;version="[2.17.1,3.0.0)",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2019-2022 EclipseSource and others.
* Copyright (c) 2019-2023 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand Down Expand Up @@ -39,6 +39,7 @@
import org.eclipse.emfcloud.modelserver.emf.configuration.ServerConfiguration;
import org.eclipse.emfcloud.modelserver.emf.util.JsonPatchHelper;
import org.eclipse.emfcloud.modelserver.jsonschema.Json;
import org.eclipse.emfcloud.modelserver.tests.util.MockitoUtil;
import org.eclipse.jetty.websocket.api.Session;
import org.hamcrest.CustomTypeSafeMatcher;
import org.hamcrest.Description;
Expand All @@ -48,7 +49,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.internal.util.reflection.FieldSetter;
import org.mockito.junit.MockitoJUnitRunner;

import com.fasterxml.jackson.databind.JsonNode;
Expand Down Expand Up @@ -235,7 +235,7 @@ private void initializeValidClientContext(final String sessionId) throws NoSuchF
when(validClientCtx.getSessionId()).thenReturn(sessionId);
when(validClientCtx.pathParam(ModelServerPathParametersV1.MODEL_URI)).thenReturn(modelUri);
Field sessionField = WsContext.class.getDeclaredField("session");
FieldSetter.setField(validClientCtx, sessionField, session);
MockitoUtil.setField(validClientCtx, sessionField, session);

when(codecs.findFormat(validClientCtx)).thenReturn(ModelServerPathParametersV1.FORMAT_JSON);

Expand All @@ -251,15 +251,15 @@ private void initializeWsMessageContext(final String sessionId) throws NoSuchFie
when(repository.hasModel(modelUri)).thenReturn(true);

Field sessionField = WsContext.class.getDeclaredField("session");
FieldSetter.setField(messageClientCtx, sessionField, session);
MockitoUtil.setField(messageClientCtx, sessionField, session);
}

@SuppressWarnings({ "checkstyle:ThrowsCount" })
private void initializeInvalidClientContext() throws NoSuchFieldException, SecurityException {
String modelUri = "tedioustesturi";

when(invalidClientCtx.pathParam(ModelServerPathParametersV1.MODEL_URI)).thenReturn(modelUri);
FieldSetter.setField(invalidClientCtx, WsContext.class.getDeclaredField("session"), session);
MockitoUtil.setField(invalidClientCtx, WsContext.class.getDeclaredField("session"), session);
}

@Before
Expand Down
6 changes: 4 additions & 2 deletions tests/org.eclipse.emfcloud.modelserver.tests/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="lib/mockito-inline-3.2.4.jar" sourcepath="lib/mockito-inline-3.2.4-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/okhttp-mock-1.5.0.jar" sourcepath="lib/okhttp-mock-1.5.0-sources.jar"/>
<classpathentry kind="src" path="src/">
<attributes>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="lib" path="lib/hamcrest-2.2.jar" sourcepath="lib/hamcrest-2.2-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/hamcrest-core-2.2.jar" sourcepath="lib/hamcrest-core-2.2-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/mockito-inline-4.8.1.jar" sourcepath="lib/mockito-inline-4.8.1-sources.jar"/>
<classpathentry exported="true" kind="lib" path="lib/okhttp-mock-1.5.0.jar" sourcepath="lib/okhttp-mock-1.5.0-sources.jar"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ Bundle-RequiredExecutionEnvironment: JavaSE-11
Require-Bundle: org.eclipse.emf.common;bundle-version="[2.17.0,3.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.20.0,3.0.0)",
org.eclipse.emf.edit;bundle-version="[2.16.0,3.0.0)",
org.eclipse.emfcloud.modelserver.lib;bundle-version="[0.7.0,1.0.0)",
org.hamcrest.library;bundle-version="[1.3.0,2.0.0)",
org.hamcrest.core;bundle-version="[1.3.0,2.0.0)"
org.eclipse.emfcloud.modelserver.lib;bundle-version="[0.7.0,1.0.0)"
Export-Package: okhttp3.mock,
okhttp3.mock.matchers,
org.eclipse.emfcloud.modelserver.tests.util
org.eclipse.emfcloud.modelserver.tests.util,
org.hamcrest
Bundle-ClassPath: .,
lib/mockito-inline-3.2.4.jar,
lib/hamcrest-2.2.jar,
lib/hamcrest-core-2.2.jar,
lib/mockito-inline-4.8.1.jar,
lib/okhttp-mock-1.5.0.jar
Bundle-Vendor: EclipseSource
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ source.. = src/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
lib/hamcrest-2.2.jar,\
lib/hamcrest-core-2.2.jar,\
lib/okhttp-mock-1.5.0.jar,\
lib/mockito-inline-3.2.4.jar
lib/mockito-inline-4.8.1.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading