Scrivio Interview library
DesignIntermediate6 min read · updated 12 November 2026

Your company creates about 40 new services a year and each one starts from a copy of an older service, carrying outdated plugins and configuration. How would you provide a better starting point?

We replace copy-and-modify with a maintained template: a custom archetype, an internal Spring Initializr instance, or a template repository in a developer portal such as Backstage software templates. Most configuration lives in a shared parent POM and BOM, so the template stays small and upgrades still reach services after they are created. The template includes the wrapper, CI pipeline, Dockerfile, observability and security defaults and a README with ownership; CI generates and builds a project from it on every change, and we measure adoption and drift.

Why this question is asked

Copying the last service is the fastest way to start a new one, which is why everyone does it. The cost is invisible at first: each copy carries the old service's plugin versions, workarounds and dead configuration, and the company's 40 new services a year slowly multiply its technical debt. Interviewers ask this because the solution is part tooling and part product thinking. In this answer, we will see why copying fails, choose a template mechanism, decide what goes in the template and what belongs in the parent, keep the template healthy with tests, and measure whether it works.

1Why Copying an Old Service Goes Wrong

When a developer starts a service by copying orders-service, they get everything orders-service has: its Spring Boot version from last year, a plugin pinned to work around a bug fixed since, a logging configuration someone changed for one incident, and dependencies the new service will never use. They delete what they recognise and keep the rest, because nobody knows which parts are safe to remove.

Multiply that by 40 services a year, each copied from a different older one, and the company ends up with dozens of slightly different build setups. Every later upgrade has to deal with all of them. So the goal is a starting point that is current, minimal and maintained by someone.

2Choosing a Template Mechanism

There are three common mechanisms. A custom Maven archetype is a template published as a Maven artifact and generated with mvn archetype:generate; it is simple and familiar, but limited to file templates. An internal Spring Initializr instance is the open source Initializr run by the company with its own defaults and dependencies; developers get the familiar start.spring.io experience and IDE integration. A template in a developer portal, such as Backstage software templates, can do more than create files: it can create the Git repository, register the service in the catalogue, set up the CI pipeline and assign the owning team in one step.

For a company creating 40 services a year, the portal template is often worth it, because creating the repository and pipeline by hand is a large share of the first day's work. A smaller company might start with an internal Initializr and add the portal later.

Three ways to provide a starting point
MechanismCreatesGood fit
Custom archetypeProject files from templatesSimple needs, Maven-only shops
Internal Spring InitializrSpring Boot project, IDE wizard supportMany Spring Boot services
Portal template, e.g. BackstageRepository, pipeline, catalogue entry and filesMany teams, self-service platform

3Keep the Template Small: Put the Rest in the Parent

The most important design choice is what the template does not contain. Anything copied into a new service is frozen at the moment of creation; anything inherited from a shared parent POM or imported from a BOM keeps improving. So plugin versions and configuration, dependency versions, compiler settings and Enforcer rules all live in the corporate parent and the platform BOM, and the template's POM is short.

XML
<!-- pom.xml generated by the template: short on purpose -->
<parent>
<groupId>com.acme</groupId>
<artifactId>acme-service-parent</artifactId> <!-- plugins, Java level, Enforcer rules -->
<version>18.2.0</version>
</parent>
<artifactId>${artifactId}</artifactId>
<dependencies>
<dependency><groupId>com.acme</groupId><artifactId>acme-starter-observability</artifactId></dependency>
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency>
</dependencies>
<!-- no versions: they come from the parent and the platform BOM -->

Notice the effect on upgrades. When the platform team moves to a new Spring Boot version, they release a new parent, and a bot opens a one-line pull request in every service, including the ones created last year. If the template had contained all that configuration, each service would need hand edits.

4What Goes Into the Template

What remains in the template is what every service needs but that cannot be inherited. That means the Maven wrapper, so the Maven version is fixed; a CI pipeline definition that calls the company's shared pipeline steps; a Dockerfile, or the Spring Boot build-image configuration, using the approved base image; observability defaults, such as Actuator health endpoints, metrics and structured logging through a company starter; security defaults, such as the company's authentication starter and dependency scanning in CI; and a README that names the owning team, the on-call rotation and how to run the service locally.

Each item should be the thinnest possible piece that calls shared code. The CI file, for example, should be ten lines that call a shared pipeline, not three hundred lines copied into every repository.

Step throughA generated service
  1. Service codethe only part the team writes
  2. Template fileswrapper, CI file, Dockerfile, README with owner
  3. Company startersobservability and security defaults
  4. Corporate parent and platform BOMplugins and versions, updated centrally

4 layers, from the top down. Step through them one at a time.

5Test the Template on Every Change

A template is code, and broken templates are a bad first experience. So the template repository has its own CI pipeline: on every change, it generates a sample project from the template, builds it, runs its tests and builds its container image.

Text
# template CI job (simplified)
$ generate-service --template acme-spring-service --name sample-svc --owner platform-team
$ cd sample-svc && ./mvnw -B -ntp verify
# [INFO] BUILD SUCCESS
$ docker build -t sample-svc:test .
# Successfully tagged sample-svc:test

We also run this job when a new parent or BOM is released, and nightly, so we notice if a dependency change breaks newly generated services before a developer does.

6Measure Adoption and Drift

Finally, we check whether it works. Adoption is the share of new services created from the template; if teams still copy old services, we ask them why and improve the template. Drift is how far services move from the template over time, for example how many still use the corporate parent, how far behind its latest version they are, and whether their CI file still calls the shared pipeline. A weekly script across repositories can report both. High drift on a particular file usually means the template got that file wrong, which is useful feedback.

7Follow-up questions

How do you handle services that need something the template does not offer?

We let teams add what they need on top of the template, and if several teams add the same thing, we bring it into the template or a shared starter. The template should cover the common case well, not every case, and it should be easy to extend without forking it.

Should the template generate a sample controller and test?

A small one, yes, such as a hello endpoint with a test and a health check, because it proves the generated service builds, runs and deploys on day one. It should be obviously a sample, easy to delete, not a framework the team must keep.

Who should own the template?

The platform or developer experience team, with a clear way for other teams to request changes. It needs a regular release cadence aligned with the parent and BOM, so that a new service never starts from a version the platform team already considers outdated.

8Conclusion

In this answer, we replaced copying old services with a maintained template, provided through a custom archetype, an internal Spring Initializr or a portal template such as Backstage. We kept the template small by putting most configuration in the shared parent and BOM, listed what the template itself should contain, tested it by generating and building a project on every change, and measured adoption and drift to know it works.

What to say in the interviewAbout 90 seconds aloud

Open with

The root problem is that every new service freezes whatever the copied service had. So I would provide a maintained starting point. The mechanism could be a custom archetype, an internal Spring Initializr instance, or a template in a developer portal such as Backstage software templates.

Then, if they want more

With 40 services a year, I would lean towards the portal, because it can also create the repository, register the service with its owner and set up the pipeline. The key design decision is to keep the template small.

Plugin versions, dependency versions, compiler settings and Enforcer rules live in the corporate parent and a platform BOM, so they keep updating after the service is created, and a bot can upgrade every service with a one-line parent bump.

The template itself contains what cannot be inherited: the Maven wrapper, a short CI file that calls shared pipeline steps, a Dockerfile with the approved base image, observability and security defaults through company starters, and a README with the owning team and how to run it.

I would test the template in CI by generating a sample service and building it on every change, on every parent release and nightly. Then I would measure adoption, how many new services use it, and drift, how far services move from it, and use high drift as feedback to fix the template.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Official documentation
Apache Maven guides
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your company creates about 40 new services a year and each one starts from a copy of an...": https://scrivio-interview-library.netlify.app/java/maven/5d8ee2333d/