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

Migrate to Quarkus 3 and Java 17 #23

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion devfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ components:
id: redhat/vscode-openshift-connector/latest
- type: dockerimage
alias: maven
image: 'registry.redhat.io/codeready-workspaces/plugin-java11-rhel8@sha256:641e223f5efbc32bab3461aa000e3a50a5dcca063331322158d1c959129ffd99'
image: 'registry.redhat.io/devspaces/udi-rhel8@sha256:b1f112760b2640b5e8612869536a000612837e8e247c74d3d99e9fcfbc56d2f3'
env:
- name: JAVA_OPTS
value: '-XX:MaxRAMPercentage=50.0 -XX:+UseParallelGC -XX:MinHeapFreeRatio=10 -XX:MaxHeapFreeRatio=20 -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xms20m -Djava.security.egd=file:/dev/./urandom -Duser.home=/home/jboss'
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
<artifactId>quarkus-petclinic</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<compiler-plugin.version>3.12.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>2.16.0.Final</quarkus.platform.version>
<surefire-plugin.version>2.22.1</surefire-plugin.version>
<quarkus.platform.version>3.8.2</quarkus.platform.version>
<surefire-plugin.version>3.2.3</surefire-plugin.version>
<webjars-bootstrap.version>5.1.3</webjars-bootstrap.version>
<webjars-font-awesome.version>4.7.0</webjars-font-awesome.version>
</properties>
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/Dockerfile.fast-jar
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
###
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3

ARG JAVA_PACKAGE=java-11-openjdk-headless
ARG JAVA_PACKAGE=java-17-openjdk-headless
ARG RUN_JAVA_VERSION=1.3.8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
# Install java and the run-java script
Expand Down
2 changes: 1 addition & 1 deletion src/main/docker/Dockerfile.jvm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
###
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.3

ARG JAVA_PACKAGE=java-11-openjdk-headless
ARG JAVA_PACKAGE=java-17-openjdk-headless
ARG RUN_JAVA_VERSION=1.3.8
ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en'
# Install java and the run-java script
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.quarkus.samples.petclinic;

import io.smallrye.common.annotation.Blocking;
import javax.ws.rs.core.Application;
import jakarta.ws.rs.core.Application;

/**
* Used to ensure that all endpoints are blocking by default
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/quarkus/samples/petclinic/model/Person.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.quarkus.samples.petclinic.model;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.validation.constraints.NotEmpty;
import javax.ws.rs.FormParam;
import jakarta.persistence.Column;
import jakarta.persistence.MappedSuperclass;
import jakarta.validation.constraints.NotEmpty;
import jakarta.ws.rs.FormParam;

import io.quarkus.hibernate.orm.panache.PanacheEntity;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.time.LocalDate;

import javax.ws.rs.ext.ParamConverter;
import jakarta.ws.rs.ext.ParamConverter;

public class LocalDateConverter implements ParamConverter<LocalDate> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.quarkus.samples.petclinic.owner;

import javax.ws.rs.ext.ParamConverter;
import javax.ws.rs.ext.ParamConverterProvider;
import javax.ws.rs.ext.Provider;
import jakarta.ws.rs.ext.ParamConverter;
import jakarta.ws.rs.ext.ParamConverterProvider;
import jakarta.ws.rs.ext.Provider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.time.LocalDate;
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/org/quarkus/samples/petclinic/owner/Owner.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotEmpty;
import javax.ws.rs.FormParam;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.OneToMany;
import jakarta.persistence.Table;
import jakarta.validation.constraints.Digits;
import jakarta.validation.constraints.NotEmpty;
import jakarta.ws.rs.FormParam;

import org.quarkus.samples.petclinic.model.Person;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.quarkus.samples.petclinic.owner;

import javax.ws.rs.FormParam;
import jakarta.ws.rs.FormParam;

public class OwnerForm {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
import java.util.Map;
import java.util.Set;

import javax.inject.Inject;
import javax.transaction.Transactional;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import javax.ws.rs.BeanParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import jakarta.inject.Inject;
import jakarta.transaction.Transactional;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validator;
import jakarta.ws.rs.BeanParam;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.QueryParam;
import jakarta.ws.rs.core.MediaType;

import io.quarkus.qute.TemplateInstance;

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/org/quarkus/samples/petclinic/owner/Pet.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;
import jakarta.validation.constraints.NotEmpty;

import org.quarkus.samples.petclinic.visit.Visit;

Expand Down
22 changes: 11 additions & 11 deletions src/main/java/org/quarkus/samples/petclinic/owner/PetResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
import java.util.Map;
import java.util.Set;

import javax.inject.Inject;
import javax.transaction.Transactional;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import javax.ws.rs.FormParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import jakarta.inject.Inject;
import jakarta.transaction.Transactional;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validator;
import jakarta.ws.rs.FormParam;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

import io.quarkus.qute.TemplateInstance;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;

import io.quarkus.hibernate.orm.panache.PanacheEntity;
import io.quarkus.qute.TemplateExtension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
import java.util.Map;
import java.util.Set;

import javax.inject.Inject;
import javax.transaction.Transactional;
import javax.validation.ConstraintViolation;
import javax.validation.Validator;
import javax.ws.rs.BeanParam;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import jakarta.inject.Inject;
import jakarta.transaction.Transactional;
import jakarta.validation.ConstraintViolation;
import jakarta.validation.Validator;
import jakarta.ws.rs.BeanParam;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.PathParam;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

import io.quarkus.qute.TemplateInstance;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.quarkus.samples.petclinic.system;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/oups")
public class CrashResource {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.quarkus.samples.petclinic.system;

import javax.inject.Inject;
import javax.ws.rs.core.Response;
import jakarta.inject.Inject;
import jakarta.ws.rs.core.Response;
import org.jboss.logging.Logger;
import org.jboss.resteasy.reactive.server.ServerExceptionMapper;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.nio.charset.StandardCharsets;
import java.util.Locale;

import javax.ws.rs.core.MediaType;
import jakarta.ws.rs.core.MediaType;

import io.quarkus.qute.Variant;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.quarkus.samples.petclinic.system;

import javax.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.ApplicationScoped;

import java.util.Collection;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import java.util.Locale;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

import io.quarkus.qute.TemplateInstance;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.quarkus.samples.petclinic.vet;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;

import io.quarkus.hibernate.orm.panache.PanacheEntity;

Expand Down
12 changes: 6 additions & 6 deletions src/main/java/org/quarkus/samples/petclinic/vet/Vet.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import java.util.List;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinTable;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import jakarta.persistence.Entity;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinTable;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToMany;
import jakarta.persistence.Table;

import org.quarkus.samples.petclinic.model.Person;

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/quarkus/samples/petclinic/vet/VetResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@

import java.util.List;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import jakarta.inject.Inject;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import jakarta.ws.rs.core.MediaType;

@Path("/")
public class VetResource {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/quarkus/samples/petclinic/vet/Vets.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElement;

public class Vets {

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/quarkus/samples/petclinic/visit/Visit.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
import java.time.LocalDate;
import java.util.Collection;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotEmpty;
import javax.ws.rs.FormParam;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import jakarta.validation.constraints.NotEmpty;
import jakarta.ws.rs.FormParam;

import io.quarkus.hibernate.orm.panache.PanacheEntity;

Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/import.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ INSERT INTO specialties VALUES (1001, 'radiology');
INSERT INTO specialties VALUES (1002, 'surgery');
INSERT INTO specialties VALUES (1003, 'dentistry');

INSERT INTO vet_specialties VALUES (1002, 1001);
INSERT INTO vet_specialties VALUES (1003, 1002);
INSERT INTO vet_specialties VALUES (1001, 1002);
INSERT INTO vet_specialties VALUES (1002, 1003);
INSERT INTO vet_specialties VALUES (1003, 1003);
INSERT INTO vet_specialties VALUES (1004, 1002);
INSERT INTO vet_specialties VALUES (1005, 1001);
INSERT INTO vet_specialties VALUES (1002, 1004);
INSERT INTO vet_specialties VALUES (1001, 1005);

INSERT INTO types VALUES (1001, 'cat');
INSERT INTO types VALUES (1002, 'dog');
Expand Down