Difference between revisions of "IT-SDK-Quarkus"
Jump to navigation
Jump to search
Samerhijazi (talk | contribs) (→OpenShift) |
(→Maven) |
||
| (26 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
| − | = | + | =Ref= |
| − | ==OpenShift | + | * https://quarkus.io/guides/getting-started |
| + | * https://quarkus.io/guides/maven-tooling | ||
| + | * https://quarkus.io/guides/centralized-log-management | ||
| + | * https://quarkus.io/guides/rest-json | ||
| + | * https://lordofthejars.github.io/quarkus-cheat-sheet/ | ||
| + | |||
| + | =Initial= | ||
| + | ==CLI== | ||
| + | <pre class="code"> | ||
| + | quarkus create app com.condolco.trymore:trymore --extension=resteasy | ||
| + | cd trymore | ||
| + | quarkus dev | ||
| + | quarkus build | ||
| + | </pre> | ||
| + | |||
| + | ==Maven== | ||
| + | <pre class="code"> | ||
| + | mvn io.quarkus.platform:quarkus-maven-plugin:2.11.1.Final:create \ | ||
| + | -DprojectGroupId=com.condolco \ | ||
| + | -DprojectArtifactId=quarkus-app \ | ||
| + | -Dextensions="resteasy" | ||
| + | ---- | ||
| + | cd trymore | ||
| + | mvn quarkus:dev | ||
| + | mvn clean package | ||
| + | </pre> | ||
| + | |||
| + | =OpenShift= | ||
* https://www.youtube.com/watch?v=QxJQMb35RWU | * https://www.youtube.com/watch?v=QxJQMb35RWU | ||
* https://quarkus.io/guides/getting-started | * https://quarkus.io/guides/getting-started | ||
| Line 6: | Line 33: | ||
* https://quarkus.io/guides/deploying-to-kubernetes | * https://quarkus.io/guides/deploying-to-kubernetes | ||
* https://quarkus.io/guides/deploying-to-openshift | * https://quarkus.io/guides/deploying-to-openshift | ||
| − | + | <pre class="code"> | |
| − | oc new-build --name | + | oc new-project $NAME_SPACE |
| − | oc start-build --from-dir . | + | oc project $NAME_SPACE |
| − | oc new-app --image-stream | + | oc delete $NAME_SPACE |
| + | ... | ||
| + | oc new-build --name $NAME_BUILD --namespace $NAME_SPACE --strategy docker --binary | ||
| + | oc new-build --name $NAME_BUILD --namespace $NAME_SPACE --strategy docker --binary --to="$NAME_BUILD" | ||
| + | oc new-build --name $NAME_BUILD --namespace $NAME_SPACE --strategy docker --binary --docker-image $NAME_DOCKER:TAG | ||
| + | oc new-build --name $NAME_BUILD --namespace $NAME_SPACE --strategy docker --code . --dockerfile - < src/main/docker/Dockerfile.jvm | ||
| + | ... | ||
| + | oc start-build $NAME_BUILD --from-dir . --follow --wait | ||
| + | oc new-app --name=$NAME_BUILD --image-stream=$NAME_SPACE/$NAME_BUILD:latest | ||
| + | oc expose svc/$NAME_BUILD | ||
| + | ... | ||
| + | oc get is | ||
| + | oc get svc | ||
| + | oc get routes | ||
| + | </pre> | ||
==ref: Roadmap== | ==ref: Roadmap== | ||
| Line 15: | Line 56: | ||
* https://github.com/quarkusio/quarkus-quickstarts | * https://github.com/quarkusio/quarkus-quickstarts | ||
* https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/index.html | * https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/index.html | ||
| + | * https://quarkiverse.github.io/quarkiverse-docs/quarkus-cxf/dev/server.html | ||
* ------------------------------------------------------- | * ------------------------------------------------------- | ||
* https://quarkus.io/guides/datasource | * https://quarkus.io/guides/datasource | ||
| Line 52: | Line 94: | ||
</pre> | </pre> | ||
| − | + | =Startup= | |
| + | * https://quarkus.io/guides/maven-tooling | ||
| + | <pre class="code"> | ||
| + | mvn "io.quarkus:quarkus-maven-plugin:2.0.1.Final:create" | ||
| + | mvn "io.quarkus:quarkus-maven-plugin:1.11.7.Final:create" | ||
| + | </pre> | ||
<pre class="code"> | <pre class="code"> | ||
| − | mvn "io.quarkus:quarkus-maven-plugin: | + | mvn "io.quarkus:quarkus-maven-plugin:2.5.2.Final:create" \ |
| − | + | -DprojectGroupId="net.samerhijazi.startup" \ | |
| − | + | -DprojectArtifactId="quarkus-startup" \ | |
| − | -DprojectGroupId="net. | + | -DclassName="net.samerhijazi.startup.run" \ |
| − | -DprojectArtifactId="quarkus- | ||
| − | -DclassName=" | ||
-Dpath="/hello" \ | -Dpath="/hello" \ | ||
| − | -Dextensions="resteasy | + | -Dextensions="resteasy" |
| + | --- | ||
| + | mvn io.quarkus.platform:quarkus-maven-plugin:2.6.3.Final:create \ | ||
| + | -DprojectGroupId=my-groupId \ | ||
| + | -DprojectArtifactId=my-artifactId \ | ||
| + | -DprojectVersion=my-version \ | ||
| + | -DclassName="org.my.group.MyResource" | ||
</pre> | </pre> | ||
<pre class="code"> | <pre class="code"> | ||
| − | mvn package | + | mvn clean |
| − | mvn | + | mvn compile |
| + | mvn package | ||
| + | ... | ||
| + | mvn quarkus:dev | ||
mvn quarkus:list-extensions | mvn quarkus:list-extensions | ||
| − | mvn quarkus:add-extension -Dextensions=" | + | mvn quarkus:add-extension -Dextensions="openshift" |
| − | mvn quarkus: | + | mvn quarkus:remove-extension -Dextensions="openshift" |
</pre> | </pre> | ||
<pre class="code"> | <pre class="code"> | ||
| Line 74: | Line 128: | ||
mvn clean package -DskipTests | mvn clean package -DskipTests | ||
java -jar target/tutorial-app-1.0-SNAPSHOT-runner.jar | java -jar target/tutorial-app-1.0-SNAPSHOT-runner.jar | ||
| − | + | ... | |
| − | |||
## mode: native | ## mode: native | ||
mvn clean package -DskipTests -Pnative | mvn clean package -DskipTests -Pnative | ||
./target/tutorial-app-1.0-SNAPSHOT-runner | ./target/tutorial-app-1.0-SNAPSHOT-runner | ||
| − | + | ... | |
| − | |||
## mode: native contianer | ## mode: native contianer | ||
| − | mvn package -DskipTests -Pnative -Dquarkus.native.container-build=true | + | mvn clean package -DskipTests -Pnative -Dquarkus.native.container-build=true |
docker build -f src/main/docker/Dockerfile.native -t example/tutorial-app:1.0-SNAPSHOT . | docker build -f src/main/docker/Dockerfile.native -t example/tutorial-app:1.0-SNAPSHOT . | ||
docker run -it --rm -p 8080:8080 example/tutorial-app:1.0-SNAPSHOT | docker run -it --rm -p 8080:8080 example/tutorial-app:1.0-SNAPSHOT | ||
</pre> | </pre> | ||
Latest revision as of 10:00, 31 August 2022
Contents
Ref
- https://quarkus.io/guides/getting-started
- https://quarkus.io/guides/maven-tooling
- https://quarkus.io/guides/centralized-log-management
- https://quarkus.io/guides/rest-json
- https://lordofthejars.github.io/quarkus-cheat-sheet/
Initial
CLI
quarkus create app com.condolco.trymore:trymore --extension=resteasy cd trymore quarkus dev quarkus build
Maven
mvn io.quarkus.platform:quarkus-maven-plugin:2.11.1.Final:create \
-DprojectGroupId=com.condolco \
-DprojectArtifactId=quarkus-app \
-Dextensions="resteasy"
----
cd trymore
mvn quarkus:dev
mvn clean package
OpenShift
- https://www.youtube.com/watch?v=QxJQMb35RWU
- https://quarkus.io/guides/getting-started
- https://quarkus.io/guides/maven-tooling
- https://quarkus.io/guides/deploying-to-kubernetes
- https://quarkus.io/guides/deploying-to-openshift
oc new-project $NAME_SPACE oc project $NAME_SPACE oc delete $NAME_SPACE ... oc new-build --name $NAME_BUILD --namespace $NAME_SPACE --strategy docker --binary oc new-build --name $NAME_BUILD --namespace $NAME_SPACE --strategy docker --binary --to="$NAME_BUILD" oc new-build --name $NAME_BUILD --namespace $NAME_SPACE --strategy docker --binary --docker-image $NAME_DOCKER:TAG oc new-build --name $NAME_BUILD --namespace $NAME_SPACE --strategy docker --code . --dockerfile - < src/main/docker/Dockerfile.jvm ... oc start-build $NAME_BUILD --from-dir . --follow --wait oc new-app --name=$NAME_BUILD --image-stream=$NAME_SPACE/$NAME_BUILD:latest oc expose svc/$NAME_BUILD ... oc get is oc get svc oc get routes
ref: Roadmap
- https://lankydan.dev/building-a-rest-api-with-quarkus
- https://github.com/quarkusio/quarkus-quickstarts
- https://redhat-developer-demos.github.io/quarkus-tutorial/quarkus-tutorial/index.html
- https://quarkiverse.github.io/quarkiverse-docs/quarkus-cxf/dev/server.html
- -------------------------------------------------------
- https://quarkus.io/guides/datasource
- https://quarkus.io/guides/getting-started
- https://quarkus.io/guides/getting-started-reactive
- https://quarkus.io/guides/rest-json
- https://quarkus.io/guides/rest-client
- https://quarkus.io/guides/reactive-sql-clients
- https://quarkus.io/guides/hibernate-orm
- -------------------------------------------------------
- https://quarkus.io/guides/config
- https://quarkus.io/guides/config-reference
- https://quarkus.io/guides/all-config
- https://quarkus.io/guides/maven-tooling
- https://microprofile.io/project/eclipse/microprofile-config
- https://smallrye.io/docs/smallrye-config/index.html
- -------------------------------------------------------
- https://quarkus.io/guides/flyway
- https://quarkus.io/guides/microprofile-graphql
- https://quarkus.io/guides/kubernetes
- https://quarkus.io/quarkus-workshops/super-heroes
- ----------------------------------------------------
ref: Colletions
- https://github.com/quarkusio/quarkus/blob/master/integration-tests/flyway/src/main/java/io/quarkus/it/flyway/FlywayFunctionalityResource.java
- https://dzone.com/articles/building-a-rest-api-with-quarkus
- https://www.programcreek.com/java-api-examples/?code=quarkusio%2Fquarkus-quickstarts%2Fquarkus-quickstarts-master
- https://blogs.oracle.com/developers/configuring-the-oracle-jdbc-drivers-with-quarkus
- https://antoniogoncalves.org/2019/06/07/configuring-a-quarkus-application/
- https://dzone.com/articles/build-a-java-rest-api-with-quarkus
- https://dzone.com/articles/quick-guide-to-microservices-with-quarkus-on-opens
- http://www.mastertheboss.com/soa-cloud/quarkus/getting-started-with-quarkus
- https://www.mailing.dzone.com/click.html?x=a62e&lc=Uhy&mc=h&s=hbIX&u=f&z=oIlBEZc&
- https://jaxenter.de/serverless/quarkus-full-stack-framework-87817
docker pull maven:3.6-jdk-11-slim
Startup
mvn "io.quarkus:quarkus-maven-plugin:2.0.1.Final:create" mvn "io.quarkus:quarkus-maven-plugin:1.11.7.Final:create"
mvn "io.quarkus:quarkus-maven-plugin:2.5.2.Final:create" \
-DprojectGroupId="net.samerhijazi.startup" \
-DprojectArtifactId="quarkus-startup" \
-DclassName="net.samerhijazi.startup.run" \
-Dpath="/hello" \
-Dextensions="resteasy"
---
mvn io.quarkus.platform:quarkus-maven-plugin:2.6.3.Final:create \
-DprojectGroupId=my-groupId \
-DprojectArtifactId=my-artifactId \
-DprojectVersion=my-version \
-DclassName="org.my.group.MyResource"
mvn clean mvn compile mvn package ... mvn quarkus:dev mvn quarkus:list-extensions mvn quarkus:add-extension -Dextensions="openshift" mvn quarkus:remove-extension -Dextensions="openshift"
## mode: jvm mvn clean package -DskipTests java -jar target/tutorial-app-1.0-SNAPSHOT-runner.jar ... ## mode: native mvn clean package -DskipTests -Pnative ./target/tutorial-app-1.0-SNAPSHOT-runner ... ## mode: native contianer mvn clean package -DskipTests -Pnative -Dquarkus.native.container-build=true docker build -f src/main/docker/Dockerfile.native -t example/tutorial-app:1.0-SNAPSHOT . docker run -it --rm -p 8080:8080 example/tutorial-app:1.0-SNAPSHOT