Skip to content

Commit

Permalink
[Java] Add quarkus (#3813)
Browse files Browse the repository at this point in the history
  • Loading branch information
whiplash committed Jan 23, 2021
1 parent 92c6176 commit 16c99e3
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 0 deletions.
2 changes: 2 additions & 0 deletions java/quarkus/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
target
*.class
11 changes: 11 additions & 0 deletions java/quarkus/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
framework:
website: quarkus.io
version: 1.11

build:
- mvn clean package -Dquarkus.package.type=uber-jar -Dquarkus.http.port=3000 -Pnative

binaries:
- target/quarkus-1.0.0-runner.jar

command: /usr/bin/java -XX:+UseNUMA -XX:+UseParallelGC -XX:+AggressiveOpts -jar /opt/web/target/quarkus-1.0.0-runner.jar
93 changes: 93 additions & 0 deletions java/quarkus/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>benchmarker.the</groupId>
<artifactId>quarkus</artifactId>
<version>1.0.0</version>
<properties>
<compiler-plugin.version>3.8.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>

<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.11.0.Final</quarkus.platform.version>

</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-container-image-docker</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<extensions>true</extensions>
<executions>
<execution>
<goals>
<goal>build</goal>
<goal>generate-code</goal>
<goal>generate-code-tests</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
</plugin>
<!-- <plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${surefire-plugin.version}</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin> -->
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<plugins></plugins>
</build>
<properties>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
</project>
33 changes: 33 additions & 0 deletions java/quarkus/src/main/java/yolo/BenchmarkResource.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package yolo;

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;

@Path("/")
public class BenchmarkResource {

@GET
@Path("/")
@Produces(MediaType.TEXT_PLAIN)
public String root() {
return "";
}

@GET
@Path("/user/{id}")
@Produces(MediaType.TEXT_PLAIN)
public String userId(String id) {
return id;
}

@POST
@Path("/user")
@Produces(MediaType.TEXT_PLAIN)
public String user() {
return "";
}
}
1 change: 1 addition & 0 deletions java/quarkus/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
quarkus.http.port=3000

0 comments on commit 16c99e3

Please sign in to comment.