From 0d8658914236d2e322947a7454c1843bdf9f01bf Mon Sep 17 00:00:00 2001 From: Manfred Riem Date: Fri, 22 Nov 2024 20:01:50 -0600 Subject: [PATCH] Fixes #4187 - Update Piranha Core Profile - Create a REST service guide (#4246) --- SCHEDULE.md | 28 +++++++++++ .../site/markdown/create_a_rest_service.md | 48 ++++++++++--------- 2 files changed, 53 insertions(+), 23 deletions(-) create mode 100644 SCHEDULE.md diff --git a/SCHEDULE.md b/SCHEDULE.md new file mode 100644 index 000000000..3c0584420 --- /dev/null +++ b/SCHEDULE.md @@ -0,0 +1,28 @@ +# Schedule for refreshing content + +| Category | Guide | Schedule | +|----------|-------|----------| +| Piranha Core Profile | Create a JSON REST service | Week 1, 26 | +| | Create a REST service | Week 2, 27 | +| | Debugging a REST service with NetBeans | Week 3, 28 | +| | Debugging a REST service with VSCode | Week 4, 29 | +| | Testing with JUnit 5 and Arquillian | Week 5, 30 | +| | Piranha Core Profile on Project CRaC | Week 6, 31 | +| Piranha Embedded | Create a Hello World web application | Week 7, 32 | +| | Create an Piranha Embedded JLink application | Week 8, 33 | +| | Running Piranha Embedded with Spring Boot | Week 9, 34 | +| | Running Piranha Embedded with Spring Boot and Project Loom | Week 10, 35 | +| | Create a Piranha Embedded GraalVM application | Week 11, 36 | +| Piranha Micro | Create a Hello World web application | Week 12, 37 | +| Piranha Server | Create a Hello World web application| Week 13, 38 | +| Piranha Servlet | Create a Faces application | Week 14, 39 | +| | Create a Hello World web application | Week 15, 40 | +| | Create a Pages application | Week 16, 41 | +| | Create a WebSocket application | Week 17, 42 | +| | Run a web application on Piranha Servlet with CRaC | Week 18, 43 | +| Piranha Web Profile | Create a Faces application| Week 19, 44 | +| | Create a Hello World web application | Week 20, 45 | +| | Create a Jakarta REST service | Week 21, 46 | +| | Testing with JUnit 5 and Playwright | Week 22, 47 | +| | Create a Jakarta Pages web application]| Week 23, 48 | +| | Testing with our container image | Week 24, 49 | diff --git a/dist/coreprofile/src/site/markdown/create_a_rest_service.md b/dist/coreprofile/src/site/markdown/create_a_rest_service.md index 99727f25b..a7e84b5c7 100644 --- a/dist/coreprofile/src/site/markdown/create_a_rest_service.md +++ b/dist/coreprofile/src/site/markdown/create_a_rest_service.md @@ -1,6 +1,7 @@ # Create a REST service -If you are looking to create a REST service with Piranha then consider Piranha Core Profile. It features a runtime ideally suited for REST and micro services. +If you are looking to create a REST service with Piranha then consider Piranha +Core Profile. It features a runtime ideally suited for REST and micro services. In 6 steps you will learn how to create the REST service. They are: @@ -13,7 +14,8 @@ In 6 steps you will learn how to create the REST service. They are: ## Create the Maven POM file -Create an empty directory to store your Maven project. Inside of that directory create the ```pom.xml``` file with the content as below. +Create an empty directory to store your Maven project. Inside of that directory +create the ```pom.xml``` file with the content as below. ```xml @@ -23,19 +25,19 @@ Create an empty directory to store your Maven project. Inside of that directory xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - cloud.piranha.guides.coreprofile + example rest - 24.11.0-SNAPSHOT + 1-SNAPSHOT war - Piranha Core Profile - REST service + Create a REST service 11.0.0-M4 - 17 - 5.10.0-M1 - 3.11.0 - 3.0.0 - 3.3.2 - 23.6.0 + 21 + 5.11.3 + 3.13.0 + 3.5.2 + 3.4.0 + 23.11.0 UTF-8 @@ -124,7 +126,8 @@ Create an empty directory to store your Maven project. Inside of that directory ## Add the application class -Add the Application class in the `src/main/java` directory, which allows you to set the application path using the @ApplicationPath annotation. +Add the Application class in the `src/main/java` directory, which allows you to +set the application path using the @ApplicationPath annotation. ```java package rest; @@ -139,7 +142,8 @@ public class RestApplication extends Application { ## Add the endpoint -And we are adding a simple 'Hello World' endpoint that is listening on the `/helloworld` path. +And we are adding a simple 'Hello World' endpoint that is listening on the +`/helloworld` path. ```java package rest; @@ -161,7 +165,8 @@ public class HelloWorldBean { ## Add an integration test -As we want to make sure the application gets tested before we release an integration test is added which will be executed as part of the build. +As we want to make sure the application gets tested before we release an +integration test is added which will be executed as part of the build. We'll add the integration test to the `src/test/java` directory. @@ -193,7 +198,9 @@ class HelloWorldIT { ## Test the application -The application is setup to use JUnit to do integration testing using the Piranha Maven plugin so when you are building the application it will also execute an integration test validating the endpoint works. +The application is setup to use JUnit to do integration testing using the +Piranha Maven plugin so when you are building the application it will also +execute an integration test validating the endpoint works. To build and test the application execute the following command: @@ -208,7 +215,9 @@ To deploy your application you will need 2 pieces. 1. The Piranha Core Profile runtime JAR. 2. The WAR file you just produced. -For the WAR file see the `target` directory. For the Piranha Core Profile distribution go to Maven Central. And then the following command line will deploy your application: +For the WAR file see the `target` directory. For the Piranha Core Profile +distribution go to Maven Central. And then the following command line will +deploy your application: ```bash java -jar piranha-dist-coreprofile.jar --war-file rest.war @@ -217,10 +226,3 @@ For the WAR file see the `target` directory. For the Piranha Core Profile distri ## Conclusion As you can see getting started with Piranha Core Profile does not have to take long. - -## References - -1. [Piranha Core Profile](index.html) -1. [Piranha Maven plugin documentation](../maven-plugin/index.html) - -[Up](index.html)