Skip to content

Spring Boot facility

The spring-boot facility bundles everything that is needed to use the SpringBoot platform in your project:

  • JoinedWorkz profiles for Spring Boot–based services
  • CMN models for SpringBoot-specific types and method types
  • cartridges and generators for Spring MVC controllers, DTOs and related artefacts
  • Spring-focused strategies and helpers

Your application only needs to add the facility as a Maven dependency. The JoinedWorkz generator plugin discovers the profiles, CMN models and implementations on the classpath and uses them during parsing, validation and generation.

This page describes how to enable and use the SpringBoot platform via the Spring Boot facility. For the generated architecture and conventions of the SpringBoot platform, see the platform.md file.

1. Relationship to Base and Java

The Spring Boot facility builds on the common Base and Java facilities:

  • spring-boot depends on the common-java facility
  • common-java depends on common-base

In Maven this means:

  • you only declare a dependency on org.joinedworkz.facilities:spring-boot
  • Maven brings in common-java and common-base transitively

2. Adding the facility to your project

xml
<dependencies>
    <dependency>
        <groupId>org.joinedworkz.facilities</groupId>
        <artifactId>spring-boot</artifactId>
        <version>${joinedworkz.version}</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

3. Activating the SpringBoot platform in CMN models

cmn
import org.joinedworkz.facilities.profiles.spring.boot

platform SpringBoot

Layers can be assigned via package declarations:

cmn
core package com.example.customer
platform SpringBoot
cmn
api package com.example.customer.api
platform SpringBoot
cmn
backend package com.example.customer.backend
platform SpringBoot

4. Where to go next

See platform.md for architecture and conventions.