Skip to content

Commit

Permalink
Updates quarkus sample app to 3.x
Browse files Browse the repository at this point in the history
Signed-off-by: asjervanasten <[email protected]>
  • Loading branch information
appiepollo14 committed Nov 11, 2023
1 parent 92165db commit 237c838
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ private void autoConfigureJwt() {
}

private void autoConfigureDatabases() {
// TODO check quarkus version and alter jdbc url property based on that.
if (System.getProperty("quarkus.datasource.url") != null ||
System.getProperty("quarkus.datasource.username") != null ||
System.getProperty("quarkus.datasource.password") != null)
Expand Down
37 changes: 21 additions & 16 deletions sample-apps/quarkus-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@
<artifactId>quarkus-demo</artifactId>
<version>1.0.0-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<compiler-plugin.version>3.11.0</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.release>11</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>1.8.3.Final</quarkus.platform.version>
<quarkus-plugin.version>1.8.3.Final</quarkus-plugin.version>
<surefire-plugin.version>2.22.2</surefire-plugin.version>
<quarkus.platform.version>3.2.8.Final</quarkus.platform.version>
<surefire-plugin.version>3.1.2</surefire-plugin.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -55,7 +53,7 @@
<groupId>io.quarkus</groupId>
<artifactId>quarkus-mongodb-client</artifactId>
</dependency>
<!--
<!--
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-jwt</artifactId>
Expand All @@ -67,7 +65,7 @@
<artifactId>quarkus-smallrye-reactive-messaging-kafka</artifactId>
</dependency>
-->

<!-- Test dependencies -->
<dependency>
<groupId>io.quarkus</groupId>
Expand All @@ -87,17 +85,17 @@
</dependency>
<dependency>
<groupId>org.microshed</groupId>
<artifactId>microshed-testing-core</artifactId>
<artifactId>microshed-testing-core-jakarta</artifactId>
<version>0.9.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.15.0</version>
<version>1.19.1</version>
<scope>test</scope>
</dependency>
<!--
<!--
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>kafka</artifactId>
Expand All @@ -108,7 +106,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.36</version>
<version>2.0.9</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -117,11 +115,13 @@
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus-plugin.version}</version>
<version>${quarkus.platform.version}</version>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
Expand Down Expand Up @@ -161,9 +161,14 @@
<goal>verify</goal>
</goals>
<configuration>
<systemProperties>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
</systemProperties>
<systemPropertyVariables>
<native.image.path>
${project.build.directory}/${project.build.finalName}-runner
</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager
</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/
package org.example.app;

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("/hello")
public class ExampleResource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@

import java.util.List;

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

@Path("/fruits")
@Produces(MediaType.APPLICATION_JSON)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.util.ArrayList;
import java.util.List;

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

import org.bson.Document;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import java.time.LocalDate;
import java.util.List;

import javax.persistence.Entity;
import jakarta.persistence.Entity;

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

import java.util.List;

import javax.transaction.Transactional;
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.transaction.Transactional;
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;

@Path("/people")
@Transactional
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
quarkus.datasource.url=jdbc:postgresql://localhost:5432/quark_db
quarkus.datasource.driver=org.postgresql.Driver
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/quark_db
quarkus.datasource.jdbc.driver=org.postgresql.Driver
quarkus.datasource.username=quark
quarkus.datasource.password=quark

Expand Down

0 comments on commit 237c838

Please sign in to comment.