Demo: one JAR, three environments
On This Lesson 3 topics
The content for this lesson is written and waiting for review. The outline below shows what it covers. It will be published once it is approved.
In this lesson
run the same JAR with dev, test, and prod settings. Prepares JNR-007-LAB1.
Draft outline details
Step by step
- Build
shop-cli.jaronce. - Run with the default file: currency
EUR, tax 19%. - Run with
SHOP_TAX_RATE=0.07; the output changes. - Planned mistake: commit a
.envwith a real key; spot it ingit status. Fix: remove it from the index, add it to.gitignore, rotate the key, and commit.env.example. - Run a third time with
-Dshop.currency=USD. - Show the precedence order in the README.
Check your understanding
Did we rebuild between runs?
Show answer
No; same JAR, different configuration.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.