From 119e38c0895bf9234955e7df62eb26aca2b7346d Mon Sep 17 00:00:00 2001 From: Emmanuel Bruno <emmanuel.bruno@univ-tln.fr> Date: Wed, 7 Apr 2021 11:44:26 +0200 Subject: [PATCH] upgrades jdk & mvn versions. --- mvn.sh | 2 +- pom.xml | 22 ++++++++++++++++--- queries/sample-requests.rest | 4 ++++ .../jaxrs/resources/LibraryResource.java | 1 + .../univtln/bruno/samples/jaxrs/ServerIT.java | 2 +- 5 files changed, 26 insertions(+), 5 deletions(-) diff --git a/mvn.sh b/mvn.sh index a3a0c08..5d5927e 100755 --- a/mvn.sh +++ b/mvn.sh @@ -13,5 +13,5 @@ docker run \ --rm \ --env PUID="$(id -u)" -e PGID="$(id -g)" \ --env MAVEN_CONFIG=/var/maven/.m2 \ - brunoe/maven:3.6.3-jdk-15 \ + brunoe/maven:3.8.1-jdk-16 \ runuser --user user --group user -- mvn -B -e -T 1C -Duser.home=/var/maven --settings /usr/src/mymaven/.github/ci-settings.xml "$@" \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7665a36..832730b 100644 --- a/pom.xml +++ b/pom.xml @@ -31,6 +31,21 @@ <type>pom</type> <scope>import</scope> </dependency> + <dependency> + <groupId>com.sun.activation</groupId> + <artifactId>jakarta.activation</artifactId> + <version>2.0.1</version> + </dependency> + <dependency> + <groupId>com.sun.istack</groupId> + <artifactId>istack-commons-runtime</artifactId> + <version>4.0.1</version> + </dependency> + <dependency> + <groupId>jakarta.activation</groupId> + <artifactId>jakarta.activation-api</artifactId> + <version>2.0.1</version> + </dependency> </dependencies> </dependencyManagement> <dependencies> @@ -61,6 +76,7 @@ <version>3.0.0</version> <scope>runtime</scope> </dependency> + <!--dependency> <groupId>org.eclipse.persistence</groupId> <artifactId>org.eclipse.persistence.moxy</artifactId> @@ -139,14 +155,14 @@ <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> - <version>4.13.1</version> + <version>4.13.2</version> <scope>test</scope> </dependency> <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> - <version>3.11</version> + <version>3.12.0</version> <scope>test</scope> </dependency> @@ -340,7 +356,7 @@ <version>3.5.4</version> </requireMavenVersion> <requireJavaVersion> - <version>15</version> + <version>16</version> </requireJavaVersion> <DependencyConvergence /> </rules> diff --git a/queries/sample-requests.rest b/queries/sample-requests.rest index 2c2e223..37e8f6a 100644 --- a/queries/sample-requests.rest +++ b/queries/sample-requests.rest @@ -1,4 +1,8 @@ ### Get a Hello message +GET http://localhost:9998/mylibrary/library/hello +Accept: text/plain + +### Get the whole library GET http://localhost:9998/mylibrary/library ### Init the database with two authors diff --git a/src/main/java/fr/univtln/bruno/samples/jaxrs/resources/LibraryResource.java b/src/main/java/fr/univtln/bruno/samples/jaxrs/resources/LibraryResource.java index 9da6dbd..a6eaaf0 100644 --- a/src/main/java/fr/univtln/bruno/samples/jaxrs/resources/LibraryResource.java +++ b/src/main/java/fr/univtln/bruno/samples/jaxrs/resources/LibraryResource.java @@ -30,6 +30,7 @@ public class LibraryResource { */ @SuppressWarnings("SameReturnValue") @GET + @Path("hello") @Produces(MediaType.TEXT_PLAIN) public String sayHello() { return "hello"; diff --git a/src/test/java/fr/univtln/bruno/samples/jaxrs/ServerIT.java b/src/test/java/fr/univtln/bruno/samples/jaxrs/ServerIT.java index 093b4cf..56244e5 100644 --- a/src/test/java/fr/univtln/bruno/samples/jaxrs/ServerIT.java +++ b/src/test/java/fr/univtln/bruno/samples/jaxrs/ServerIT.java @@ -75,7 +75,7 @@ public class ServerIT { @Test public void testHello() { - String hello = webTarget.path("library").request(MediaType.TEXT_PLAIN).get(String.class); + String hello = webTarget.path("library/hello").request(MediaType.TEXT_PLAIN).get(String.class); assertEquals("hello", hello); } -- GitLab