Skip to main content
ElastiCORE 3.0 is a release candidate: 3.0.261022-rc1 on Maven Central. Projects on the 2.2 line: see the 2.2 documentation.
Version: 3.0

Installation

ElastiCORE is on Maven Central, the Gradle plugin included. A project needs three things: the io.elasticore plugin, the generator io.elasticore:elasticore-base, and the runtime library for its Spring Boot version.

Requirements​

  • Java 17 or later for your project.
  • Gradle 8.14 or later with Spring Boot 4 (what Boot 4's Gradle plugin requires).
  • Spring Boot 3.x or 4.x - the plugin reads the Boot version and follows it.

What is published​

ArtifactCoordinates
Gradle pluginid 'io.elasticore' (io.elasticore:elasticore-gradle-plugin)
Generatorio.elasticore:elasticore-base
Runtime library, Spring Boot 4io.elasticore.springboot4:elasticore-springboot4
Runtime library, Spring Boot 3io.elasticore.springboot3:elasticore-springboot3

The current release candidate is 3.0.261022-rc1. Use the same version for the plugin, the generator and the runtime library.

settings.gradle​

Name Maven Central for plugins too:

settings.gradle
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}

build.gradle​

build.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '4.0.8' // 3.x works too - the version is read and followed
id 'io.spring.dependency-management' version '1.1.7'
id 'io.elasticore' version '3.0.261022-rc1'
}

repositories {
mavenCentral()
}

elasticore {
architecture = 'hexagonal' // layered | ddd | hexagonal
language = 'java' // java | kotlin
}

dependencies {
implementation 'io.elasticore:elasticore-base:3.0.261022-rc1'
implementation 'io.elasticore.springboot4:elasticore-springboot4:3.0.261022-rc1'

implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:3.0.3'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2' // an in-memory database to try it with
}
Starting from Spring Initializr

Choose Spring Web, Spring Data JPA, Validation, Lombok and H2 (its default Boot 4.1.1 works too). Keep its build.gradle - its generated test needs the test lines - and add what it lacks: the io.elasticore plugin line, the elasticore block, the two ElastiCORE dependencies and springdoc.

The elasticore { } block selects the 3.0 rule engine​

The block is what switches a build to the 3.0 rule engine (elcore3). Without it, or with a block that sets none of architecture, language or rules, the build runs the 2.x generator and produces exactly what 2.x produced - that is the compatibility promise for existing projects.

SettingValuesDefault
architecturelayered, ddd, hexagonal(none: 2.x generator)
languagejava, kotlin(none)
rulesextra rulesets, e.g. ['ossie-export'] or your team's classnone
typescriptClienttrue runs elcore3ts with the buildfalse
springBoot'4' when the Boot plugin is not applied and cannot be readread from the Boot plugin
Pick hexagonal or ddd for a new project

The 2.x generator ignores @access, @owner, @password, @login, states:, @compute and @snapshot without a warning. On the rule engine, layered in Java keeps the 2.x-compatible output too (the generator warns that the selected rules do not enforce access). Lifecycles and derived values need ddd or hexagonal. See Architectures.

Building ElastiCORE from source​

To use a build of your own instead, run ./gradlew publishToMavenLocal in a clone of the repository - on a JDK 17 to 22; the build downloads the JDK 8 and 17 toolchains it compiles with if the machine lacks them - and put mavenLocal() first in both repository lists.

Next: your first project.