Skip to content

Commit d228ba1

Browse files
authored
Merge pull request #156 from gsmet/tutorial-changes
Proofread the tutorial
2 parents d82bcdc + 8006a31 commit d228ba1

22 files changed

Lines changed: 299 additions & 326 deletions

documentation/modules/ROOT/pages/01_setup.adoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Please have them installed and configured before you get started with any of the
5555
| `brew install maven`
5656
| `dnf install maven`
5757
| https://maven.apache.org/download.cgi[Windows] (Make sure you set the `MAVEN_HOME` environment variable and add `%MAVEN_HOME%\bin` to your `PATH`)
58-
| **GraalVM [Optional *]**
59-
| https://www.graalvm.org/latest/docs/getting-started/macos/[Download & install GraalVM for MacOS]
58+
| **GraalVM for Java 21 [Optional]**
59+
| https://www.graalvm.org/latest/docs/getting-started/macos/[Download & install GraalVM for macOS]
6060
| https://www.graalvm.org/latest/docs/getting-started/linux/[Download & install GraalVM for Linux]
6161
| https://www.graalvm.org/latest/docs/getting-started/windows/[Download & install GraalVM for Windows]
6262
@@ -69,14 +69,14 @@ Alternatively on Windows you can also try https://chocolatey.org/[Chocolatey] wh
6969
[.console-input]
7070
[source,bash,subs="+macros,+attributes"]
7171
----
72-
curl -s "https://get.sdkman.io" | bash
73-
source "$HOME/.sdkman/bin/sdkman-init.sh"
74-
.
75-
sdk install java
76-
sdk install maven
77-
sdk install quarkus
78-
sdk install java 21.0.3-tem
79-
sdk install jbang
72+
curl -s "https://get.sdkman.io" | bash
73+
source "$HOME/.sdkman/bin/sdkman-init.sh"
74+
75+
sdk install java
76+
sdk install maven
77+
sdk install quarkus
78+
sdk install java 21.0.3-tem
79+
sdk install jbang
8080
----
8181
=====
8282
--

documentation/modules/ROOT/pages/02_basics.adoc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
====
99
1010
Maven::
11-
+
11+
+
1212
--
1313
[.console-input]
1414
[source,bash,subs="+macros,+attributes"]
@@ -20,11 +20,11 @@ cd {project-name}
2020
Quarkus CLI::
2121
+
2222
--
23-
The quarkus CLI tool lets you create projects, manage extensions and do essential dev, build and deploy commands using the underlying project build tool in a simplified way.
23+
The quarkus CLI tool lets you create projects, manage extensions and do essential dev, build and deploy commands using the underlying project build tool in a simplified way.
2424
2525
Follow these instructions to install Quarkus CLI: https://quarkus.io/guides/cli-tooling
2626
27-
Then create the application:
27+
Then create the application:
2828
[.console-input]
2929
[source,bash,subs="+macros,+attributes"]
3030
----
@@ -49,7 +49,7 @@ Or else if you're a CLI person, you can run a `curl` command like:
4949
[.console-input]
5050
[source,bash]
5151
----
52-
curl localhost:8080/hello
52+
curl -w '\n' localhost:8080/hello
5353
----
5454

5555
[.console-output]
@@ -83,7 +83,7 @@ You can run the test in your IDE or by running the following:
8383
[tabs%sync]
8484
====
8585
Maven::
86-
+
86+
+
8787
--
8888
[.console-input]
8989
[source,bash,subs="+macros,+attributes"]
@@ -132,7 +132,7 @@ Let's start the _Live Coding_ mode by using the `dev` command. You probably won'
132132
[tabs%sync]
133133
====
134134
Maven::
135-
+
135+
+
136136
--
137137
[.console-input]
138138
[source,bash,subs="+macros,+attributes"]
@@ -152,7 +152,7 @@ quarkus dev
152152
--
153153
====
154154

155-
NOTE: By default Quarkus uses 'localhost' for the dev mode host setting. If you are working in a remote development environment, you may need to set the host to 0.0.0.0 by appending `-D"quarkus.http.host=0.0.0.0"` to the above command.
155+
NOTE: By default Quarkus uses 'localhost' for the dev mode host setting. If you are working in a remote development environment, you may need to set the host to 0.0.0.0 by appending `-D"quarkus.http.host=0.0.0.0"` to the above command.
156156

157157
== Dev UI
158158

@@ -182,6 +182,6 @@ Press `r` and the tests will start running. You should see the status change dow
182182
All 1 test is passing (0 skipped), 1 test was run in 11705ms. Tests completed at 16:02:32.
183183
----
184184

185-
TIP: If you don’t want to have continuous testing enabled, you can change this by adding `quarkus.test.continuous-testing=disabled` to your `src/main/resources/application.properties`.
185+
TIP: If you don’t want to have continuous testing enabled, you can change this by adding `quarkus.test.continuous-testing=disabled` to your `src/main/resources/application.properties`.
186186

187-
You can find more details about controlling continuous testing in https://quarkus.io/guides/continuous-testing#controlling-continuous-testing[this guide].
187+
You can find more details about controlling continuous testing in https://quarkus.io/guides/continuous-testing#controlling-continuous-testing[this guide].

documentation/modules/ROOT/pages/03_configuration.adoc

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= Configuration
22

3-
Hardcoded values in your code is a no go, so let's see how to add configuration to your application.
3+
Hardcoded values in your code is a no go, so let's see how to add configuration to your application.
44
Quarkus relies on the MicroProfile Config specification and the main configuration file is `application.properties`.
55

66
== Using a config property in your code
@@ -38,23 +38,17 @@ If you refresh your browser pointing to http://localhost:8080/hello[window="_bla
3838
[.console-output]
3939
[source,text]
4040
----
41-
jakarta.enterprise.inject.spi.DeploymentException: No config value of type [java.lang.String] exists for: greeting
42-
at io.quarkus.arc.runtime.ConfigRecorder.validateConfigProperties(ConfigRecorder.java:37)
43-
at io.quarkus.deployment.steps.ConfigBuildStep$validateConfigProperties61.deploy_0(ConfigBuildStep$validateConfigProperties61.zig:120)
44-
at io.quarkus.deployment.steps.ConfigBuildStep$validateConfigProperties61.deploy(ConfigBuildStep$validateConfigProperties61.zig:36)
45-
at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:166)
46-
at io.quarkus.runtime.Application.start(Application.java:89)
47-
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:90)
48-
at io.quarkus.runtime.Quarkus.run(Quarkus.java:61)
49-
at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
50-
at io.quarkus.runtime.Quarkus.run(Quarkus.java:106)
51-
at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)
52-
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
53-
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
54-
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
55-
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
56-
at io.quarkus.runner.bootstrap.StartupActionImpl$1.run(StartupActionImpl.java:99)
57-
at java.base/java.lang.Thread.run(Thread.java:834)
41+
io.quarkus.runtime.configuration.ConfigurationException: Failed to load config value of type class java.lang.String for: greeting
42+
at io.quarkus.arc.runtime.ConfigRecorder.validateConfigProperties(ConfigRecorder.java:70)
43+
at io.quarkus.deployment.steps.ConfigBuildStep$validateConfigValues1665125174.deploy_0(Unknown Source)
44+
at io.quarkus.deployment.steps.ConfigBuildStep$validateConfigValues1665125174.deploy(Unknown Source)
45+
at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
46+
at io.quarkus.runtime.Application.start(Application.java:101)
47+
at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:111)
48+
at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
49+
at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
50+
at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
51+
at io.quarkus.runner.GeneratedMain.main(Unknown Source)
5852
----
5953

6054
Which is expected, since we didn't provide the `greeting` property neither at the `application.properties` file nor with some runtime configuration.
@@ -78,7 +72,7 @@ You can also use `curl` to check the same result:
7872
[.console-input]
7973
[source,bash]
8074
----
81-
curl localhost:8080/hello
75+
curl -w '\n' localhost:8080/hello
8276
----
8377

8478
[.console-output]
@@ -87,9 +81,9 @@ curl localhost:8080/hello
8781
Hello y'all!
8882
----
8983

90-
== Update your integration test
84+
== Update your test
9185

92-
Since we changed the output of our `/hello` endpoint, our integration test doesn't pass anymore.
86+
Since we changed the output of our `/hello` endpoint, our test doesn't pass anymore.
9387

9488
Let's update `GreetingResourceTest` to reflect our recent changes:
9589

@@ -136,7 +130,7 @@ Now run your tests to check if everything is ok:
136130
[tabs]
137131
====
138132
Maven::
139-
+
133+
+
140134
--
141135
[.console-input]
142136
[source,bash,subs="+macros,+attributes"]
@@ -177,7 +171,7 @@ quarkus test
177171
[tabs]
178172
====
179173
Maven::
180-
+
174+
+
181175
--
182176
[.console-input]
183177
[source,bash,subs="+macros,+attributes"]

documentation/modules/ROOT/pages/04_panache.adoc

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
:project-name: tutorial-app
44

55
[#quarkusp-demo-overview]
6-
== Demo Overview
6+
== Demo Overview
77

88
You'll learn how easy and productive Quarkus is with Hibernate with Panache. For this, we'll develop a simple CRUD REST API that handles information about fruits.
99

@@ -21,12 +21,12 @@ Just open a new terminal window, and make sure you're at the root of your `{proj
2121
[tabs]
2222
====
2323
Maven::
24-
+
24+
+
2525
--
2626
[.console-input]
2727
[source,bash,subs="+macros,+attributes"]
2828
----
29-
./mvnw quarkus:add-extension -Dextension="rest-jsonb, jdbc-h2, hibernate-orm-panache, smallrye-openapi"
29+
./mvnw quarkus:add-extension -Dextension="rest-jackson, jdbc-h2, hibernate-orm-panache, smallrye-openapi"
3030
----
3131
3232
--
@@ -36,7 +36,7 @@ Quarkus CLI::
3636
[.console-input]
3737
[source,bash,subs="+macros,+attributes"]
3838
----
39-
quarkus extension add rest-jsonb jdbc-h2 hibernate-orm-panache smallrye-openapi
39+
quarkus extension add rest-jackson jdbc-h2 hibernate-orm-panache smallrye-openapi
4040
----
4141
--
4242
====
@@ -45,7 +45,7 @@ quarkus extension add rest-jsonb jdbc-h2 hibernate-orm-panache smallrye-openapi
4545
[.console-output]
4646
[source,text]
4747
----
48-
✅ Adding extension io.quarkus:quarkus-rest-jsonb
48+
✅ Adding extension io.quarkus:quarkus-rest-jackson
4949
✅ Adding extension io.quarkus:quarkus-smallrye-openapi
5050
✅ Adding extension io.quarkus:quarkus-hibernate-orm-panache
5151
✅ Adding extension io.quarkus:quarkus-jdbc-h2
@@ -144,7 +144,7 @@ Now we should have everything in place to query our *GET* REST endpoint:
144144
[.console-input]
145145
[source,bash]
146146
----
147-
curl localhost:8080/fruit
147+
curl -w '\n' localhost:8080/fruit
148148
----
149149

150150
[.console-output]
@@ -190,20 +190,19 @@ public class FruitResource {
190190
@Consumes(MediaType.APPLICATION_JSON)
191191
@Produces(MediaType.APPLICATION_JSON)
192192
public Response newFruit(Fruit fruit) {
193-
fruit.id = null;
194193
fruit.persist();
195194
return Response.status(Status.CREATED).entity(fruit).build();
196195
}
197196
198197
}
199198
----
200199

201-
Now you can insert a new fruit by using `curl`:
200+
Now you can insert a new fruit by using `curl`:
202201

203202
[.console-input]
204203
[source,bash]
205204
----
206-
curl -d "{\"name\": \"Banana\", \"season\": \"Summer\"}" -H "Content-Type: application/json" http://localhost:8080/fruit
205+
curl -w '\n' -d "{\"name\": \"Banana\", \"season\": \"Summer\"}" -H "Content-Type: application/json" http://localhost:8080/fruit
207206
----
208207

209208
[.console-output]
@@ -237,16 +236,16 @@ Create the file `import.sql` in the folder `src/main/resources` with the followi
237236
[.console-input]
238237
[source,sql]
239238
----
240-
create sequence fruit_sequence start with 1 increment by 1;
241-
INSERT INTO Fruit(id,name,season) VALUES (nextval('fruit_sequence'),'Mango','Spring');
242-
INSERT INTO Fruit(id,name,season) VALUES (nextval('fruit_sequence'),'Strawberry','Spring');
243-
INSERT INTO Fruit(id,name,season) VALUES (nextval('fruit_sequence'),'Orange','Winter');
244-
INSERT INTO Fruit(id,name,season) VALUES (nextval('fruit_sequence'),'Lemon','Winter');
245-
INSERT INTO Fruit(id,name,season) VALUES (nextval('fruit_sequence'),'Blueberry','Summer');
246-
INSERT INTO Fruit(id,name,season) VALUES (nextval('fruit_sequence'),'Banana','Summer');
247-
INSERT INTO Fruit(id,name,season) VALUES (nextval('fruit_sequence'),'Watermelon','Summer');
248-
INSERT INTO Fruit(id,name,season) VALUES (nextval('fruit_sequence'),'Apple','Fall');
249-
INSERT INTO Fruit(id,name,season) VALUES (nextval('fruit_sequence'),'Pear','Fall');
239+
INSERT INTO Fruit(id,name,season) VALUES (1,'Mango','Spring');
240+
INSERT INTO Fruit(id,name,season) VALUES (2,'Strawberry','Spring');
241+
INSERT INTO Fruit(id,name,season) VALUES (3,'Orange','Winter');
242+
INSERT INTO Fruit(id,name,season) VALUES (4,'Lemon','Winter');
243+
INSERT INTO Fruit(id,name,season) VALUES (5,'Blueberry','Summer');
244+
INSERT INTO Fruit(id,name,season) VALUES (6,'Banana','Summer');
245+
INSERT INTO Fruit(id,name,season) VALUES (7,'Watermelon','Summer');
246+
INSERT INTO Fruit(id,name,season) VALUES (8,'Apple','Fall');
247+
INSERT INTO Fruit(id,name,season) VALUES (9,'Pear','Fall');
248+
ALTER SEQUENCE fruit_seq RESTART WITH 10;
250249
----
251250

252251
And append the following configuration in `application.properties`:
@@ -315,16 +314,16 @@ Now if you refresh your browser pointing to http://localhost:8080/fruit[window=_
315314

316315
[TIP]
317316
====
318-
You can add different `import.sql` files based on the application profile.
317+
You can add different `import.sql` files based on the application profile.
319318
320-
For example: in dev mode, you
321-
can use the configuration `quarkus.hibernate-orm.sql-load-script=import-dev.sql`,
319+
For example: in dev mode, you
320+
can use the configuration `quarkus.hibernate-orm.sql-load-script=import-dev.sql`,
322321
while in production mode you can use `quarkus.hibernate-orm.sql-load-script=import-prod.sql`.
323322
====
324323

325324
== Adding a custom finder to the `Fruit` Entity
326325

327-
Update the `Fruit` class to contain a finder method `findBySeason` like:
326+
Update the `Fruit` class to contain a finder method `findBySeason` like:
328327

329328
[#quarkusp-find-fruits]
330329
[.console-input]
@@ -403,7 +402,7 @@ Let's try to filter only the fruits with the *Summer* season:
403402
[.console-input]
404403
[source,bash]
405404
----
406-
curl localhost:8080/fruit?season=Summer
405+
curl -w '\n' localhost:8080/fruit?season=Summer
407406
----
408407

409408
[.console-output]
@@ -518,7 +517,7 @@ Let's try again to filter only the fruits with the *Spring* season:
518517
[.console-input]
519518
[source,bash]
520519
----
521-
curl localhost:8080/fruit?season=Spring
520+
curl -w '\n' localhost:8080/fruit?season=Spring
522521
----
523522

524523
[.console-output]

0 commit comments

Comments
 (0)