This document discusses how to bootstrap microservices using Maven archetypes. It describes how a software company called Nabenik evolved their approach from using custom POMs and sample projects to developing Maven archetypes. The key benefits of archetypes are that they provide a standardized starting project template with curated dependencies and allow easy creation of new microservices by generating projects from the archetype. The document concludes with an overview of how to create a microservices archetype by starting with a base project, converting it to an archetype, replacing strings, and testing the new archetype.
6. Microservice Chassis bootstrap
The Nabenik’s way for microservices
• Nabenik is a Java shop with Java EE trained developers
• Apps evolving since 2014 -e.g. ERP, POS with geofence-
• Development studio
• A typical Nabenik service includes
• Support for Java 11 and sometimes Kotlin
• Java EE / Jakarta EE runtime (often Payara Micro)
• MicroProfile
• Data persistence with DeltaSpike Data + persistence.xml + JTA Data source
• Log management with SLF4J with CDI provider
• Docker + Kubernetes lifecycle with Eclipse JKube and yaml descriptors
5
7. Microservice Chassis starters
Our journey to bootstrap microservices
1. Custom tailored pom.xml based on experience (THE reference pom)
2. Starters with specific instructions for add-ons
3. Sample project with curated dependencies
4. Archetypes
6
8. THE reference pom
• Inherited from EAR
era
• Good to centralize
dependencies
version
• Difficult to
maintain without
breaking existing
projects
7
10. Sample project
• ”Rightsized” for
our need
• We manually
replaced package
name, app name
and version each
time
• Difficult to bump
versions
9
11. Archetype
• Based on project
template
• Available in
internal artifact
repo (and Maven
Central)
• Curated set of
dependencies and
runtime
• ”Rightzised” for
each new
microservice
10
13. Creating a microservice archetype - Demo
1. Create a base project
2. Use maven archetype create-from-project
3. Replace important strings with templates -e.g. Package name, app name,
variable names-
4. Filter non-maven resources manually
5. Test the new archetype
6. Upload your artifact to a repository (another presentation by itself)
11
14. Víctor Orozco
• vorozco@nabenik.com
• @tuxtor
• http://vorozco.com
• http://tuxtor.shekalug.org
This work is licensed under
Creative Commons Attribution-
NonCommercial-ShareAlike 3.0
Guatemala (CC BY-NC-SA 3.0 GT).
12