
Maven Dependency Scopes Explained With Examples and Traps
What compile, provided, runtime and test scopes mean, which classpaths each one joins, how scope changes transitively and where the import scope fits.
Everything you need to level up your coding skills.

What compile, provided, runtime and test scopes mean, which classpaths each one joins, how scope changes transitively and where the import scope fits.

Read large JDBC result sets without running out of memory: setFetchSize, streaming cursors in PostgreSQL and MySQL, and transaction needs.

Fix java.lang.OutOfMemoryError Java heap space by deciding whether the heap is too small or something is leaking, using a heap dump to tell the two apart.

Fix the Jackson error about Java 8 date/time types by registering the time module, choosing ISO strings over timestamps and setting the format in one place.

Bind application.yml values to typed Java records with @ConfigurationProperties: prefixes, nested objects, lists, durations, defaults and relaxed names.

Compare constructor, setter and field injection in Spring on immutability, testing, circular dependencies and required versus optional collaborators.

Enforce package and module boundaries in Java with ArchUnit rules and Spring Modulith's verify, so architecture decisions fail the build instead of drifting.

A Java security checklist to run before release: dependencies, secrets, authentication, input handling, transport, logging and containers.

Decide between volatile, synchronized and atomic classes for shared state, with the counter example that shows why volatile alone is not enough.

Compare the Core Profile, Web Profile and full Platform of Jakarta EE, see which specifications each includes and choose the smallest one you need.

Use SpringBootTest without slow suites: share contexts, avoid DirtiesContext, trim the context, use slices and share containers.

Compare the G1, ZGC, Shenandoah, Parallel and Serial collectors on pauses, throughput and footprint, and pick one with a test on your own workload.
We send one email when a new post is published. No spam.