├── .dockerignore ├── .gitignore ├── .vscode └── settings.json ├── Dockerfile ├── Dockerfile.db ├── LICENSE ├── README.md ├── config └── maven │ ├── settings_noproxy.xml │ └── settings_pxproxy.xml ├── db.sql ├── demo-payara-jpa ├── .dockerignore ├── .gitignore ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── de │ │ └── harald │ │ └── test │ │ └── demo │ │ ├── Customer.java │ │ ├── CustomerResource.java │ │ ├── DemoDataSource.java │ │ └── JAXRSConfiguration.java │ ├── resources │ └── META-INF │ │ └── persistence.xml │ └── webapp │ ├── WEB-INF │ └── beans.xml │ └── index.html ├── demo-payara ├── .dockerignore ├── .gitignore ├── README.md ├── pom.xml └── src │ └── main │ ├── java │ └── de │ │ └── harald │ │ └── test │ │ └── demo │ │ ├── JAXRSConfiguration.java │ │ └── WelcomeResource.java │ └── webapp │ └── index.html ├── demo-python ├── advanced.py └── simple.py ├── demo-quarkus-jpa ├── .dockerignore ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── docker │ │ ├── Dockerfile.jvm │ │ └── Dockerfile.native │ ├── java │ │ └── de │ │ │ └── harald │ │ │ └── test │ │ │ └── demo │ │ │ ├── Customer.java │ │ │ └── CustomerResource.java │ └── resources │ │ ├── META-INF │ │ └── resources │ │ │ └── index.html │ │ └── application.properties │ └── test │ ├── java │ └── de │ │ └── harald │ │ └── test │ │ └── demo │ │ ├── GreetingResourceTest.java │ │ └── NativeGreetingResourceIT.java │ └── resources │ └── requests.http ├── demo-quarkus ├── .dockerignore ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ └── main │ ├── docker │ ├── Dockerfile.jvm │ └── Dockerfile.native │ ├── java │ └── de │ │ └── harald │ │ └── test │ │ └── demo │ │ └── WelcomeResource.java │ └── resources │ ├── META-INF │ └── resources │ │ └── index.html │ └── application.properties ├── demo-spring-boot-jpa ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── de │ │ │ └── harald │ │ │ └── test │ │ │ └── demospringboot │ │ │ ├── Customer.java │ │ │ ├── CustomerRepository.java │ │ │ └── DemoSpringBootApplication.java │ └── resources │ │ ├── META-INF │ │ └── native-image │ │ │ └── reflect-config.json │ │ ├── application.properties │ │ └── hibernate.properties │ └── test │ └── java │ └── de │ └── harald │ └── test │ └── demospringboot │ └── DemoSpringBootApplicationTests.java ├── demo-spring-boot ├── .gitignore ├── .mvn │ └── wrapper │ │ ├── MavenWrapperDownloader.java │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── de │ │ │ └── harald │ │ │ └── test │ │ │ └── demospringboot │ │ │ └── DemoSpringBootApplication.java │ └── resources │ │ └── application.properties │ └── test │ └── java │ └── de │ └── harald │ └── test │ └── demospringboot │ └── DemoSpringBootApplicationTests.java ├── docker-compose.yaml ├── env_build.cmd ├── env_build.sh ├── env_run.cmd ├── env_run.sh ├── logs ├── payara-micro-advanced-zulu@1.11.0.log ├── payara-micro-simple-zulu@1.11.0.log ├── python-advanced.log ├── python-simple.log ├── quarkus-java-advanced-zulu@1.11.0.log ├── quarkus-java-simple-zulu@1.11.0.log ├── quarkus-native-advanced-ce.log ├── quarkus-native-advanced-ee.log ├── quarkus-native-simple-ce.log ├── quarkus-native-simple-ee.log ├── spring-boot-advanced-zulu@1.11.0.log ├── spring-boot-native-advanced-ce.log ├── spring-boot-native-simple-ce.log └── spring-boot-simple-zulu@1.11.0.log ├── plots ├── payara-micro-advanced-zulu@1.11.0.png ├── payara-micro-simple-zulu@1.11.0.png ├── python-advanced.png ├── python-simple.png ├── quarkus-java-advanced-zulu@1.11.0.png ├── quarkus-java-simple-zulu@1.11.0.png ├── quarkus-native-advanced-ce.png ├── quarkus-native-advanced-ee.png ├── quarkus-native-simple-ce.png ├── quarkus-native-simple-ee.png ├── spring-boot-advanced-zulu@1.11.0.png ├── spring-boot-native-advanced-ce.png ├── spring-boot-native-simple-ce.png ├── spring-boot-simple-zulu@1.11.0.png ├── time-load-test.txt └── time-server-ready.txt ├── psrecord-patch └── main.py └── scripts ├── build-native-ce+ee.sh ├── build.sh ├── install-graalvm-ee.sh ├── startup-test.sh ├── test-all.sh ├── test-native-ce+ee.sh └── test-single.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | demo-payara/target 2 | demo-quarkus/target -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | graalvm-ee 2 | 3 | # Eclipse 4 | .project 5 | .classpath 6 | .settings/ 7 | bin/ 8 | 9 | # IntelliJ 10 | .idea 11 | *.ipr 12 | *.iml 13 | *.iws 14 | 15 | # NetBeans 16 | nb-configuration.xml 17 | 18 | # Visual Studio Code 19 | .vscode 20 | 21 | # OSX 22 | .DS_Store 23 | 24 | # Vim 25 | *.swp 26 | *.swo 27 | 28 | # patch 29 | *.orig 30 | *.rej 31 | 32 | # Maven 33 | target/ 34 | pom.xml.tag 35 | pom.xml.releaseBackup 36 | pom.xml.versionsBackup 37 | release.properties -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "java.configuration.updateBuildConfiguration": "automatic" 3 | } -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM centos:8 2 | 3 | # PROXY: uncomment if behind a proxy (px proxy server on localhost:3128) 4 | #ENV http_proxy=http://host.docker.internal:3128 5 | #ENV https_proxy=${http_proxy} 6 | #ENV HTTP_PROXY=${http_proxy} 7 | #ENV HTTPS_PROXY=${http_proxy} 8 | #ENV NO_PROXY=localhost,127.0.0.1 9 | 10 | ENV MAVEN_VERSION=3.6.3 11 | ENV MAVEN_BASE_URL="https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries" 12 | ENV MAVEN_TARBALL="apache-maven-${MAVEN_VERSION}-bin.tar.gz" 13 | ENV MAVEN_HOME=/opt/maven 14 | ENV M2_HOME=${MAVEN_HOME} 15 | ENV MAVEN_CONFIG="${MAVEN_HOME}/.m2" 16 | 17 | COPY ./config/maven/settings_noproxy.xml /tmp/settings_noproxy.xml 18 | COPY ./config/maven/settings_pxproxy.xml /tmp/settings_pxproxy.xml 19 | 20 | # maven 21 | RUN mkdir -p ${MAVEN_HOME} ${MAVEN_HOME}/ref \ 22 | && curl -o /tmp/${MAVEN_TARBALL} ${MAVEN_BASE_URL}/${MAVEN_TARBALL} \ 23 | && tar -xf /tmp/${MAVEN_TARBALL} -C ${MAVEN_HOME} --strip 1 \ 24 | && ln -s ${MAVEN_HOME}/bin/mvn /usr/bin/mvn \ 25 | # PROXY: use the correct maven settings if behind a proxy or not 26 | #&& cp /tmp/settings_pxproxy.xml ${MAVEN_HOME}/conf/settings.xml 27 | && cp /tmp/settings_noproxy.xml ${MAVEN_HOME}/conf/settings.xml 28 | 29 | # tools 30 | RUN dnf -y install gcc \ 31 | && dnf -y --enablerepo=PowerTools install libstdc++-static \ 32 | && dnf -y install glibc-devel zlib-devel \ 33 | # ps 34 | && dnf -y install procps \ 35 | # python 36 | && dnf -y install python3 \ 37 | && dnf -y install python3-devel \ 38 | # psrecord 39 | && pip3 install psrecord \ 40 | && pip3 install matplotlib \ 41 | && pip3 install flask \ 42 | && pip3 install psycopg2-binary 43 | 44 | # jabba with jdks 45 | RUN curl -sL https://github.com/shyiko/jabba/raw/master/install.sh | bash && . ~/.jabba/jabba.sh \ 46 | && jabba install zulu@1.11 \ 47 | && jabba install graalvm-ce@20.2.0=tgz+https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-amd64-20.2.0.tar.gz \ 48 | && jabba use graalvm-ce@20.2.0 \ 49 | && gu install native-image \ 50 | && jabba alias default graalvm-ce@20.2.0 51 | 52 | COPY ./psrecord-patch/main.py /usr/local/lib/python3.6/site-packages/psrecord/ 53 | 54 | # apache benchmarking tool 55 | RUN dnf -y install httpd-tools 56 | 57 | WORKDIR /work -------------------------------------------------------------------------------- /Dockerfile.db: -------------------------------------------------------------------------------- 1 | FROM library/postgres:12.4 2 | 3 | COPY db.sql /docker-entrypoint-initdb.d/ -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Harald Reinmüller 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Comparing the CPU/Memory utilisation of a REST service (Quarkus, Payara Micro, Spring Boot, Python) 2 | 3 | Some scripts to measure the CPU and Memory utilisation of JAX-RS appliations. 4 | The performance test runs inside a docker container. 5 | 6 | The test uses the following demo projects: 7 | 8 | * **demo-payara** contains a simple JAX-RS application packaged as uber-jar with **Payara Micro (5.2020.4)** application server 9 | * **demo-payara-jpa** contains an advanced JAX-RS, JSON-B, CDI, JPA, PostgresDB application packaged as uber-jar with **Payara Micro (5.2020.4)** application server 10 | * **demo-quarkus** contains a simple **Quarkus (1.8.1.Final)** application packaged as jar and additionally compiled as native image using the GraalVM Native Image 11 | * **demo-quarkus-jpa** contains an advanced JAX-RS, JSON-B, CDI, JPA, PostgresDB **Quarkus (1.8.1.Final)** application packaged as jar and additionally compiled as native image using the GraalVM Native Image 12 | * **demo-python** contains a simple (REST service) and advanced (REST with DB access) Python application 13 | * **demo-spring-boot** contains a simple REST service using **Spring Boot (2.4.0-M3)** 14 | * **demo-spring-boot-jpa** contains an advanced REST, JSON, JPA, PostgresDB service using **Spring Boot (2.4.0-M3)** 15 | 16 | ## **(1) Prepare and start plot-tests** 17 | 18 | 1) Modify the **Dockerfile** (look for PROXY) to use a proxy server or not 19 | 2) Build the docker image with ```env_build.sh``` or ```env_build.cmd``` 20 | 3) Run the image in a new docker container with ```env_run.sh``` or ```env_run.cmd``` 21 | 4) Build the demo projects inside the docker container with ```./scripts/build.sh``` 22 | 5) Run the tests inside the docker container with ```./scripts/test-all.sh``` 23 | 6) Plots are generated to directory ```plots``` 24 | 7) Logs are generated to directory ```logs``` 25 | 26 | ## **(2) Test scenario** 27 | 28 | The **plot-test** consists of the following actions: 29 | 30 | * starting the application (simple JAX-RS application) 31 | * wait until the first http request to the JAX-RS endpoint can be served (time to first request) 32 | * sleep 1 second 33 | * start load-test using apache benchmarking tool 34 | * requests: 5000 35 | * concurrency: 5 36 | * url: the JAX-RS endpoint of the application 37 | 38 | ## **(3) Plots** 39 | 40 | All plots are generated on my Notebook inside the running docker container. 41 | 42 | Docker Host Machine: 43 | 44 | * CPU: Intel i7-8650U 1.90GHz (8 cores) 45 | * RAM: 16GB 46 | 47 | Docker Engine Configuration: 48 | 49 | * CPUs: 4 50 | * Memory: 8 GB 51 | 52 | ### **(3.1) Quarkus via GraalVM Native Image** 53 | 54 | | Simple | Advanced | 55 | | ------------------------------------ | -------------------------------------- | 56 | | ![](plots/quarkus-native-simple-ce.png) | ![](plots/quarkus-native-advanced-ce.png) | 57 | | ![](plots/quarkus-native-simple-ee.png) | ![](plots/quarkus-native-advanced-ee.png) | 58 | 59 | ### **(3.2) Quarkus via Java Runtime** 60 | 61 | | Simple | Advanced | 62 | | ---------------------------------------------- | ------------------------------------------------ | 63 | | ![](plots/quarkus-java-simple-zulu@1.11.0.png) | ![](plots/quarkus-java-advanced-zulu@1.11.0.png) | 64 | 65 | ### **(3.3) Payara Micro via Java Runtime** 66 | 67 | | Simple | Advanced | 68 | | ---------------------------------------------- | ------------------------------------------------ | 69 | | ![](plots/payara-micro-simple-zulu@1.11.0.png) | ![](plots/payara-micro-advanced-zulu@1.11.0.png) | 70 | 71 | ### **(3.4) Spring Boot via GraalVM Native Image** 72 | 73 | | Simple | Advanced | 74 | | --------------------------------------------- | ----------------------------------------------- | 75 | | ![](plots/spring-boot-native-simple-ce.png) | ![](plots/spring-boot-native-advanced-ce.png) | 76 | 77 | ### **(3.5) Spring Boot via Java Runtime** 78 | 79 | | Simple | Advanced | 80 | | --------------------------------------------- | ----------------------------------------------- | 81 | | ![](plots/spring-boot-simple-zulu@1.11.0.png) | ![](plots/spring-boot-advanced-zulu@1.11.0.png) | 82 | 83 | ### **(3.6) Python** 84 | 85 | | Simple | Advanced | 86 | | ---------------------------- | ------------------------------ | 87 | | ![](plots/python-simple.png) | ![](plots/python-advanced.png) | 88 | 89 | ## **(4) Used Runtimes, Frameworks and Libraries** 90 | 91 | * Quarkus - 92 | * GraalVM - 93 | * OpenJ9 - 94 | * OpenJDK RI - 95 | * Adopt OpenJDK - 96 | * Zulu OpenJDK - 97 | * Payara Micro - 98 | * Spring Boot - 99 | * psrecord - 100 | * psutil - 101 | * matplotlib - 102 | * jabba - 103 | * Apache Benchmarking Tool - 104 | -------------------------------------------------------------------------------- /config/maven/settings_noproxy.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | ${user.home}/.m2/repository 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /config/maven/settings_pxproxy.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ${user.home}/.m2/repository 7 | 8 | 9 | 10 | 11 | 12 | local-px 13 | true 14 | http 15 | host.docker.internal 16 | 3128 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /db.sql: -------------------------------------------------------------------------------- 1 | create table customer ( 2 | id bigint not null, 3 | name varchar(200) not null, 4 | age integer not null 5 | ); 6 | 7 | 8 | insert into customer (id, name, age) values (1, 'Harald', 41); 9 | insert into customer (id, name, age) values (2, 'Paul', 23); 10 | insert into customer (id, name, age) values (3, 'Stefan', 31); -------------------------------------------------------------------------------- /demo-payara-jpa/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !target/*-runner 3 | !target/*-runner.jar 4 | !target/lib/* -------------------------------------------------------------------------------- /demo-payara-jpa/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .project 3 | .classpath 4 | .settings/ 5 | bin/ 6 | 7 | # IntelliJ 8 | .idea 9 | *.ipr 10 | *.iml 11 | *.iws 12 | 13 | # NetBeans 14 | nb-configuration.xml 15 | 16 | # Visual Studio Code 17 | .vscode 18 | 19 | # OSX 20 | .DS_Store 21 | 22 | # Vim 23 | *.swp 24 | *.swo 25 | 26 | # patch 27 | *.orig 28 | *.rej 29 | 30 | # Maven 31 | target/ 32 | pom.xml.tag 33 | pom.xml.releaseBackup 34 | pom.xml.versionsBackup 35 | release.properties -------------------------------------------------------------------------------- /demo-payara-jpa/README.md: -------------------------------------------------------------------------------- 1 | # Demo using Payara Micro 2 | 3 | ## Bundling 4 | 5 | ```bash 6 | mvn package payara-micro:bundle 7 | ``` 8 | -------------------------------------------------------------------------------- /demo-payara-jpa/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | de.harald.test 6 | demo-payara 7 | 1.0.0-SNAPSHOT 8 | war 9 | 10 | demo-payara 11 | 12 | 13 | 8.0 14 | 5.2020.4 15 | 42.2.6 16 | 17 | 11 18 | 11 19 | false 20 | UTF-8 21 | UTF-8 22 | 23 | 24 | 25 | 26 | javax 27 | javaee-web-api 28 | ${version.javaee} 29 | provided 30 | 31 | 32 | 33 | 34 | org.postgresql 35 | postgresql 36 | ${postgresql.version} 37 | 38 | 39 | 40 | 41 | demo-payara 42 | 43 | 44 | fish.payara.maven.plugins 45 | payara-micro-maven-plugin 46 | 1.2.0 47 | 48 | ${version.payara.micro} 49 | true 50 | 51 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /demo-payara-jpa/src/main/java/de/harald/test/demo/Customer.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | import javax.persistence.NamedQuery; 6 | 7 | @Entity 8 | @NamedQuery(name = Customer.FIND_ALL_CUSTOMERS, query = "select c from Customer c") 9 | public class Customer { 10 | public static final String FIND_ALL_CUSTOMERS = "Customer.FIND_ALL_CUSTOMERS"; 11 | 12 | public Customer() {} 13 | public Customer(long id, String name, int age) { 14 | this.id = id; 15 | this.name = name; 16 | this.age = age; 17 | } 18 | 19 | @Id 20 | public long id; 21 | public String name; 22 | public int age; 23 | } -------------------------------------------------------------------------------- /demo-payara-jpa/src/main/java/de/harald/test/demo/CustomerResource.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import java.util.List; 4 | 5 | import javax.persistence.EntityManager; 6 | import javax.persistence.PersistenceContext; 7 | import javax.ws.rs.GET; 8 | import javax.ws.rs.Path; 9 | import javax.ws.rs.PathParam; 10 | import javax.ws.rs.Produces; 11 | import javax.ws.rs.core.MediaType; 12 | 13 | @Path("/hello") 14 | public class CustomerResource { 15 | 16 | @PersistenceContext(name = "demo") 17 | EntityManager em; 18 | 19 | @GET 20 | @Produces(MediaType.APPLICATION_JSON) 21 | public List findAll() { 22 | return em.createNamedQuery(Customer.FIND_ALL_CUSTOMERS, Customer.class).getResultList(); 23 | } 24 | 25 | @GET 26 | @Produces(MediaType.APPLICATION_JSON) 27 | @Path("/{id}") 28 | public Customer findById(@PathParam("id") Long id) { 29 | return em.find(Customer.class, id); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /demo-payara-jpa/src/main/java/de/harald/test/demo/DemoDataSource.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import javax.annotation.sql.DataSourceDefinition; 4 | 5 | @DataSourceDefinition( 6 | databaseName = "postgres", 7 | name = "java:global/jdbc/demo", 8 | className = "org.postgresql.ds.PGSimpleDataSource", 9 | portNumber = 5432, 10 | serverName = "testdb", 11 | user = "postgres", 12 | password = "postgres") 13 | public class DemoDataSource { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /demo-payara-jpa/src/main/java/de/harald/test/demo/JAXRSConfiguration.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/") 7 | public class JAXRSConfiguration extends Application { 8 | } -------------------------------------------------------------------------------- /demo-payara-jpa/src/main/resources/META-INF/persistence.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | org.eclipse.persistence.jpa.PersistenceProvider 10 | java:global/jdbc/demo 11 | 12 | de.harald.test.demo.Customer 13 | 14 | 15 | 16 | 17 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /demo-payara-jpa/src/main/webapp/WEB-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /demo-payara-jpa/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Start Page 5 | 6 | 7 | 8 |

Hello from Payara!

9 | 10 | 11 | -------------------------------------------------------------------------------- /demo-payara/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !target/*-runner 3 | !target/*-runner.jar 4 | !target/lib/* -------------------------------------------------------------------------------- /demo-payara/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .project 3 | .classpath 4 | .settings/ 5 | bin/ 6 | 7 | # IntelliJ 8 | .idea 9 | *.ipr 10 | *.iml 11 | *.iws 12 | 13 | # NetBeans 14 | nb-configuration.xml 15 | 16 | # Visual Studio Code 17 | .vscode 18 | 19 | # OSX 20 | .DS_Store 21 | 22 | # Vim 23 | *.swp 24 | *.swo 25 | 26 | # patch 27 | *.orig 28 | *.rej 29 | 30 | # Maven 31 | target/ 32 | pom.xml.tag 33 | pom.xml.releaseBackup 34 | pom.xml.versionsBackup 35 | release.properties -------------------------------------------------------------------------------- /demo-payara/README.md: -------------------------------------------------------------------------------- 1 | # Demo using Payara Micro 2 | 3 | ## Bundling 4 | 5 | ```bash 6 | mvn package payara-micro:bundle 7 | ``` 8 | -------------------------------------------------------------------------------- /demo-payara/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 4.0.0 5 | de.harald.test 6 | demo-payara 7 | 1.0.0-SNAPSHOT 8 | war 9 | 10 | demo-payara 11 | 12 | 13 | 8.0 14 | 5.2020.4 15 | 16 | 11 17 | 11 18 | false 19 | UTF-8 20 | UTF-8 21 | 22 | 23 | 24 | 25 | javax 26 | javaee-web-api 27 | ${version.javaee} 28 | provided 29 | 30 | 31 | 32 | 33 | demo-payara 34 | 35 | 36 | fish.payara.maven.plugins 37 | payara-micro-maven-plugin 38 | 1.2.0 39 | 40 | ${version.payara.micro} 41 | true 42 | 43 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /demo-payara/src/main/java/de/harald/test/demo/JAXRSConfiguration.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import javax.ws.rs.ApplicationPath; 4 | import javax.ws.rs.core.Application; 5 | 6 | @ApplicationPath("/") 7 | public class JAXRSConfiguration extends Application { 8 | } -------------------------------------------------------------------------------- /demo-payara/src/main/java/de/harald/test/demo/WelcomeResource.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import javax.ws.rs.GET; 4 | import javax.ws.rs.Path; 5 | import javax.ws.rs.Produces; 6 | import javax.ws.rs.core.MediaType; 7 | 8 | @Path("/hello") 9 | public class WelcomeResource { 10 | 11 | @GET 12 | @Produces(MediaType.TEXT_PLAIN) 13 | public String hello() { 14 | return "hello from payara micro"; 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /demo-payara/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Start Page 5 | 6 | 7 | 8 |

Hello from Payara!

9 | 10 | 11 | -------------------------------------------------------------------------------- /demo-python/advanced.py: -------------------------------------------------------------------------------- 1 | import json 2 | import psycopg2 3 | from psycopg2 import pool 4 | 5 | from flask import Flask 6 | app = Flask(__name__) 7 | 8 | import logging 9 | log = logging.getLogger('werkzeug') 10 | log.setLevel(logging.ERROR) 11 | 12 | # open connection pool to postgres-db 13 | postgreSQL_pool = psycopg2.pool.SimpleConnectionPool(1, 20,user="postgres", 14 | password="postgres", 15 | host="testdb", 16 | port="5432", 17 | database="postgres") 18 | 19 | def executeQuery(query): 20 | try: 21 | connection = postgreSQL_pool.getconn() 22 | cursor = connection.cursor() 23 | cursor.execute(query) 24 | connection.commit() 25 | 26 | except (Exception, psycopg2.DatabaseError) as error : 27 | print ("error while executing query", error) 28 | finally: 29 | if(connection): 30 | postgreSQL_pool.putconn(connection) 31 | 32 | def getAll(): 33 | try: 34 | connection = postgreSQL_pool.getconn() 35 | cursor = connection.cursor() 36 | postgreSQL_select_Query = "select id, name, age from customer" 37 | 38 | cursor.execute(postgreSQL_select_Query) 39 | mobile_records = cursor.fetchall() 40 | 41 | columns = ('id', 'name', 'age') 42 | results = [] 43 | for row in mobile_records: 44 | results.append(dict(zip(columns, row))) 45 | 46 | return json.dumps(results, indent=2) 47 | 48 | except (Exception, psycopg2.Error) as error : 49 | print ("Error while fetching data from PostgreSQL", error) 50 | finally: 51 | if(connection): 52 | cursor.close() 53 | postgreSQL_pool.putconn(connection) 54 | 55 | #executeQuery('''DROP TABLE CUSTOMER;''') 56 | #executeQuery('''CREATE TABLE CUSTOMER (ID INT PRIMARY KEY NOT NULL, NAME TEXT NOT NULL, AGE INT NOT NULL);''') 57 | #executeQuery('''insert into customer (id, name, age) values (1, 'Harald', 41);''') 58 | #executeQuery('''insert into customer (id, name, age) values (2, 'Paul', 23);''') 59 | #executeQuery('''insert into customer (id, name, age) values (3, 'Stefan', 31);''') 60 | 61 | @app.route('/hello') 62 | def find_all_customer(): 63 | return getAll() 64 | 65 | if __name__ == '__main__': 66 | app.run(port=8080) 67 | -------------------------------------------------------------------------------- /demo-python/simple.py: -------------------------------------------------------------------------------- 1 | from flask import Flask 2 | app = Flask(__name__) 3 | 4 | import logging 5 | log = logging.getLogger('werkzeug') 6 | log.setLevel(logging.ERROR) 7 | 8 | @app.route('/hello') 9 | def hello_world(): 10 | return 'Hello from Phyton' 11 | 12 | if __name__ == '__main__': 13 | app.run(port=8080) -------------------------------------------------------------------------------- /demo-quarkus-jpa/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !target/*-runner 3 | !target/*-runner.jar 4 | !target/lib/* -------------------------------------------------------------------------------- /demo-quarkus-jpa/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .project 3 | .classpath 4 | .settings/ 5 | bin/ 6 | 7 | # IntelliJ 8 | .idea 9 | *.ipr 10 | *.iml 11 | *.iws 12 | 13 | # NetBeans 14 | nb-configuration.xml 15 | 16 | # Visual Studio Code 17 | .vscode 18 | .factorypath 19 | 20 | # OSX 21 | .DS_Store 22 | 23 | # Vim 24 | *.swp 25 | *.swo 26 | 27 | # patch 28 | *.orig 29 | *.rej 30 | 31 | # Maven 32 | target/ 33 | pom.xml.tag 34 | pom.xml.releaseBackup 35 | pom.xml.versionsBackup 36 | release.properties -------------------------------------------------------------------------------- /demo-quarkus-jpa/.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import java.net.*; 17 | import java.io.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.5"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 26 | */ 27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 29 | 30 | /** 31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 32 | * use instead of the default one. 33 | */ 34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 35 | ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = 41 | ".mvn/wrapper/maven-wrapper.jar"; 42 | 43 | /** 44 | * Name of the property which should be used to override the default download url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 54 | // wrapperUrl parameter. 55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 56 | String url = DEFAULT_DOWNLOAD_URL; 57 | if(mavenWrapperPropertyFile.exists()) { 58 | FileInputStream mavenWrapperPropertyFileInputStream = null; 59 | try { 60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 61 | Properties mavenWrapperProperties = new Properties(); 62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 64 | } catch (IOException e) { 65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 66 | } finally { 67 | try { 68 | if(mavenWrapperPropertyFileInputStream != null) { 69 | mavenWrapperPropertyFileInputStream.close(); 70 | } 71 | } catch (IOException e) { 72 | // Ignore ... 73 | } 74 | } 75 | } 76 | System.out.println("- Downloading from: " + url); 77 | 78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 79 | if(!outputFile.getParentFile().exists()) { 80 | if(!outputFile.getParentFile().mkdirs()) { 81 | System.out.println( 82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 83 | } 84 | } 85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 86 | try { 87 | downloadFileFromURL(url, outputFile); 88 | System.out.println("Done"); 89 | System.exit(0); 90 | } catch (Throwable e) { 91 | System.out.println("- Error downloading"); 92 | e.printStackTrace(); 93 | System.exit(1); 94 | } 95 | } 96 | 97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 99 | String username = System.getenv("MVNW_USERNAME"); 100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 101 | Authenticator.setDefault(new Authenticator() { 102 | @Override 103 | protected PasswordAuthentication getPasswordAuthentication() { 104 | return new PasswordAuthentication(username, password); 105 | } 106 | }); 107 | } 108 | URL website = new URL(urlString); 109 | ReadableByteChannel rbc; 110 | rbc = Channels.newChannel(website.openStream()); 111 | FileOutputStream fos = new FileOutputStream(destination); 112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 113 | fos.close(); 114 | rbc.close(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /demo-quarkus-jpa/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/demo-quarkus-jpa/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /demo-quarkus-jpa/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.1/apache-maven-3.6.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /demo-quarkus-jpa/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven2 Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /demo-quarkus-jpa/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /demo-quarkus-jpa/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | de.harald.test 6 | demo-quarkus-jpa 7 | 1.0.0-SNAPSHOT 8 | 9 | 3.8.1 10 | true 11 | 11 12 | 11 13 | UTF-8 14 | UTF-8 15 | 1.8.1.Final 16 | quarkus-universe-bom 17 | io.quarkus 18 | 1.8.1.Final 19 | 3.0.0-M5 20 | 21 | 22 | 23 | 24 | ${quarkus.platform.group-id} 25 | ${quarkus.platform.artifact-id} 26 | ${quarkus.platform.version} 27 | pom 28 | import 29 | 30 | 31 | 32 | 33 | 34 | io.quarkus 35 | quarkus-resteasy 36 | 37 | 38 | io.quarkus 39 | quarkus-junit5 40 | test 41 | 42 | 43 | io.rest-assured 44 | rest-assured 45 | test 46 | 47 | 48 | io.quarkus 49 | quarkus-hibernate-orm 50 | 51 | 52 | io.quarkus 53 | quarkus-resteasy-jsonb 54 | 55 | 56 | io.quarkus 57 | quarkus-jdbc-postgresql 58 | 59 | 60 | 61 | 62 | 63 | io.quarkus 64 | quarkus-maven-plugin 65 | ${quarkus-plugin.version} 66 | 67 | 68 | 69 | generate-code 70 | generate-code-tests 71 | build 72 | 73 | 74 | 75 | 76 | 77 | maven-compiler-plugin 78 | ${compiler-plugin.version} 79 | 80 | 81 | maven-surefire-plugin 82 | ${surefire-plugin.version} 83 | 84 | 85 | org.jboss.logmanager.LogManager 86 | ${maven.home} 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | native 95 | 96 | 97 | native 98 | 99 | 100 | 101 | 102 | 103 | maven-failsafe-plugin 104 | ${surefire-plugin.version} 105 | 106 | 107 | 108 | integration-test 109 | verify 110 | 111 | 112 | 113 | ${project.build.directory}/${project.build.finalName}-runner 114 | org.jboss.logmanager.LogManager 115 | ${maven.home} 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | native 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /demo-quarkus-jpa/src/main/docker/Dockerfile.jvm: -------------------------------------------------------------------------------- 1 | #### 2 | # This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode 3 | # 4 | # Before building the docker image run: 5 | # 6 | # mvn package 7 | # 8 | # Then, build the image with: 9 | # 10 | # docker build -f src/main/docker/Dockerfile.jvm -t quarkus/demo-quarkus-jpa-jvm . 11 | # 12 | # Then run the container using: 13 | # 14 | # docker run -i --rm -p 8080:8080 quarkus/demo-quarkus-jpa-jvm 15 | # 16 | ### 17 | FROM fabric8/java-alpine-openjdk8-jre 18 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 19 | ENV AB_ENABLED=jmx_exporter 20 | COPY target/lib/* /deployments/lib/ 21 | COPY target/*-runner.jar /deployments/app.jar 22 | EXPOSE 8080 23 | 24 | # run with user 1001 and be prepared for be running in OpenShift too 25 | RUN adduser -G root --no-create-home --disabled-password 1001 \ 26 | && chown -R 1001 /deployments \ 27 | && chmod -R "g+rwX" /deployments \ 28 | && chown -R 1001:root /deployments 29 | USER 1001 30 | 31 | ENTRYPOINT [ "/deployments/run-java.sh" ] -------------------------------------------------------------------------------- /demo-quarkus-jpa/src/main/docker/Dockerfile.native: -------------------------------------------------------------------------------- 1 | #### 2 | # This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode 3 | # 4 | # Before building the docker image run: 5 | # 6 | # mvn package -Pnative -Dquarkus.native.container-build=true 7 | # 8 | # Then, build the image with: 9 | # 10 | # docker build -f src/main/docker/Dockerfile.native -t quarkus/demo-quarkus-jpa . 11 | # 12 | # Then run the container using: 13 | # 14 | # docker run -i --rm -p 8080:8080 quarkus/demo-quarkus-jpa 15 | # 16 | ### 17 | FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1 18 | 19 | WORKDIR /work/ 20 | COPY target/*-runner /work/application 21 | 22 | # set up permissions for user `1001` 23 | RUN chmod 775 /work /work/application \ 24 | && chown -R 1001 /work \ 25 | && chmod -R "g+rwX" /work \ 26 | && chown -R 1001:root /work 27 | 28 | EXPOSE 8080 29 | USER 1001 30 | 31 | CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] -------------------------------------------------------------------------------- /demo-quarkus-jpa/src/main/java/de/harald/test/demo/Customer.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | import javax.persistence.NamedQuery; 6 | 7 | @Entity 8 | @NamedQuery(name = Customer.FIND_ALL_CUSTOMERS, query = "select c from Customer c") 9 | public class Customer { 10 | public static final String FIND_ALL_CUSTOMERS = "Customer.FIND_ALL_CUSTOMERS"; 11 | 12 | public Customer() {} 13 | public Customer(long id, String name, int age) { 14 | this.id = id; 15 | this.name = name; 16 | this.age = age; 17 | } 18 | 19 | @Id 20 | public long id; 21 | public String name; 22 | public int age; 23 | } -------------------------------------------------------------------------------- /demo-quarkus-jpa/src/main/java/de/harald/test/demo/CustomerResource.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import java.util.List; 4 | 5 | import javax.inject.Inject; 6 | import javax.persistence.EntityManager; 7 | import javax.ws.rs.GET; 8 | import javax.ws.rs.Path; 9 | import javax.ws.rs.PathParam; 10 | import javax.ws.rs.Produces; 11 | import javax.ws.rs.core.MediaType; 12 | 13 | @Path("/hello") 14 | public class CustomerResource { 15 | 16 | @Inject 17 | EntityManager em; 18 | 19 | @GET 20 | @Produces(MediaType.APPLICATION_JSON) 21 | public List findAll() { 22 | return em.createNamedQuery(Customer.FIND_ALL_CUSTOMERS, Customer.class).getResultList(); 23 | } 24 | 25 | @GET 26 | @Produces(MediaType.APPLICATION_JSON) 27 | @Path("/{id}") 28 | public Customer findById(@PathParam("id") Long id) { 29 | return em.find(Customer.class, id); 30 | } 31 | } -------------------------------------------------------------------------------- /demo-quarkus-jpa/src/main/resources/META-INF/resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | demo-quarkus-jpa - 1.0.0-SNAPSHOT 6 | 99 | 100 | 101 | 102 | 105 | 106 |
107 |
108 |

Congratulations, you have created a new Quarkus application.

109 | 110 |

Why do you see this?

111 | 112 |

This page is served by Quarkus. The source is in 113 | src/main/resources/META-INF/resources/index.html.

114 | 115 |

What can I do from here?

116 | 117 |

If not already done, run the application in dev mode using: mvn compile quarkus:dev. 118 |

119 |
    120 |
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • 121 |
  • Your static assets are located in src/main/resources/META-INF/resources.
  • 122 |
  • Configure your application in src/main/resources/application.properties. 123 |
  • 124 |
125 | 126 |

How do I get rid of this page?

127 |

Just delete the src/main/resources/META-INF/resources/index.html file.

128 |
129 |
130 |
131 |

Application

132 |
    133 |
  • GroupId: de.harald.test
  • 134 |
  • ArtifactId: demo-quarkus-jpa
  • 135 |
  • Version: 1.0.0-SNAPSHOT
  • 136 |
  • Quarkus Version: 1.0.0.Final
  • 137 |
138 |
139 |
140 |

Next steps

141 | 146 |
147 |
148 |
149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /demo-quarkus-jpa/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | quarkus.datasource.url = jdbc:postgresql://testdb:5432/postgres 2 | quarkus.datasource.driver = org.postgresql.Driver 3 | quarkus.datasource.username = postgres 4 | quarkus.datasource.password = postgres -------------------------------------------------------------------------------- /demo-quarkus-jpa/src/test/java/de/harald/test/demo/GreetingResourceTest.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import static io.restassured.RestAssured.given; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | import io.quarkus.test.junit.QuarkusTest; 8 | 9 | @QuarkusTest 10 | public class GreetingResourceTest { 11 | 12 | @Test 13 | public void testHelloEndpoint() { 14 | given() 15 | .when().get("/hello") 16 | .then() 17 | .statusCode(200); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /demo-quarkus-jpa/src/test/java/de/harald/test/demo/NativeGreetingResourceIT.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import io.quarkus.test.junit.NativeImageTest; 4 | 5 | @NativeImageTest 6 | public class NativeGreetingResourceIT extends GreetingResourceTest { 7 | 8 | // Execute the same tests but in native mode. 9 | } -------------------------------------------------------------------------------- /demo-quarkus-jpa/src/test/resources/requests.http: -------------------------------------------------------------------------------- 1 | GET http://localhost:8080/customers HTTP/1.1 2 | 3 | ### 4 | 5 | GET http://localhost:8080/customers/2 HTTP/1.1 -------------------------------------------------------------------------------- /demo-quarkus/.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !target/*-runner 3 | !target/*-runner.jar 4 | !target/lib/* -------------------------------------------------------------------------------- /demo-quarkus/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse 2 | .project 3 | .classpath 4 | .settings/ 5 | bin/ 6 | 7 | # IntelliJ 8 | .idea 9 | *.ipr 10 | *.iml 11 | *.iws 12 | 13 | # NetBeans 14 | nb-configuration.xml 15 | 16 | # Visual Studio Code 17 | .vscode 18 | .factorypath 19 | 20 | # OSX 21 | .DS_Store 22 | 23 | # Vim 24 | *.swp 25 | *.swo 26 | 27 | # patch 28 | *.orig 29 | *.rej 30 | 31 | # Maven 32 | target/ 33 | pom.xml.tag 34 | pom.xml.releaseBackup 35 | pom.xml.versionsBackup 36 | release.properties -------------------------------------------------------------------------------- /demo-quarkus/.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import java.net.*; 17 | import java.io.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.5"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 26 | */ 27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 29 | 30 | /** 31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 32 | * use instead of the default one. 33 | */ 34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 35 | ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = 41 | ".mvn/wrapper/maven-wrapper.jar"; 42 | 43 | /** 44 | * Name of the property which should be used to override the default download url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 54 | // wrapperUrl parameter. 55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 56 | String url = DEFAULT_DOWNLOAD_URL; 57 | if(mavenWrapperPropertyFile.exists()) { 58 | FileInputStream mavenWrapperPropertyFileInputStream = null; 59 | try { 60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 61 | Properties mavenWrapperProperties = new Properties(); 62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 64 | } catch (IOException e) { 65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 66 | } finally { 67 | try { 68 | if(mavenWrapperPropertyFileInputStream != null) { 69 | mavenWrapperPropertyFileInputStream.close(); 70 | } 71 | } catch (IOException e) { 72 | // Ignore ... 73 | } 74 | } 75 | } 76 | System.out.println("- Downloading from: " + url); 77 | 78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 79 | if(!outputFile.getParentFile().exists()) { 80 | if(!outputFile.getParentFile().mkdirs()) { 81 | System.out.println( 82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 83 | } 84 | } 85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 86 | try { 87 | downloadFileFromURL(url, outputFile); 88 | System.out.println("Done"); 89 | System.exit(0); 90 | } catch (Throwable e) { 91 | System.out.println("- Error downloading"); 92 | e.printStackTrace(); 93 | System.exit(1); 94 | } 95 | } 96 | 97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 99 | String username = System.getenv("MVNW_USERNAME"); 100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 101 | Authenticator.setDefault(new Authenticator() { 102 | @Override 103 | protected PasswordAuthentication getPasswordAuthentication() { 104 | return new PasswordAuthentication(username, password); 105 | } 106 | }); 107 | } 108 | URL website = new URL(urlString); 109 | ReadableByteChannel rbc; 110 | rbc = Channels.newChannel(website.openStream()); 111 | FileOutputStream fos = new FileOutputStream(destination); 112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 113 | fos.close(); 114 | rbc.close(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /demo-quarkus/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/demo-quarkus/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /demo-quarkus/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.1/apache-maven-3.6.1-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar 3 | -------------------------------------------------------------------------------- /demo-quarkus/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven2 Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /demo-quarkus/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM http://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /demo-quarkus/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | de.harald.test 6 | demo-quarkus 7 | 1.0.0-SNAPSHOT 8 | 9 | 3.8.1 10 | true 11 | 11 12 | 11 13 | UTF-8 14 | UTF-8 15 | 1.8.1.Final 16 | quarkus-universe-bom 17 | io.quarkus 18 | 1.8.1.Final 19 | 3.0.0-M5 20 | 21 | 22 | 23 | 24 | ${quarkus.platform.group-id} 25 | ${quarkus.platform.artifact-id} 26 | ${quarkus.platform.version} 27 | pom 28 | import 29 | 30 | 31 | 32 | 33 | 34 | io.quarkus 35 | quarkus-resteasy 36 | 37 | 38 | io.quarkus 39 | quarkus-junit5 40 | test 41 | 42 | 43 | io.rest-assured 44 | rest-assured 45 | test 46 | 47 | 48 | 49 | 50 | 51 | io.quarkus 52 | quarkus-maven-plugin 53 | ${quarkus-plugin.version} 54 | 55 | 56 | 57 | generate-code 58 | generate-code-tests 59 | build 60 | 61 | 62 | 63 | 64 | 65 | maven-compiler-plugin 66 | ${compiler-plugin.version} 67 | 68 | 69 | maven-surefire-plugin 70 | ${surefire-plugin.version} 71 | 72 | 73 | org.jboss.logmanager.LogManager 74 | ${maven.home} 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | native 83 | 84 | 85 | native 86 | 87 | 88 | 89 | 90 | 91 | maven-failsafe-plugin 92 | ${surefire-plugin.version} 93 | 94 | 95 | 96 | integration-test 97 | verify 98 | 99 | 100 | 101 | ${project.build.directory}/${project.build.finalName}-runner 102 | org.jboss.logmanager.LogManager 103 | ${maven.home} 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | native 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /demo-quarkus/src/main/docker/Dockerfile.jvm: -------------------------------------------------------------------------------- 1 | #### 2 | # This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode 3 | # 4 | # Before building the docker image run: 5 | # 6 | # mvn package 7 | # 8 | # Then, build the image with: 9 | # 10 | # docker build -f src/main/docker/Dockerfile.jvm -t quarkus/demo1-jvm . 11 | # 12 | # Then run the container using: 13 | # 14 | # docker run -i --rm -p 8080:8080 quarkus/demo1-jvm 15 | # 16 | ### 17 | FROM fabric8/java-alpine-openjdk8-jre 18 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" 19 | ENV AB_ENABLED=jmx_exporter 20 | COPY target/lib/* /deployments/lib/ 21 | COPY target/*-runner.jar /deployments/app.jar 22 | EXPOSE 8080 23 | 24 | # run with user 1001 and be prepared for be running in OpenShift too 25 | RUN adduser -G root --no-create-home --disabled-password 1001 \ 26 | && chown -R 1001 /deployments \ 27 | && chmod -R "g+rwX" /deployments \ 28 | && chown -R 1001:root /deployments 29 | USER 1001 30 | 31 | ENTRYPOINT [ "/deployments/run-java.sh" ] -------------------------------------------------------------------------------- /demo-quarkus/src/main/docker/Dockerfile.native: -------------------------------------------------------------------------------- 1 | #### 2 | # This Dockerfile is used in order to build a container that runs the Quarkus application in native (no JVM) mode 3 | # 4 | # Before building the docker image run: 5 | # 6 | # mvn package -Pnative -Dquarkus.native.container-build=true 7 | # 8 | # Then, build the image with: 9 | # 10 | # docker build -f src/main/docker/Dockerfile.native -t quarkus/demo1 . 11 | # 12 | # Then run the container using: 13 | # 14 | # docker run -i --rm -p 8080:8080 quarkus/demo1 15 | # 16 | ### 17 | FROM registry.access.redhat.com/ubi8/ubi-minimal:8.1 18 | 19 | WORKDIR /work/ 20 | COPY target/*-runner /work/application 21 | 22 | # set up permissions for user `1001` 23 | RUN chmod 775 /work /work/application \ 24 | && chown -R 1001 /work \ 25 | && chmod -R "g+rwX" /work \ 26 | && chown -R 1001:root /work 27 | 28 | EXPOSE 8080 29 | USER 1001 30 | 31 | CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] -------------------------------------------------------------------------------- /demo-quarkus/src/main/java/de/harald/test/demo/WelcomeResource.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demo; 2 | 3 | import javax.ws.rs.GET; 4 | import javax.ws.rs.Path; 5 | import javax.ws.rs.Produces; 6 | import javax.ws.rs.core.MediaType; 7 | 8 | @Path("/hello") 9 | public class WelcomeResource { 10 | 11 | @GET 12 | @Produces(MediaType.TEXT_PLAIN) 13 | public String hello() { 14 | return "hello"; 15 | } 16 | } -------------------------------------------------------------------------------- /demo-quarkus/src/main/resources/META-INF/resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | demo1 - 1.0.0-SNAPSHOT 6 | 99 | 100 | 101 | 102 | 105 | 106 |
107 |
108 |

Congratulations, you have created a new Quarkus application.

109 | 110 |

Why do you see this?

111 | 112 |

This page is served by Quarkus. The source is in 113 | src/main/resources/META-INF/resources/index.html.

114 | 115 |

What can I do from here?

116 | 117 |

If not already done, run the application in dev mode using: mvn compile quarkus:dev. 118 |

119 |
    120 |
  • Add REST resources, Servlets, functions and other services in src/main/java.
  • 121 |
  • Your static assets are located in src/main/resources/META-INF/resources.
  • 122 |
  • Configure your application in src/main/resources/application.properties. 123 |
  • 124 |
125 | 126 |

How do I get rid of this page?

127 |

Just delete the src/main/resources/META-INF/resources/index.html file.

128 |
129 |
130 |
131 |

Application

132 |
    133 |
  • GroupId: de.harald.test
  • 134 |
  • ArtifactId: demo-quarkus
  • 135 |
  • Version: 1.0.0-SNAPSHOT
  • 136 |
  • Quarkus Version: 1.0.0.CR1
  • 137 |
138 |
139 |
140 |

Next steps

141 | 146 |
147 |
148 |
149 | 150 | 151 | 152 | -------------------------------------------------------------------------------- /demo-quarkus/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # Configuration file 2 | # key = value -------------------------------------------------------------------------------- /demo-spring-boot-jpa/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /demo-spring-boot-jpa/.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import java.net.*; 17 | import java.io.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.6"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 26 | */ 27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 29 | 30 | /** 31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 32 | * use instead of the default one. 33 | */ 34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 35 | ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = 41 | ".mvn/wrapper/maven-wrapper.jar"; 42 | 43 | /** 44 | * Name of the property which should be used to override the default download url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 54 | // wrapperUrl parameter. 55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 56 | String url = DEFAULT_DOWNLOAD_URL; 57 | if(mavenWrapperPropertyFile.exists()) { 58 | FileInputStream mavenWrapperPropertyFileInputStream = null; 59 | try { 60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 61 | Properties mavenWrapperProperties = new Properties(); 62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 64 | } catch (IOException e) { 65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 66 | } finally { 67 | try { 68 | if(mavenWrapperPropertyFileInputStream != null) { 69 | mavenWrapperPropertyFileInputStream.close(); 70 | } 71 | } catch (IOException e) { 72 | // Ignore ... 73 | } 74 | } 75 | } 76 | System.out.println("- Downloading from: " + url); 77 | 78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 79 | if(!outputFile.getParentFile().exists()) { 80 | if(!outputFile.getParentFile().mkdirs()) { 81 | System.out.println( 82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 83 | } 84 | } 85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 86 | try { 87 | downloadFileFromURL(url, outputFile); 88 | System.out.println("Done"); 89 | System.exit(0); 90 | } catch (Throwable e) { 91 | System.out.println("- Error downloading"); 92 | e.printStackTrace(); 93 | System.exit(1); 94 | } 95 | } 96 | 97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 99 | String username = System.getenv("MVNW_USERNAME"); 100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 101 | Authenticator.setDefault(new Authenticator() { 102 | @Override 103 | protected PasswordAuthentication getPasswordAuthentication() { 104 | return new PasswordAuthentication(username, password); 105 | } 106 | }); 107 | } 108 | URL website = new URL(urlString); 109 | ReadableByteChannel rbc; 110 | rbc = Channels.newChannel(website.openStream()); 111 | FileOutputStream fos = new FileOutputStream(destination); 112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 113 | fos.close(); 114 | rbc.close(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /demo-spring-boot-jpa/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/demo-spring-boot-jpa/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /demo-spring-boot-jpa/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /demo-spring-boot-jpa/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /demo-spring-boot-jpa/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /demo-spring-boot-jpa/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.4.0-M3 10 | 11 | 12 | 13 | de.harald.test 14 | demo-spring-boot-jpa 15 | 0.0.1-SNAPSHOT 16 | demo-spring-boot 17 | Demo project for Spring Boot 18 | 19 | 20 | 11 21 | 22 | 23 | 24 | 25 | org.springframework.experimental 26 | spring-graalvm-native 27 | 0.8.2-SNAPSHOT 28 | 29 | 30 | org.springframework.boot 31 | spring-boot-starter-data-jpa 32 | 33 | 34 | org.springframework.boot 35 | spring-boot-starter-web 36 | 37 | 38 | 39 | org.postgresql 40 | postgresql 41 | runtime 42 | 43 | 44 | 45 | org.springframework.boot 46 | spring-boot-starter-test 47 | test 48 | 49 | 50 | org.junit.vintage 51 | junit-vintage-engine 52 | 53 | 54 | 55 | 56 | 57 | 58 | demo-spring-boot 59 | 60 | 61 | org.springframework.boot 62 | spring-boot-maven-plugin 63 | 64 | 65 | paketobuildpacks/builder:tiny 66 | 67 | 1 68 | 69 | 70 | -Dspring.native.remove-yaml-support=true 71 | --enable-all-security-services 72 | 73 | 74 | 75 | 76 | 77 | 78 | org.hibernate.orm.tooling 79 | hibernate-enhance-maven-plugin 80 | ${hibernate.version} 81 | 82 | 83 | 84 | true 85 | true 86 | true 87 | true 88 | false 89 | 90 | 91 | enhance 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | native 102 | 103 | 104 | 105 | org.graalvm.nativeimage 106 | native-image-maven-plugin 107 | 20.2.0 108 | 109 | de.harald.test.demospringboot.DemoSpringBootApplication 110 | 111 | -Dspring.native.remove-yaml-support=true 112 | -Dspring.spel.ignore=true 113 | -Dspring.graal.remove-unused-autoconfig=true 114 | --verbose 115 | --no-fallback 116 | --allow-incomplete-classpath 117 | --report-unsupported-elements-at-runtime 118 | -H:+ReportExceptionStackTraces 119 | 120 | 121 | 122 | 123 | 124 | native-image 125 | 126 | package 127 | 128 | 129 | 130 | 131 | org.springframework.boot 132 | spring-boot-maven-plugin 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | spring-snapshots 142 | Spring Snapshots 143 | https://repo.spring.io/snapshot 144 | 145 | true 146 | 147 | 148 | 149 | spring-milestones 150 | Spring Milestones 151 | https://repo.spring.io/milestone 152 | 153 | false 154 | 155 | 156 | 157 | 158 | 159 | 160 | spring-snapshots 161 | Spring Snapshots 162 | https://repo.spring.io/snapshot 163 | 164 | true 165 | 166 | 167 | 168 | spring-milestones 169 | Spring Milestones 170 | https://repo.spring.io/milestone 171 | 172 | false 173 | 174 | 175 | 176 | 177 | 178 | -------------------------------------------------------------------------------- /demo-spring-boot-jpa/src/main/java/de/harald/test/demospringboot/Customer.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demospringboot; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.Id; 5 | 6 | @Entity 7 | public class Customer { 8 | public Customer() {} 9 | public Customer(long id, String name, int age) { 10 | this.id = id; 11 | this.name = name; 12 | this.age = age; 13 | } 14 | 15 | @Id 16 | public long id; 17 | public String name; 18 | public int age; 19 | } -------------------------------------------------------------------------------- /demo-spring-boot-jpa/src/main/java/de/harald/test/demospringboot/CustomerRepository.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demospringboot; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | public interface CustomerRepository extends JpaRepository { 8 | List findAll(); 9 | } -------------------------------------------------------------------------------- /demo-spring-boot-jpa/src/main/java/de/harald/test/demospringboot/DemoSpringBootApplication.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demospringboot; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.boot.SpringApplication; 7 | import org.springframework.boot.autoconfigure.SpringBootApplication; 8 | import org.springframework.web.bind.annotation.GetMapping; 9 | import org.springframework.web.bind.annotation.RestController; 10 | 11 | @RestController 12 | @SpringBootApplication(proxyBeanMethods = false) 13 | public class DemoSpringBootApplication { 14 | 15 | public static void main(String[] args) { 16 | SpringApplication.run(DemoSpringBootApplication.class, args); 17 | } 18 | 19 | @Autowired 20 | CustomerRepository repository; 21 | 22 | @GetMapping("/hello") 23 | public List findAll() { 24 | return repository.findAll(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /demo-spring-boot-jpa/src/main/resources/META-INF/native-image/reflect-config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "org.hibernate.dialect.PostgreSQL10Dialect", 4 | "allDeclaredFields": true, 5 | "allDeclaredConstructors": true, 6 | "allDeclaredMethods": true 7 | } 8 | ] 9 | -------------------------------------------------------------------------------- /demo-spring-boot-jpa/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | ## default connection pool 2 | spring.datasource.hikari.connectionTimeout=20000 3 | spring.datasource.hikari.maximumPoolSize=5 4 | 5 | ## PostgreSQL 6 | spring.datasource.url=jdbc:postgresql://testdb:5432/postgres 7 | spring.datasource.username=postgres 8 | spring.datasource.password=postgres 9 | 10 | spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQL10Dialect 11 | spring.jpa.hibernate.ddl-auto=none -------------------------------------------------------------------------------- /demo-spring-boot-jpa/src/main/resources/hibernate.properties: -------------------------------------------------------------------------------- 1 | hibernate.bytecode.provider=none -------------------------------------------------------------------------------- /demo-spring-boot-jpa/src/test/java/de/harald/test/demospringboot/DemoSpringBootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demospringboot; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class DemoSpringBootApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /demo-spring-boot/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /demo-spring-boot/.mvn/wrapper/MavenWrapperDownloader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2007-present the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | import java.net.*; 17 | import java.io.*; 18 | import java.nio.channels.*; 19 | import java.util.Properties; 20 | 21 | public class MavenWrapperDownloader { 22 | 23 | private static final String WRAPPER_VERSION = "0.5.6"; 24 | /** 25 | * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided. 26 | */ 27 | private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/" 28 | + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar"; 29 | 30 | /** 31 | * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to 32 | * use instead of the default one. 33 | */ 34 | private static final String MAVEN_WRAPPER_PROPERTIES_PATH = 35 | ".mvn/wrapper/maven-wrapper.properties"; 36 | 37 | /** 38 | * Path where the maven-wrapper.jar will be saved to. 39 | */ 40 | private static final String MAVEN_WRAPPER_JAR_PATH = 41 | ".mvn/wrapper/maven-wrapper.jar"; 42 | 43 | /** 44 | * Name of the property which should be used to override the default download url for the wrapper. 45 | */ 46 | private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl"; 47 | 48 | public static void main(String args[]) { 49 | System.out.println("- Downloader started"); 50 | File baseDirectory = new File(args[0]); 51 | System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath()); 52 | 53 | // If the maven-wrapper.properties exists, read it and check if it contains a custom 54 | // wrapperUrl parameter. 55 | File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH); 56 | String url = DEFAULT_DOWNLOAD_URL; 57 | if(mavenWrapperPropertyFile.exists()) { 58 | FileInputStream mavenWrapperPropertyFileInputStream = null; 59 | try { 60 | mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile); 61 | Properties mavenWrapperProperties = new Properties(); 62 | mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream); 63 | url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url); 64 | } catch (IOException e) { 65 | System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'"); 66 | } finally { 67 | try { 68 | if(mavenWrapperPropertyFileInputStream != null) { 69 | mavenWrapperPropertyFileInputStream.close(); 70 | } 71 | } catch (IOException e) { 72 | // Ignore ... 73 | } 74 | } 75 | } 76 | System.out.println("- Downloading from: " + url); 77 | 78 | File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH); 79 | if(!outputFile.getParentFile().exists()) { 80 | if(!outputFile.getParentFile().mkdirs()) { 81 | System.out.println( 82 | "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'"); 83 | } 84 | } 85 | System.out.println("- Downloading to: " + outputFile.getAbsolutePath()); 86 | try { 87 | downloadFileFromURL(url, outputFile); 88 | System.out.println("Done"); 89 | System.exit(0); 90 | } catch (Throwable e) { 91 | System.out.println("- Error downloading"); 92 | e.printStackTrace(); 93 | System.exit(1); 94 | } 95 | } 96 | 97 | private static void downloadFileFromURL(String urlString, File destination) throws Exception { 98 | if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) { 99 | String username = System.getenv("MVNW_USERNAME"); 100 | char[] password = System.getenv("MVNW_PASSWORD").toCharArray(); 101 | Authenticator.setDefault(new Authenticator() { 102 | @Override 103 | protected PasswordAuthentication getPasswordAuthentication() { 104 | return new PasswordAuthentication(username, password); 105 | } 106 | }); 107 | } 108 | URL website = new URL(urlString); 109 | ReadableByteChannel rbc; 110 | rbc = Channels.newChannel(website.openStream()); 111 | FileOutputStream fos = new FileOutputStream(destination); 112 | fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); 113 | fos.close(); 114 | rbc.close(); 115 | } 116 | 117 | } 118 | -------------------------------------------------------------------------------- /demo-spring-boot/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/demo-spring-boot/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /demo-spring-boot/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar 3 | -------------------------------------------------------------------------------- /demo-spring-boot/mvnw: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # ---------------------------------------------------------------------------- 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # https://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # ---------------------------------------------------------------------------- 20 | 21 | # ---------------------------------------------------------------------------- 22 | # Maven Start Up Batch script 23 | # 24 | # Required ENV vars: 25 | # ------------------ 26 | # JAVA_HOME - location of a JDK home dir 27 | # 28 | # Optional ENV vars 29 | # ----------------- 30 | # M2_HOME - location of maven2's installed home dir 31 | # MAVEN_OPTS - parameters passed to the Java VM when running Maven 32 | # e.g. to debug Maven itself, use 33 | # set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 34 | # MAVEN_SKIP_RC - flag to disable loading of mavenrc files 35 | # ---------------------------------------------------------------------------- 36 | 37 | if [ -z "$MAVEN_SKIP_RC" ] ; then 38 | 39 | if [ -f /etc/mavenrc ] ; then 40 | . /etc/mavenrc 41 | fi 42 | 43 | if [ -f "$HOME/.mavenrc" ] ; then 44 | . "$HOME/.mavenrc" 45 | fi 46 | 47 | fi 48 | 49 | # OS specific support. $var _must_ be set to either true or false. 50 | cygwin=false; 51 | darwin=false; 52 | mingw=false 53 | case "`uname`" in 54 | CYGWIN*) cygwin=true ;; 55 | MINGW*) mingw=true;; 56 | Darwin*) darwin=true 57 | # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home 58 | # See https://developer.apple.com/library/mac/qa/qa1170/_index.html 59 | if [ -z "$JAVA_HOME" ]; then 60 | if [ -x "/usr/libexec/java_home" ]; then 61 | export JAVA_HOME="`/usr/libexec/java_home`" 62 | else 63 | export JAVA_HOME="/Library/Java/Home" 64 | fi 65 | fi 66 | ;; 67 | esac 68 | 69 | if [ -z "$JAVA_HOME" ] ; then 70 | if [ -r /etc/gentoo-release ] ; then 71 | JAVA_HOME=`java-config --jre-home` 72 | fi 73 | fi 74 | 75 | if [ -z "$M2_HOME" ] ; then 76 | ## resolve links - $0 may be a link to maven's home 77 | PRG="$0" 78 | 79 | # need this for relative symlinks 80 | while [ -h "$PRG" ] ; do 81 | ls=`ls -ld "$PRG"` 82 | link=`expr "$ls" : '.*-> \(.*\)$'` 83 | if expr "$link" : '/.*' > /dev/null; then 84 | PRG="$link" 85 | else 86 | PRG="`dirname "$PRG"`/$link" 87 | fi 88 | done 89 | 90 | saveddir=`pwd` 91 | 92 | M2_HOME=`dirname "$PRG"`/.. 93 | 94 | # make it fully qualified 95 | M2_HOME=`cd "$M2_HOME" && pwd` 96 | 97 | cd "$saveddir" 98 | # echo Using m2 at $M2_HOME 99 | fi 100 | 101 | # For Cygwin, ensure paths are in UNIX format before anything is touched 102 | if $cygwin ; then 103 | [ -n "$M2_HOME" ] && 104 | M2_HOME=`cygpath --unix "$M2_HOME"` 105 | [ -n "$JAVA_HOME" ] && 106 | JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 107 | [ -n "$CLASSPATH" ] && 108 | CLASSPATH=`cygpath --path --unix "$CLASSPATH"` 109 | fi 110 | 111 | # For Mingw, ensure paths are in UNIX format before anything is touched 112 | if $mingw ; then 113 | [ -n "$M2_HOME" ] && 114 | M2_HOME="`(cd "$M2_HOME"; pwd)`" 115 | [ -n "$JAVA_HOME" ] && 116 | JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" 117 | fi 118 | 119 | if [ -z "$JAVA_HOME" ]; then 120 | javaExecutable="`which javac`" 121 | if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then 122 | # readlink(1) is not available as standard on Solaris 10. 123 | readLink=`which readlink` 124 | if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then 125 | if $darwin ; then 126 | javaHome="`dirname \"$javaExecutable\"`" 127 | javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" 128 | else 129 | javaExecutable="`readlink -f \"$javaExecutable\"`" 130 | fi 131 | javaHome="`dirname \"$javaExecutable\"`" 132 | javaHome=`expr "$javaHome" : '\(.*\)/bin'` 133 | JAVA_HOME="$javaHome" 134 | export JAVA_HOME 135 | fi 136 | fi 137 | fi 138 | 139 | if [ -z "$JAVACMD" ] ; then 140 | if [ -n "$JAVA_HOME" ] ; then 141 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 142 | # IBM's JDK on AIX uses strange locations for the executables 143 | JAVACMD="$JAVA_HOME/jre/sh/java" 144 | else 145 | JAVACMD="$JAVA_HOME/bin/java" 146 | fi 147 | else 148 | JAVACMD="`which java`" 149 | fi 150 | fi 151 | 152 | if [ ! -x "$JAVACMD" ] ; then 153 | echo "Error: JAVA_HOME is not defined correctly." >&2 154 | echo " We cannot execute $JAVACMD" >&2 155 | exit 1 156 | fi 157 | 158 | if [ -z "$JAVA_HOME" ] ; then 159 | echo "Warning: JAVA_HOME environment variable is not set." 160 | fi 161 | 162 | CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher 163 | 164 | # traverses directory structure from process work directory to filesystem root 165 | # first directory with .mvn subdirectory is considered project base directory 166 | find_maven_basedir() { 167 | 168 | if [ -z "$1" ] 169 | then 170 | echo "Path not specified to find_maven_basedir" 171 | return 1 172 | fi 173 | 174 | basedir="$1" 175 | wdir="$1" 176 | while [ "$wdir" != '/' ] ; do 177 | if [ -d "$wdir"/.mvn ] ; then 178 | basedir=$wdir 179 | break 180 | fi 181 | # workaround for JBEAP-8937 (on Solaris 10/Sparc) 182 | if [ -d "${wdir}" ]; then 183 | wdir=`cd "$wdir/.."; pwd` 184 | fi 185 | # end of workaround 186 | done 187 | echo "${basedir}" 188 | } 189 | 190 | # concatenates all lines of a file 191 | concat_lines() { 192 | if [ -f "$1" ]; then 193 | echo "$(tr -s '\n' ' ' < "$1")" 194 | fi 195 | } 196 | 197 | BASE_DIR=`find_maven_basedir "$(pwd)"` 198 | if [ -z "$BASE_DIR" ]; then 199 | exit 1; 200 | fi 201 | 202 | ########################################################################################## 203 | # Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 204 | # This allows using the maven wrapper in projects that prohibit checking in binary data. 205 | ########################################################################################## 206 | if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then 207 | if [ "$MVNW_VERBOSE" = true ]; then 208 | echo "Found .mvn/wrapper/maven-wrapper.jar" 209 | fi 210 | else 211 | if [ "$MVNW_VERBOSE" = true ]; then 212 | echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." 213 | fi 214 | if [ -n "$MVNW_REPOURL" ]; then 215 | jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 216 | else 217 | jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 218 | fi 219 | while IFS="=" read key value; do 220 | case "$key" in (wrapperUrl) jarUrl="$value"; break ;; 221 | esac 222 | done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" 223 | if [ "$MVNW_VERBOSE" = true ]; then 224 | echo "Downloading from: $jarUrl" 225 | fi 226 | wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" 227 | if $cygwin; then 228 | wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` 229 | fi 230 | 231 | if command -v wget > /dev/null; then 232 | if [ "$MVNW_VERBOSE" = true ]; then 233 | echo "Found wget ... using wget" 234 | fi 235 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 236 | wget "$jarUrl" -O "$wrapperJarPath" 237 | else 238 | wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" 239 | fi 240 | elif command -v curl > /dev/null; then 241 | if [ "$MVNW_VERBOSE" = true ]; then 242 | echo "Found curl ... using curl" 243 | fi 244 | if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then 245 | curl -o "$wrapperJarPath" "$jarUrl" -f 246 | else 247 | curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f 248 | fi 249 | 250 | else 251 | if [ "$MVNW_VERBOSE" = true ]; then 252 | echo "Falling back to using Java to download" 253 | fi 254 | javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" 255 | # For Cygwin, switch paths to Windows format before running javac 256 | if $cygwin; then 257 | javaClass=`cygpath --path --windows "$javaClass"` 258 | fi 259 | if [ -e "$javaClass" ]; then 260 | if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 261 | if [ "$MVNW_VERBOSE" = true ]; then 262 | echo " - Compiling MavenWrapperDownloader.java ..." 263 | fi 264 | # Compiling the Java class 265 | ("$JAVA_HOME/bin/javac" "$javaClass") 266 | fi 267 | if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then 268 | # Running the downloader 269 | if [ "$MVNW_VERBOSE" = true ]; then 270 | echo " - Running MavenWrapperDownloader.java ..." 271 | fi 272 | ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") 273 | fi 274 | fi 275 | fi 276 | fi 277 | ########################################################################################## 278 | # End of extension 279 | ########################################################################################## 280 | 281 | export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} 282 | if [ "$MVNW_VERBOSE" = true ]; then 283 | echo $MAVEN_PROJECTBASEDIR 284 | fi 285 | MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" 286 | 287 | # For Cygwin, switch paths to Windows format before running java 288 | if $cygwin; then 289 | [ -n "$M2_HOME" ] && 290 | M2_HOME=`cygpath --path --windows "$M2_HOME"` 291 | [ -n "$JAVA_HOME" ] && 292 | JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` 293 | [ -n "$CLASSPATH" ] && 294 | CLASSPATH=`cygpath --path --windows "$CLASSPATH"` 295 | [ -n "$MAVEN_PROJECTBASEDIR" ] && 296 | MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` 297 | fi 298 | 299 | # Provide a "standardized" way to retrieve the CLI args that will 300 | # work with both Windows and non-Windows executions. 301 | MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" 302 | export MAVEN_CMD_LINE_ARGS 303 | 304 | WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 305 | 306 | exec "$JAVACMD" \ 307 | $MAVEN_OPTS \ 308 | -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ 309 | "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ 310 | ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" 311 | -------------------------------------------------------------------------------- /demo-spring-boot/mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /demo-spring-boot/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | 7 | org.springframework.boot 8 | spring-boot-starter-parent 9 | 2.4.0-M3 10 | 11 | 12 | 13 | de.harald.test 14 | demo-spring-boot 15 | 0.0.1-SNAPSHOT 16 | demo-spring-boot 17 | Demo project for Spring Boot 18 | 19 | 20 | 11 21 | 22 | 23 | 24 | 25 | org.springframework.experimental 26 | spring-graalvm-native 27 | 0.8.2-SNAPSHOT 28 | 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-starter-web 33 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-starter-test 38 | test 39 | 40 | 41 | org.junit.vintage 42 | junit-vintage-engine 43 | 44 | 45 | 46 | 47 | 48 | 49 | demo-spring-boot 50 | 51 | 52 | org.springframework.boot 53 | spring-boot-maven-plugin 54 | 55 | 56 | paketobuildpacks/builder:tiny 57 | 58 | 1 59 | 60 | 61 | -Dspring.native.remove-yaml-support=true 62 | --enable-all-security-services 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | native 74 | 75 | 76 | 77 | org.graalvm.nativeimage 78 | native-image-maven-plugin 79 | 20.2.0 80 | 81 | de.harald.test.demospringboot.DemoSpringBootApplication 82 | -Dspring.native.remove-yaml-support=true -Dspring.spel.ignore=true 83 | 84 | 85 | 86 | 87 | native-image 88 | 89 | package 90 | 91 | 92 | 93 | 94 | org.springframework.boot 95 | spring-boot-maven-plugin 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | spring-snapshots 105 | Spring Snapshots 106 | https://repo.spring.io/snapshot 107 | 108 | true 109 | 110 | 111 | 112 | spring-milestones 113 | Spring Milestones 114 | https://repo.spring.io/milestone 115 | 116 | false 117 | 118 | 119 | 120 | 121 | 122 | 123 | spring-snapshots 124 | Spring Snapshots 125 | https://repo.spring.io/snapshot 126 | 127 | true 128 | 129 | 130 | 131 | spring-milestones 132 | Spring Milestones 133 | https://repo.spring.io/milestone 134 | 135 | false 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /demo-spring-boot/src/main/java/de/harald/test/demospringboot/DemoSpringBootApplication.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demospringboot; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.web.bind.annotation.GetMapping; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | @SpringBootApplication(proxyBeanMethods = false) 9 | @RestController 10 | public class DemoSpringBootApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(DemoSpringBootApplication.class, args); 14 | } 15 | 16 | @GetMapping("/hello") 17 | public String hello() { 18 | return "hello"; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /demo-spring-boot/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /demo-spring-boot/src/test/java/de/harald/test/demospringboot/DemoSpringBootApplicationTests.java: -------------------------------------------------------------------------------- 1 | package de.harald.test.demospringboot; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class DemoSpringBootApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | services: 3 | testenv: 4 | build: . 5 | image: harald/quarkus-performance 6 | container_name: testenv 7 | stdin_open: true 8 | tty: true 9 | volumes: 10 | - ./:/work 11 | ports: 12 | - "8080:8080" 13 | depends_on: 14 | - testdb 15 | testdb: 16 | build: 17 | context: . 18 | dockerfile: ./Dockerfile.db 19 | container_name: testdb 20 | environment: 21 | - POSTGRES_USER=postgres 22 | - POSTGRES_PASSWORD=postgres 23 | - POSTGRES_DB=postgres 24 | ports: 25 | - "5432:5432" -------------------------------------------------------------------------------- /env_build.cmd: -------------------------------------------------------------------------------- 1 | docker-compose build -------------------------------------------------------------------------------- /env_build.sh: -------------------------------------------------------------------------------- 1 | docker-compose build -------------------------------------------------------------------------------- /env_run.cmd: -------------------------------------------------------------------------------- 1 | docker-compose up -d 2 | docker exec -it testenv bash -------------------------------------------------------------------------------- /env_run.sh: -------------------------------------------------------------------------------- 1 | docker-compose up -d 2 | docker exec -it testenv bash -------------------------------------------------------------------------------- /logs/payara-micro-advanced-zulu@1.11.0.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 29.379 3079.805 3 | 0.202 33.625 37.871 3079.805 4 | 0.403 60.975 57.328 3144.809 5 | 0.604 69.750 79.145 3276.824 6 | 0.805 82.125 87.430 3278.824 7 | 1.006 87.100 98.137 3280.824 8 | 1.207 83.275 102.254 3282.824 9 | 1.408 63.375 110.230 3349.828 10 | 1.609 44.750 118.375 3351.828 11 | 1.810 47.275 121.797 4003.867 12 | 2.011 67.175 130.875 4005.867 13 | 2.214 79.025 142.008 4078.898 14 | 2.415 73.400 150.570 4090.957 15 | 2.617 79.250 159.695 4108.457 16 | 2.817 87.175 167.043 4112.465 17 | 3.018 84.650 172.383 4116.473 18 | 3.219 83.325 212.602 4118.473 19 | 3.421 86.825 222.926 4121.477 20 | 3.622 82.125 232.797 4122.480 21 | 3.823 84.575 249.324 4124.480 22 | 4.024 74.675 255.137 4131.332 23 | 4.225 77.125 260.809 4134.336 24 | 4.425 82.175 267.805 4138.336 25 | 4.626 67.150 276.102 4140.336 26 | 4.827 75.950 391.383 4141.340 27 | 5.028 79.550 395.102 4143.340 28 | 5.229 80.825 398.754 4143.340 29 | 5.430 78.350 409.816 4145.340 30 | 5.631 84.650 421.090 4149.340 31 | 5.832 63.400 431.211 4153.340 32 | 6.033 80.850 441.684 4158.191 33 | 6.234 72.125 449.035 4159.348 34 | 6.435 80.850 454.227 4159.348 35 | 6.636 80.875 463.754 4161.348 36 | 6.837 83.300 470.211 4165.355 37 | 7.038 82.075 462.582 4165.355 38 | 7.239 83.400 464.918 4167.355 39 | 7.440 72.025 467.266 4168.359 40 | 7.642 85.775 468.785 4168.359 41 | 7.843 78.350 474.707 4170.359 42 | 8.043 59.775 478.887 4170.359 43 | 8.245 3.725 478.887 4170.359 44 | 8.451 0.000 478.887 4170.359 45 | 8.653 2.475 478.887 4170.359 46 | 8.857 0.000 478.887 4170.359 47 | 9.059 44.600 482.605 4174.375 48 | 9.260 93.250 484.055 4175.379 49 | 9.461 94.450 487.750 4177.379 50 | 9.662 94.525 491.027 4177.379 51 | 9.863 93.250 491.680 4177.379 52 | 10.064 90.750 486.816 4177.379 53 | 10.265 89.600 489.230 4179.379 54 | 10.466 89.575 489.832 4179.379 55 | 10.667 89.575 490.695 4179.379 56 | 10.868 91.800 492.504 4179.379 57 | 11.070 90.375 493.332 4179.379 58 | 11.271 87.075 494.539 4179.379 59 | 11.472 89.575 495.855 4179.379 60 | 11.674 85.550 496.781 4179.379 61 | 11.875 89.275 498.539 4179.379 62 | 12.076 85.925 500.074 4179.379 63 | 12.277 84.600 501.000 4179.379 64 | 12.478 84.525 502.973 4179.379 65 | 12.679 74.600 503.805 4179.379 66 | 12.881 11.125 503.805 4179.379 67 | 13.083 0.000 503.820 4179.379 68 | 13.287 0.000 503.820 4179.379 69 | 13.490 0.000 503.820 4179.379 70 | -------------------------------------------------------------------------------- /logs/payara-micro-simple-zulu@1.11.0.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 29.953 3079.805 3 | 0.203 33.625 38.262 3079.805 4 | 0.404 60.975 56.180 3274.824 5 | 0.605 74.600 69.922 3276.824 6 | 0.806 80.850 83.984 3278.824 7 | 1.007 83.225 92.098 3280.824 8 | 1.208 71.000 97.742 3282.824 9 | 1.409 63.275 111.773 3349.828 10 | 1.610 52.200 122.445 3351.828 11 | 1.811 47.350 126.918 4003.867 12 | 2.012 72.125 136.047 4005.867 13 | 2.213 78.400 151.441 4083.949 14 | 2.414 73.350 164.555 4090.961 15 | 2.615 79.600 176.426 4107.453 16 | 2.816 85.800 191.586 4111.461 17 | 3.017 82.150 203.750 4118.293 18 | 3.218 77.100 210.570 4124.746 19 | 3.420 79.325 218.078 4120.473 20 | 3.621 71.975 223.031 4127.324 21 | 3.822 65.925 225.391 4130.328 22 | 4.023 68.425 236.609 4132.328 23 | 4.224 74.575 238.680 4136.328 24 | 4.425 72.150 300.598 4136.328 25 | 4.626 79.500 328.059 4139.332 26 | 4.827 88.275 328.984 4141.340 27 | 5.029 86.975 331.418 4141.340 28 | 5.230 58.475 344.285 4144.344 29 | 5.432 30.850 345.609 4144.344 30 | 5.638 0.000 345.609 4144.344 31 | 5.843 0.000 345.609 4144.344 32 | 6.044 0.000 345.609 4144.344 33 | 6.246 0.000 345.609 4144.344 34 | 6.447 69.525 353.281 4152.898 35 | 6.652 91.350 355.086 4152.898 36 | 6.855 91.325 357.520 4152.898 37 | 7.058 91.200 361.727 4154.898 38 | 7.259 90.775 370.340 4154.898 39 | 7.460 92.100 366.691 4154.898 40 | 7.662 90.325 369.172 4154.898 41 | 7.863 88.250 372.348 4154.898 42 | 8.064 89.525 378.070 4154.898 43 | 8.265 78.425 373.371 4154.898 44 | 8.466 77.150 374.629 4154.898 45 | 8.667 60.925 376.000 4154.898 46 | 8.868 24.850 378.316 4154.898 47 | 9.069 24.875 378.832 4154.898 48 | 9.270 24.875 379.605 4154.898 49 | 9.471 24.875 380.121 4154.898 50 | -------------------------------------------------------------------------------- /logs/python-advanced.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 15.844 96.152 3 | 0.203 14.900 29.176 154.848 4 | 0.405 0.000 29.176 154.848 5 | 0.607 0.000 29.176 154.848 6 | 0.809 0.000 29.176 154.848 7 | 1.011 0.000 29.586 228.945 8 | 1.212 0.000 29.586 228.945 9 | 1.414 0.000 29.586 228.945 10 | 1.616 0.000 29.586 228.945 11 | 1.818 0.000 29.586 228.945 12 | 2.020 0.000 29.586 228.945 13 | 2.221 24.875 30.238 581.211 14 | 2.422 24.875 30.457 589.215 15 | 2.623 23.625 30.527 589.465 16 | 2.825 24.850 30.574 653.465 17 | 3.026 24.775 30.629 725.469 18 | 3.227 24.875 30.566 709.461 19 | 3.431 23.350 30.602 717.465 20 | 3.632 23.625 30.625 717.465 21 | 3.834 24.775 30.613 709.461 22 | 4.035 24.900 30.652 717.465 23 | 4.235 23.675 30.902 709.461 24 | 4.436 23.625 30.906 709.461 25 | 4.638 23.575 30.930 717.465 26 | 4.839 24.875 30.934 717.465 27 | 5.039 23.675 30.930 717.465 28 | 5.240 23.650 30.918 717.465 29 | 5.441 24.875 30.906 717.465 30 | 5.643 23.575 30.906 717.465 31 | 5.843 24.925 30.875 717.465 32 | 6.044 23.625 30.836 709.461 33 | 6.246 23.575 30.828 709.461 34 | 6.447 24.900 30.820 717.465 35 | 6.647 24.900 30.828 717.465 36 | 6.848 23.575 30.812 717.465 37 | 7.050 24.925 31.078 717.465 38 | 7.251 24.850 31.055 717.465 39 | 7.452 24.850 31.043 709.461 40 | 7.653 23.650 31.047 709.461 41 | 7.853 24.875 31.039 717.465 42 | 8.055 23.650 31.035 717.465 43 | 8.255 24.925 31.031 709.461 44 | 8.456 22.350 31.020 709.461 45 | 8.657 26.125 31.062 717.465 46 | 8.858 24.875 31.008 709.461 47 | 9.059 23.600 31.020 717.465 48 | 9.261 23.600 30.992 717.465 49 | 9.462 23.650 31.004 717.465 50 | 9.662 24.925 31.223 717.465 51 | 9.863 23.650 31.215 717.465 52 | 10.064 23.625 31.199 717.465 53 | 10.266 26.075 31.188 717.465 54 | 10.467 23.600 31.168 717.465 55 | 10.667 24.925 31.113 709.461 56 | 10.868 23.625 31.113 717.465 57 | 11.070 24.775 31.070 709.461 58 | 11.272 14.875 31.043 701.457 59 | 11.476 0.000 31.043 701.457 60 | 11.677 0.000 31.043 701.457 61 | 11.878 0.000 31.043 701.457 62 | 12.080 0.000 31.043 701.457 63 | -------------------------------------------------------------------------------- /logs/python-simple.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 16.176 78.211 3 | 0.203 14.925 25.758 185.492 4 | 0.406 0.000 25.758 185.492 5 | 0.612 0.000 25.758 185.492 6 | 0.816 0.000 25.758 185.492 7 | 1.021 0.000 25.758 185.492 8 | 1.223 1.250 25.871 401.504 9 | 1.423 28.650 26.234 537.508 10 | 1.624 28.625 26.285 537.758 11 | 1.825 29.875 26.297 537.758 12 | 2.026 27.375 26.297 537.758 13 | 2.227 29.850 26.324 537.758 14 | 2.428 28.625 26.328 537.758 15 | 2.629 28.625 26.328 537.758 16 | 2.829 27.375 26.332 537.758 17 | 3.030 29.875 26.332 537.758 18 | 3.231 28.650 26.336 537.758 19 | 3.432 28.650 26.328 537.758 20 | 3.633 28.625 26.328 537.758 21 | 3.834 29.875 26.352 537.758 22 | 4.035 28.600 26.352 537.758 23 | 4.236 27.350 26.344 537.758 24 | 4.436 29.850 26.344 537.758 25 | 4.637 27.375 26.324 529.754 26 | 4.838 29.850 26.328 537.758 27 | 5.039 28.625 26.328 537.758 28 | 5.240 28.600 26.328 537.758 29 | 5.441 29.875 26.328 537.758 30 | 5.642 27.375 26.328 537.758 31 | 5.843 28.625 26.328 537.758 32 | 6.046 7.400 26.309 529.754 33 | 6.248 0.000 26.309 529.754 34 | 6.452 0.000 26.309 529.754 35 | 6.660 0.000 26.309 529.754 36 | 6.862 0.000 26.309 529.754 37 | -------------------------------------------------------------------------------- /logs/quarkus-java-advanced-zulu@1.11.0.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.004 0.000 28.730 2581.930 3 | 0.205 13.700 34.273 2581.930 4 | 0.406 18.675 43.918 2581.930 5 | 0.607 46.050 62.375 2648.938 6 | 0.808 55.950 79.180 2715.941 7 | 1.009 42.325 85.645 2717.941 8 | 1.209 27.400 90.527 2719.941 9 | 1.410 31.125 95.668 2723.941 10 | 1.611 49.850 98.824 2723.941 11 | 1.812 41.075 103.914 2992.008 12 | 2.012 37.325 110.012 2994.008 13 | 2.213 39.825 126.867 2996.008 14 | 2.414 64.750 147.461 3260.422 15 | 2.615 42.325 152.770 3329.039 16 | 2.816 36.075 157.598 3337.156 17 | 3.017 53.500 163.277 3337.156 18 | 3.218 21.100 164.566 3337.156 19 | 3.421 0.000 164.566 3337.156 20 | 3.623 0.000 164.566 3337.156 21 | 3.827 0.000 164.566 3337.156 22 | 4.029 3.725 164.809 3467.164 23 | 4.231 60.650 167.094 3599.172 24 | 4.432 88.150 169.812 3601.000 25 | 4.633 85.825 174.129 3601.000 26 | 4.834 87.050 175.586 3603.000 27 | 5.035 84.625 176.824 3603.695 28 | 5.236 89.525 179.367 3605.273 29 | 5.437 83.300 180.367 3605.879 30 | 5.639 86.975 189.301 3614.660 31 | 5.840 86.975 192.785 3616.691 32 | 6.041 87.075 193.531 3616.691 33 | 6.242 85.825 194.746 3616.691 34 | 6.443 83.400 195.250 3616.691 35 | 6.643 79.650 198.340 3619.820 36 | 6.845 80.750 198.598 3619.820 37 | 7.046 29.825 198.699 3619.820 38 | 7.247 24.875 198.699 3619.820 39 | 7.448 24.875 198.699 3619.820 40 | 7.649 24.900 198.699 3619.820 41 | 7.850 24.875 198.699 3619.820 42 | -------------------------------------------------------------------------------- /logs/quarkus-java-simple-zulu@1.11.0.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.001 0.000 27.535 2581.930 3 | 0.202 21.175 37.484 2581.930 4 | 0.403 43.550 50.750 2648.938 5 | 0.604 58.450 69.223 2715.941 6 | 0.805 68.450 80.742 2917.004 7 | 1.006 51.025 88.812 3181.020 8 | 1.210 50.125 95.934 3252.035 9 | 1.411 4.975 96.254 3252.035 10 | 1.612 0.000 96.254 3252.035 11 | 1.817 0.000 96.254 3252.035 12 | 2.019 0.000 96.254 3252.035 13 | 2.223 0.000 96.254 3252.035 14 | 2.424 53.350 98.398 3512.051 15 | 2.626 83.175 101.770 3512.051 16 | 2.826 84.600 103.844 3514.051 17 | 3.028 82.050 105.016 3514.051 18 | 3.229 78.350 105.863 3514.051 19 | 3.430 80.825 106.672 3514.051 20 | 3.631 80.875 107.234 3514.051 21 | 3.831 80.950 108.914 3514.051 22 | 4.032 75.925 119.031 3518.152 23 | 4.233 65.850 137.160 3514.051 24 | 4.434 33.575 142.059 3514.051 25 | 4.637 0.000 142.059 3514.051 26 | 4.839 0.000 142.059 3514.051 27 | 5.041 0.000 138.512 3514.051 28 | -------------------------------------------------------------------------------- /logs/quarkus-native-advanced-ce.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 23.250 237.820 3 | 0.208 6.075 49.914 597.953 4 | 0.413 0.000 49.914 597.953 5 | 0.618 0.000 49.914 597.953 6 | 0.821 0.000 49.914 597.953 7 | 1.024 0.000 49.914 597.953 8 | 1.226 9.925 51.512 885.969 9 | 1.427 36.075 54.387 887.969 10 | 1.628 38.550 55.598 888.969 11 | 1.829 36.075 55.754 888.969 12 | 2.030 37.325 54.480 887.969 13 | 2.231 37.275 54.711 888.969 14 | 2.433 38.500 54.453 888.969 15 | 2.634 38.550 54.617 888.969 16 | 2.835 37.300 54.363 888.969 17 | 3.036 36.075 52.988 885.969 18 | 3.237 38.550 55.508 887.969 19 | 3.438 37.325 53.230 885.969 20 | 3.638 36.100 54.312 887.969 21 | 3.844 3.650 55.855 889.969 22 | 4.046 0.000 55.855 889.969 23 | 4.253 2.425 53.250 885.969 24 | 4.456 0.000 53.250 885.969 25 | 4.663 0.000 53.250 885.969 26 | -------------------------------------------------------------------------------- /logs/quarkus-native-advanced-ee.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 18.395 32935.469 3 | 0.204 6.200 52.801 33373.680 4 | 0.409 0.000 52.801 33373.680 5 | 0.611 0.000 52.801 33373.680 6 | 0.812 0.000 52.801 33373.680 7 | 1.016 0.000 52.801 33373.680 8 | 1.218 3.725 55.453 33663.695 9 | 1.419 36.025 60.273 33744.699 10 | 1.620 39.825 58.199 33750.699 11 | 1.821 37.325 59.820 33754.699 12 | 2.022 39.775 59.219 33760.699 13 | 2.223 39.700 60.469 33765.699 14 | 2.425 37.225 59.723 33770.699 15 | 2.626 38.550 60.938 33777.699 16 | 2.827 38.550 61.227 33783.699 17 | 3.028 38.550 60.484 33790.699 18 | 3.229 13.650 61.402 33792.699 19 | 3.431 0.000 61.402 33792.699 20 | 3.633 0.000 61.402 33792.699 21 | 3.835 0.000 61.402 33792.699 22 | 4.037 0.000 61.402 33792.699 23 | -------------------------------------------------------------------------------- /logs/quarkus-native-simple-ce.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 25.375 492.023 3 | 0.206 0.000 25.375 492.023 4 | 0.408 0.000 25.375 492.023 5 | 0.610 0.000 25.375 492.023 6 | 0.815 0.000 25.375 492.023 7 | 1.016 0.000 25.375 492.023 8 | 1.218 38.500 32.207 773.035 9 | 1.419 39.800 31.891 774.035 10 | 1.620 43.475 32.328 772.035 11 | 1.821 41.000 30.301 772.035 12 | 2.022 41.075 31.219 772.035 13 | 2.223 42.300 32.199 774.035 14 | 2.429 8.475 33.262 774.035 15 | 2.637 0.000 33.262 774.035 16 | 2.841 0.000 33.262 774.035 17 | 3.043 0.000 33.262 774.035 18 | 3.246 0.000 33.262 774.035 19 | -------------------------------------------------------------------------------- /logs/quarkus-native-simple-ee.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 28.078 33258.883 3 | 0.204 0.000 28.078 33258.883 4 | 0.411 0.000 28.078 33258.883 5 | 0.614 0.000 28.078 33258.883 6 | 0.821 0.000 28.078 33258.883 7 | 1.023 0.000 28.078 33258.883 8 | 1.224 43.550 35.141 33544.895 9 | 1.425 43.550 36.637 33552.895 10 | 1.626 29.850 37.309 33556.895 11 | 1.827 46.050 36.723 33566.895 12 | 2.028 39.850 36.375 33572.895 13 | 2.230 0.000 36.375 33572.895 14 | 2.433 0.000 36.375 33572.895 15 | 2.635 0.000 36.375 33572.895 16 | 2.839 0.000 36.375 33572.895 17 | -------------------------------------------------------------------------------- /logs/spring-boot-advanced-zulu@1.11.0.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 25.727 2382.754 3 | 0.203 34.825 42.238 2646.934 4 | 0.403 38.625 57.680 2711.941 5 | 0.604 24.875 61.398 2711.941 6 | 0.805 26.125 64.285 2713.941 7 | 1.006 42.250 66.363 2713.941 8 | 1.207 62.250 79.172 2713.941 9 | 1.408 59.750 92.035 2713.941 10 | 1.609 39.825 93.926 2715.941 11 | 1.810 17.400 94.875 2715.941 12 | 2.011 26.075 96.027 2715.941 13 | 2.212 12.450 97.676 2715.941 14 | 2.413 18.675 98.992 2717.941 15 | 2.614 31.125 101.668 2717.941 16 | 2.815 31.125 103.238 2723.984 17 | 3.016 39.775 105.031 2919.004 18 | 3.217 62.150 106.863 2919.004 19 | 3.418 22.425 107.820 2919.004 20 | 3.619 29.875 108.711 2921.004 21 | 3.820 28.575 110.074 2921.004 22 | 4.021 42.275 112.746 2923.004 23 | 4.222 16.150 113.895 2923.004 24 | 4.423 31.125 115.570 2925.004 25 | 4.624 35.950 116.574 2990.008 26 | 4.826 23.550 117.160 2990.008 27 | 5.027 8.700 117.191 2990.008 28 | 5.228 8.700 114.934 2990.008 29 | 5.430 6.200 114.934 2990.008 30 | 5.631 8.675 115.273 2990.008 31 | 5.832 7.450 115.582 2990.008 32 | 6.033 7.475 115.805 2990.008 33 | 6.234 19.900 116.227 2992.008 34 | 6.435 18.650 116.410 2992.008 35 | 6.636 4.975 116.410 2992.008 36 | 6.837 23.625 116.848 2992.008 37 | 7.038 31.100 122.809 2992.008 38 | 7.240 26.100 123.977 2992.008 39 | 7.440 11.200 124.465 2992.008 40 | 7.641 13.675 124.926 2992.008 41 | 7.842 16.175 125.559 2992.008 42 | 8.043 8.700 125.984 2992.008 43 | 8.244 9.950 126.770 2992.008 44 | 8.445 19.900 128.156 2992.008 45 | 8.646 24.875 129.008 2994.008 46 | 8.847 29.900 132.977 2994.008 47 | 9.048 36.075 137.812 2994.008 48 | 9.249 31.075 138.066 2994.008 49 | 9.450 26.125 139.082 2994.008 50 | 9.651 19.900 139.969 2994.008 51 | 9.852 24.900 140.680 2994.008 52 | 10.053 12.425 131.645 2996.008 53 | 10.254 21.150 132.473 2996.008 54 | 10.455 68.425 141.176 2996.008 55 | 10.656 51.000 141.867 2996.008 56 | 10.857 60.925 145.609 2998.008 57 | 11.058 29.850 147.297 2998.008 58 | 11.259 17.400 147.961 2998.008 59 | 11.462 35.775 149.605 2998.008 60 | 11.664 22.325 149.863 3065.012 61 | 11.865 41.050 150.504 3065.012 62 | 12.065 41.075 152.242 3065.012 63 | 12.267 53.425 155.727 3134.148 64 | 12.467 59.750 166.527 3132.016 65 | 12.669 50.950 172.039 3132.016 66 | 12.869 63.475 173.512 3132.016 67 | 13.070 24.875 174.184 3132.016 68 | 13.273 17.275 175.574 3132.016 69 | 13.474 57.225 177.727 3134.016 70 | 13.675 64.650 180.875 3134.016 71 | 13.876 68.425 182.281 3142.145 72 | 14.077 58.450 183.871 3142.145 73 | 14.278 58.500 186.172 3337.156 74 | 14.479 63.475 188.852 3339.156 75 | 14.679 64.775 191.289 3606.199 76 | 14.880 74.600 195.090 3610.207 77 | 15.081 74.675 197.949 3612.207 78 | 15.283 49.700 200.066 3612.207 79 | 15.483 56.025 203.066 3614.207 80 | 15.684 43.550 204.848 3614.207 81 | 15.885 67.100 207.672 3617.211 82 | 16.087 60.850 208.867 3617.211 83 | 16.288 63.450 209.629 3617.211 84 | 16.489 63.475 221.609 3617.211 85 | 16.689 64.700 223.844 3619.211 86 | 16.891 49.750 224.516 3619.211 87 | 17.092 18.550 224.582 3619.211 88 | 17.300 0.000 224.582 3619.211 89 | 17.507 0.000 224.582 3619.211 90 | 17.712 0.000 224.582 3619.211 91 | 17.914 21.050 224.832 3619.211 92 | 18.115 82.125 225.520 3619.211 93 | 18.316 86.900 226.141 3621.211 94 | 18.518 89.450 226.789 3621.211 95 | 18.719 84.575 228.660 3621.211 96 | 18.919 78.400 229.430 3621.211 97 | 19.121 89.475 230.176 3621.211 98 | 19.322 88.350 232.375 3621.211 99 | 19.523 84.550 232.777 3621.211 100 | 19.724 86.875 233.535 3621.211 101 | 19.926 84.375 234.020 3621.211 102 | 20.126 83.350 230.289 3621.211 103 | 20.293 83.225 230.707 3621.211 104 | 20.495 85.725 232.836 3621.211 105 | 20.696 83.250 233.281 3621.211 106 | 20.897 82.000 233.785 3621.211 107 | 21.098 81.950 234.059 3621.211 108 | 21.299 83.325 234.562 3621.211 109 | 21.501 80.775 235.238 3621.211 110 | 21.702 75.825 235.523 3623.211 111 | 21.903 73.400 235.523 3623.211 112 | 22.104 79.450 235.523 3623.211 113 | 22.305 78.300 235.633 3623.211 114 | 22.506 41.025 235.684 3623.211 115 | 22.709 23.400 235.941 3623.211 116 | 22.915 0.000 235.941 3623.211 117 | 23.120 0.000 235.941 3623.211 118 | 23.324 1.225 235.941 3623.211 119 | -------------------------------------------------------------------------------- /logs/spring-boot-native-advanced-ce.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 15.945 231.074 3 | 0.203 4.975 20.371 235.145 4 | 0.404 8.700 76.625 320.148 5 | 0.605 14.925 108.234 464.156 6 | 0.806 23.625 129.715 1696.340 7 | 1.011 4.875 129.105 1768.344 8 | 1.214 0.000 129.105 1768.344 9 | 1.417 0.000 129.105 1768.344 10 | 1.624 0.000 129.105 1768.344 11 | 1.831 6.050 127.777 1764.344 12 | 2.032 31.050 128.938 1767.344 13 | 2.234 37.300 127.445 1767.344 14 | 2.435 42.225 126.871 1764.344 15 | 2.636 38.525 129.203 1769.344 16 | 2.837 39.775 128.625 1767.344 17 | 3.038 38.575 126.836 1764.344 18 | 3.239 41.025 129.555 1768.344 19 | 3.440 37.275 127.805 1767.344 20 | 3.641 37.325 126.652 1767.344 21 | 3.842 42.300 127.488 1764.344 22 | 4.043 40.950 129.566 1771.344 23 | 4.244 38.575 129.176 1769.344 24 | 4.445 41.050 128.492 1767.344 25 | 4.646 38.550 125.488 1764.344 26 | 4.847 39.800 130.918 1769.344 27 | 5.048 39.800 130.469 1769.344 28 | 5.249 37.325 130.254 1767.344 29 | 5.451 29.700 130.840 1769.344 30 | 5.658 0.000 130.840 1769.344 31 | 5.865 4.825 128.500 1764.344 32 | 6.073 0.000 128.500 1764.344 33 | 6.275 0.000 128.500 1764.344 34 | -------------------------------------------------------------------------------- /logs/spring-boot-native-simple-ce.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.003 0.000 17.320 150.258 3 | 0.203 4.975 36.105 232.332 4 | 0.407 12.250 67.227 1319.391 5 | 0.615 0.000 67.227 1319.391 6 | 0.817 0.000 67.227 1319.391 7 | 1.023 0.000 67.227 1319.391 8 | 1.228 0.000 67.227 1319.391 9 | 1.430 7.450 67.484 1321.391 10 | 1.631 36.075 64.680 1319.391 11 | 1.832 38.550 65.316 1319.391 12 | 2.033 37.325 66.297 1320.391 13 | 2.234 41.050 66.918 1320.391 14 | 2.435 39.750 67.672 1322.391 15 | 2.636 39.825 65.848 1321.391 16 | 2.837 39.775 66.082 1322.391 17 | 3.043 23.025 65.223 1319.391 18 | 3.250 0.000 65.223 1319.391 19 | 3.457 0.000 65.227 1321.391 20 | 3.664 0.000 65.227 1321.391 21 | 3.871 0.000 65.227 1321.391 22 | -------------------------------------------------------------------------------- /logs/spring-boot-simple-zulu@1.11.0.log: -------------------------------------------------------------------------------- 1 | # Elapsed time CPU (%) Real (MB) Virtual (MB) 2 | 0.002 0.000 25.602 2382.754 3 | 0.203 34.850 41.031 2646.934 4 | 0.404 38.550 49.586 2711.941 5 | 0.605 29.875 53.535 2713.941 6 | 0.806 37.325 57.488 2713.941 7 | 1.006 61.025 67.180 2715.941 8 | 1.207 65.950 85.355 2715.941 9 | 1.408 60.900 94.934 2715.941 10 | 1.609 55.950 99.328 2717.941 11 | 1.810 41.050 100.719 2717.941 12 | 2.011 33.575 103.059 2788.988 13 | 2.213 39.725 105.059 2919.004 14 | 2.414 38.500 106.645 2921.004 15 | 2.615 44.775 109.062 2921.004 16 | 2.816 63.425 112.648 2923.004 17 | 3.017 49.775 115.605 2925.004 18 | 3.218 44.825 117.016 2925.004 19 | 3.419 18.650 117.273 2925.004 20 | 3.620 26.075 117.527 2925.004 21 | 3.822 11.175 118.293 2925.004 22 | 4.023 22.400 118.805 2925.004 23 | 4.223 18.700 119.480 2925.004 24 | 4.424 13.675 119.660 2925.004 25 | 4.625 29.825 120.461 2925.004 26 | 4.827 32.275 121.969 2927.004 27 | 5.028 31.100 124.629 2927.004 28 | 5.228 36.125 126.441 2927.004 29 | 5.429 13.675 127.090 2927.004 30 | 5.630 47.250 131.117 2929.004 31 | 5.831 64.700 143.543 2929.004 32 | 6.032 62.225 148.742 2931.004 33 | 6.233 37.275 150.684 2931.004 34 | 6.434 48.550 152.984 3061.012 35 | 6.635 17.400 153.059 3061.012 36 | 6.836 27.400 153.902 3063.012 37 | 7.037 29.875 155.254 3063.012 38 | 7.238 23.650 157.715 3063.012 39 | 7.439 46.075 158.891 3592.074 40 | 7.640 35.975 161.773 3592.074 41 | 7.846 14.525 162.477 3592.074 42 | 8.052 0.000 162.477 3592.074 43 | 8.255 0.000 162.477 3592.074 44 | 8.459 0.000 162.477 3592.074 45 | 8.665 0.000 162.477 3592.074 46 | 8.867 48.325 163.031 3592.074 47 | 9.068 88.325 165.770 3592.074 48 | 9.269 85.825 167.129 3594.074 49 | 9.470 83.375 167.734 3594.074 50 | 9.671 84.450 168.461 3594.074 51 | 9.872 78.425 169.445 3594.074 52 | 10.073 85.725 170.500 3594.074 53 | 10.274 80.900 176.152 3597.793 54 | 10.475 80.900 189.379 3596.387 55 | 10.676 78.375 192.422 3594.074 56 | 10.877 80.750 192.539 3594.074 57 | 11.078 73.475 192.645 3594.074 58 | 11.279 37.275 196.508 3594.074 59 | 11.485 13.350 196.715 3594.074 60 | 11.687 0.000 196.715 3594.074 61 | 11.889 0.000 196.715 3594.074 62 | 12.094 0.000 196.715 3594.074 63 | -------------------------------------------------------------------------------- /plots/payara-micro-advanced-zulu@1.11.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/payara-micro-advanced-zulu@1.11.0.png -------------------------------------------------------------------------------- /plots/payara-micro-simple-zulu@1.11.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/payara-micro-simple-zulu@1.11.0.png -------------------------------------------------------------------------------- /plots/python-advanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/python-advanced.png -------------------------------------------------------------------------------- /plots/python-simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/python-simple.png -------------------------------------------------------------------------------- /plots/quarkus-java-advanced-zulu@1.11.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/quarkus-java-advanced-zulu@1.11.0.png -------------------------------------------------------------------------------- /plots/quarkus-java-simple-zulu@1.11.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/quarkus-java-simple-zulu@1.11.0.png -------------------------------------------------------------------------------- /plots/quarkus-native-advanced-ce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/quarkus-native-advanced-ce.png -------------------------------------------------------------------------------- /plots/quarkus-native-advanced-ee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/quarkus-native-advanced-ee.png -------------------------------------------------------------------------------- /plots/quarkus-native-simple-ce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/quarkus-native-simple-ce.png -------------------------------------------------------------------------------- /plots/quarkus-native-simple-ee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/quarkus-native-simple-ee.png -------------------------------------------------------------------------------- /plots/spring-boot-advanced-zulu@1.11.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/spring-boot-advanced-zulu@1.11.0.png -------------------------------------------------------------------------------- /plots/spring-boot-native-advanced-ce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/spring-boot-native-advanced-ce.png -------------------------------------------------------------------------------- /plots/spring-boot-native-simple-ce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/spring-boot-native-simple-ce.png -------------------------------------------------------------------------------- /plots/spring-boot-simple-zulu@1.11.0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rmh78/quarkus-performance/5081fcb7b985725e482a9220fde9fd15a67bd4c1/plots/spring-boot-simple-zulu@1.11.0.png -------------------------------------------------------------------------------- /plots/time-load-test.txt: -------------------------------------------------------------------------------- 1 | 8629:4516 2 | -------------------------------------------------------------------------------- /plots/time-server-ready.txt: -------------------------------------------------------------------------------- 1 | 8629:16921 2 | -------------------------------------------------------------------------------- /scripts/build-native-ce+ee.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Create native-image executables with community edition and enterprise edition of GraalVM 4 | 5 | export JABBA_HOME="$HOME/.jabba" 6 | 7 | jabba() { 8 | local fd3=$(mktemp /tmp/jabba-fd3.XXXXXX) 9 | (JABBA_SHELL_INTEGRATION=ON $HOME/.jabba/bin/jabba "$@" 3>| ${fd3}) 10 | local exit_code=$? 11 | eval $(cat ${fd3}) 12 | rm -f ${fd3} 13 | return ${exit_code} 14 | } 15 | 16 | # build demo quarkus simple 17 | cd /work/demo-quarkus 18 | jabba use graalvm-ce@20.2.0 19 | mvn package -Pnative 20 | mv /work/demo-quarkus/target/demo-quarkus-1.0.0-SNAPSHOT-runner /work/demo-quarkus/target/demo-ce 21 | jabba use graalvm-ee@20.2.0 22 | mvn package -Pnative 23 | mv /work/demo-quarkus/target/demo-quarkus-1.0.0-SNAPSHOT-runner /work/demo-quarkus/target/demo-ee 24 | 25 | # build demo quarkus advanced 26 | cd /work/demo-quarkus-jpa 27 | jabba use graalvm-ce@20.2.0 28 | mvn package -Pnative 29 | mv /work/demo-quarkus-jpa/target/demo-quarkus-jpa-1.0.0-SNAPSHOT-runner /work/demo-quarkus-jpa/target/demo-ce 30 | jabba use graalvm-ee@20.2.0 31 | mvn package -Pnative 32 | mv /work/demo-quarkus-jpa/target/demo-quarkus-jpa-1.0.0-SNAPSHOT-runner /work/demo-quarkus-jpa/target/demo-ee 33 | -------------------------------------------------------------------------------- /scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # demo payara simple 4 | cd /work/demo-payara 5 | mvn clean package payara-micro:bundle 6 | 7 | # demo payara advanced 8 | cd /work/demo-payara-jpa 9 | mvn clean package payara-micro:bundle 10 | 11 | # demo spring-boot simple 12 | cd /work/demo-spring-boot 13 | mvn package 14 | mvn package -Pnative 15 | mv /work/demo-spring-boot/target/de.harald.test.demospringboot.demospringbootapplication /work/demo-spring-boot/target/demo-ce 16 | 17 | # demo spring-boot advanced 18 | cd /work/demo-spring-boot-jpa 19 | mvn package 20 | mvn package -Pnative 21 | mv /work/demo-spring-boot-jpa/target/de.harald.test.demospringboot.demospringbootapplication /work/demo-spring-boot-jpa/target/demo-ce 22 | 23 | # demo quarkus simple 24 | cd /work/demo-quarkus 25 | mvn package 26 | mvn package -Pnative 27 | mv /work/demo-quarkus/target/demo-quarkus-1.0.0-SNAPSHOT-runner /work/demo-quarkus/target/demo-ce 28 | 29 | # demo quarkus advanced 30 | cd /work/demo-quarkus-jpa 31 | mvn package 32 | mvn package -Pnative 33 | mv /work/demo-quarkus-jpa/target/demo-quarkus-jpa-1.0.0-SNAPSHOT-runner /work/demo-quarkus-jpa/target/demo-ce -------------------------------------------------------------------------------- /scripts/install-graalvm-ee.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Install the GraalVM enterprise edition 4 | # The bundles for GraalVM and Native Image have to be downloaded from Oracle 5 | # and copied into the director graalvm-ee 6 | 7 | export JABBA_HOME="$HOME/.jabba" 8 | 9 | jabba() { 10 | local fd3=$(mktemp /tmp/jabba-fd3.XXXXXX) 11 | (JABBA_SHELL_INTEGRATION=ON $HOME/.jabba/bin/jabba "$@" 3>| ${fd3}) 12 | local exit_code=$? 13 | eval $(cat ${fd3}) 14 | rm -f ${fd3} 15 | return ${exit_code} 16 | } 17 | 18 | if [ "$(ls -A /work/graalvm-ee)" ]; then 19 | echo "install GraalVM EE" 20 | jabba install graalvm-ee@20.2.0=tgz+file:///work/graalvm-ee/graalvm-ee-java11-linux-amd64-20.2.0.tar.gz 21 | jabba use graalvm-ee@20.2.0 22 | gu -L install /work/graalvm-ee/native-image-installable-svm-svmee-java11-linux-amd64-20.2.0.jar 23 | fi -------------------------------------------------------------------------------- /scripts/startup-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | $@ & 3 | MY_PID=$! 4 | DEMO_URL=http://localhost:8080/hello 5 | while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' $DEMO_URL)" != "200" ]]; do sleep 0.02; done 6 | CPU_TIME_TOTAL="$(ps -p $MY_PID -o 'time=' | awk -F'[:.]+' '{t=$3*10+1000*($2+60*$1); print t}')" 7 | echo "Total CPU time used: $CPU_TIME_TOTAL ms" 8 | kill -9 $MY_PID -------------------------------------------------------------------------------- /scripts/test-all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export JABBA_HOME="$HOME/.jabba" 4 | 5 | jabba() { 6 | local fd3=$(mktemp /tmp/jabba-fd3.XXXXXX) 7 | (JABBA_SHELL_INTEGRATION=ON $HOME/.jabba/bin/jabba "$@" 3>| ${fd3}) 8 | local exit_code=$? 9 | eval $(cat ${fd3}) 10 | rm -f ${fd3} 11 | return ${exit_code} 12 | } 13 | 14 | export DEMO_URL=http://localhost:8080/hello 15 | 16 | # run simple quarkus native image test 17 | /work/scripts/test-single.sh "/work/demo-quarkus/target/demo-ce -Xmn8M -Xmx8M" $DEMO_URL quarkus-native-simple-ce "Quarkus (JAX-RS) via GraalVM Native Image (20.2.0 CE)" 18 | sleep 2 19 | 20 | # run advanced quarkus native image test 21 | /work/scripts/test-single.sh "/work/demo-quarkus-jpa/target/demo-ce -Xmn8M -Xmx8M" $DEMO_URL quarkus-native-advanced-ce "Quarkus (JAX-RS + JPA) via GraalVM Native Image (20.2.0 CE)" 22 | sleep 2 23 | 24 | # run simple spring-boot native image test 25 | /work/scripts/test-single.sh "/work/demo-spring-boot/target/demo-ce -Xmn16M -Xmx16M" $DEMO_URL spring-boot-native-simple-ce "Spring Boot (REST) via GraalVM Native Image (20.2.0 CE)" 26 | sleep 2 27 | 28 | # run advanced spring-boot native image test 29 | /work/scripts/test-single.sh "/work/demo-spring-boot-jpa/target/demo-ce -Xmn16M -Xmx16M" $DEMO_URL spring-boot-native-advanced-ce "Spring Boot (REST + JPA) via GraalVM Native Image (20.2.0 CE)" 30 | sleep 2 31 | 32 | # run simple python test 33 | /work/scripts/test-single.sh "python3 /work/demo-python/simple.py" $DEMO_URL python-simple "Python3 with Flask" 34 | sleep 2 35 | 36 | # run advanced python test 37 | /work/scripts/test-single.sh "python3 /work/demo-python/advanced.py" $DEMO_URL python-advanced "Python3 with Flask and Psycopg2" 38 | sleep 2 39 | 40 | # iterate over all installed java version 41 | jabba ls | while read CURRENT_JAVA; do 42 | 43 | jabba use $CURRENT_JAVA 44 | echo $(java -version) 45 | 46 | # run simple payara-micro test 47 | /work/scripts/test-single.sh "java -Xmn8M -Xmx512M -jar /work/demo-payara/target/demo-payara-microbundle.jar --noCluster" $DEMO_URL payara-micro-simple-$CURRENT_JAVA "Payara Micro (JAX-RS) via Java Runtime ($CURRENT_JAVA)" 48 | sleep 2 49 | 50 | # run advanced payara-micro test 51 | /work/scripts/test-single.sh "java -Xmn16M -Xmx512M -jar /work/demo-payara-jpa/target/demo-payara-microbundle.jar --noCluster" $DEMO_URL payara-micro-advanced-$CURRENT_JAVA "Payara Micro (JAX-RS + JPA) via Java Runtime ($CURRENT_JAVA)" 52 | sleep 2 53 | 54 | # run simple spring-boot test 55 | /work/scripts/test-single.sh "java -Xmn8M -Xmx32M -jar /work/demo-spring-boot/target/demo-spring-boot.jar" $DEMO_URL spring-boot-simple-$CURRENT_JAVA "Spring Boot (REST) via Java Runtime ($CURRENT_JAVA)" 56 | sleep 2 57 | 58 | # run advanced spring-boot test 59 | /work/scripts/test-single.sh "java -Xmn16M -Xmx32M -jar /work/demo-spring-boot-jpa/target/demo-spring-boot.jar" $DEMO_URL spring-boot-advanced-$CURRENT_JAVA "Spring Boot (REST + JPA) via Java Runtime ($CURRENT_JAVA)" 60 | sleep 2 61 | 62 | # run simple quarkus-java test 63 | /work/scripts/test-single.sh "java -Xmn8M -Xmx32M -jar /work/demo-quarkus/target/*-runner.jar" $DEMO_URL quarkus-java-simple-$CURRENT_JAVA "Quarkus (JAX-RS) via Java Runtime ($CURRENT_JAVA)" 64 | sleep 2 65 | 66 | # run advanced quarkus-java test 67 | /work/scripts/test-single.sh "java -Xmn16M -Xmx32M -jar /work/demo-quarkus-jpa/target/*-runner.jar" $DEMO_URL quarkus-java-advanced-$CURRENT_JAVA "Quarkus (JAX-RS + JPA) via Java Runtime ($CURRENT_JAVA)" 68 | sleep 2 69 | done 70 | -------------------------------------------------------------------------------- /scripts/test-native-ce+ee.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Runs the tests for the native-image executables only 4 | 5 | DEMO_URL=http://localhost:8080/hello 6 | 7 | # run tests 8 | sleep 1 9 | /work/scripts/test-single.sh "/work/demo-quarkus/target/demo-ce -Xmn8M -Xmx8M" $DEMO_URL quarkus-native-simple-ce "Quarkus (JAX-RS) via GraalVM Native Image (20.2.0 CE)" 10 | sleep 1 11 | /work/scripts/test-single.sh "/work/demo-quarkus/target/demo-ee -Xmn8M -Xmx8M" $DEMO_URL quarkus-native-simple-ee "Quarkus (JAX-RS) via GraalVM Native Image (20.2.0 EE)" 12 | sleep 1 13 | /work/scripts/test-single.sh "/work/demo-quarkus-jpa/target/demo-ce -Xmn8M -Xmx8M" $DEMO_URL quarkus-native-advanced-ce "Quarkus (JAX-RS + JPA) via GraalVM Native Image (20.2.0 CE)" 14 | sleep 1 15 | /work/scripts/test-single.sh "/work/demo-quarkus-jpa/target/demo-ee -Xmn8M -Xmx8M" $DEMO_URL quarkus-native-advanced-ee "Quarkus (JAX-RS + JPA) via GraalVM Native Image (20.2.0 EE)" -------------------------------------------------------------------------------- /scripts/test-single.sh: -------------------------------------------------------------------------------- 1 | # script origin at https://github.com/jkremser/micronaut-app-k8s/blob/master/plot-test.sh 2 | 3 | #!/bin/bash 4 | echo "### utilisation test start" 5 | echo $@ 6 | 7 | time_start=$(date +%s%N) 8 | 9 | $1 & 10 | MY_PID=$! 11 | 12 | sleep 0.02 13 | psrecord $MY_PID --plot "/work/plots/$3.png" --plottitle "$4" --log "/work/logs/$3.log" --interval 0.2 & PSRECORD_PID=$! 14 | 15 | # sleep until ready 16 | while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' $2)" != "200" ]]; do sleep 0.02; done 17 | 18 | time_end=$(date +%s%N) 19 | time_spent=$((($time_end - $time_start)/1000000)) 20 | echo "### server ready after $time_spent ms" 21 | echo "$MY_PID:$time_spent" > /work/plots/time-server-ready.txt 22 | 23 | sleep 1 24 | 25 | # start load-test using apache benchmarking tool 26 | time_start=$(date +%s%N) 27 | ab -c 5 -n 5000 $2 28 | time_end=$(date +%s%N) 29 | time_spent=$((($time_end - $time_start)/1000000)) 30 | echo "### load-test $time_spent ms" 31 | echo "$MY_PID:$time_spent" > /work/plots/time-load-test.txt 32 | 33 | sleep 1 34 | kill -9 $MY_PID 35 | echo "### utilisation test finished" --------------------------------------------------------------------------------