Skip to content
Ameen Abozaid
In reviewJNR-007-L06

Demo: one JAR, three environments

  • Lesson 6 of 6
  • 11 min read
  • Junior
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

  1. Build shop-cli.jar once.
  2. Run with the default file: currency EUR, tax 19%.
  3. Run with SHOP_TAX_RATE=0.07; the output changes.
  4. Planned mistake: commit a .env with a real key; spot it in git status. Fix: remove it from the index, add it to .gitignore, rotate the key, and commit .env.example.
  5. Run a third time with -Dshop.currency=USD.
  6. 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.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.