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
| Artifact | Coordinates |
|---|---|
| Gradle plugin | id 'io.elasticore' (io.elasticore:elasticore-gradle-plugin) |
| Generator | io.elasticore:elasticore-base |
| Runtime library, Spring Boot 4 | io.elasticore.springboot4:elasticore-springboot4 |
| Runtime library, Spring Boot 3 | io.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:
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
build.gradle
- Spring Boot 4
- Spring Boot 3
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
}
On Spring Boot 3 (checked with 3.5.16) four things differ: the Boot plugin 3.5.16,
io.elasticore.springboot3:elasticore-springboot3 instead of ...springboot4,
spring-boot-starter-web instead of -webmvc, and springdoc 2.8.17 instead of 3.0.3.
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.16'
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.springboot3:elasticore-springboot3:3.0.261022-rc1'
implementation 'org.springframework.boot:spring-boot-starter-web'
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:2.8.17'
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
}
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.
| Setting | Values | Default |
|---|---|---|
architecture | layered, ddd, hexagonal | (none: 2.x generator) |
language | java, kotlin | (none) |
rules | extra rulesets, e.g. ['ossie-export'] or your team's class | none |
typescriptClient | true runs elcore3ts with the build | false |
springBoot | '4' when the Boot plugin is not applied and cannot be read | read from the Boot plugin |
hexagonal or ddd for a new projectThe 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.