본문으로 건너뛰기
ElastiCORE 3.0 은 릴리스 후보(RC)입니다: Maven Central 의 3.0.261022-rc1. 2.2 라인 프로젝트는 2.2 문서를 보세요.
버전: 3.0

설치

ElastiCORE 는 Gradle 플러그인까지 Maven Central 에 있습니다. 프로젝트에 필요한 것은 세 가지입니다: io.elasticore 플러그인, 생성기 io.elasticore:elasticore-base, 그리고 Spring Boot 버전에 맞는 런타임 라이브러리.

요구 사항​

  • 내 프로젝트는 Java 17 이상.
  • Spring Boot 4 이면 Gradle 8.14 이상 (Boot 4 Gradle 플러그인의 요구).
  • Spring Boot 3.x 또는 4.x - 플러그인이 Boot 버전을 읽어 맞춰 생성합니다.

배포되는 것​

산출물좌표
Gradle 플러그인id 'io.elasticore' (io.elasticore:elasticore-gradle-plugin)
생성기io.elasticore:elasticore-base
런타임 라이브러리, Spring Boot 4io.elasticore.springboot4:elasticore-springboot4
런타임 라이브러리, Spring Boot 3io.elasticore.springboot3:elasticore-springboot3

현재 릴리스 후보는 3.0.261022-rc1 입니다. 플러그인, 생성기, 런타임 라이브러리는 같은 버전을 씁니다.

settings.gradle​

플러그인도 Maven Central 에서 받도록 적습니다:

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

build.gradle​

build.gradle
plugins {
id 'java'
id 'org.springframework.boot' version '4.0.8' // 3.x 도 됩니다 - 버전을 읽어 맞춰 생성
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' // 바로 실행해 볼 메모리 DB
}
Spring Initializr 로 시작했다면

Spring Web, Spring Data JPA, Validation, Lombok, H2 를 고릅니다 (기본값인 Boot 4.1.1 도 됩니다). 그 build.gradle 은 그대로 두고(함께 생성된 테스트가 그 파일의 테스트 의존성을 씁니다) 빠진 것만 더합니다: io.elasticore 플러그인 줄, elasticore 블록, ElastiCORE 의존성 두 줄과 springdoc.

elasticore { } 블록이 3.0 규칙 엔진을 고릅니다​

이 블록이 빌드를 3.0 규칙 엔진(elcore3)으로 바꿉니다. 블록이 없거나, architecture·language·rules 중 아무것도 적지 않으면 2.x 생성기가 생성하고, 결과는 2.x 와 같습니다 - 기존 프로젝트를 위한 호환 약속입니다.

설정값기본값
architecturelayered, ddd, hexagonal(없음: 2.x 생성기)
languagejava, kotlin(없음)
rules더할 규칙, 예: ['ossie-export'] 또는 우리 팀 클래스없음
typescriptClienttrue 면 빌드가 elcore3ts 도 실행false
springBootBoot 플러그인이 없어 버전을 읽을 수 없을 때 '4'Boot 플러그인에서 읽음
새 프로젝트는 hexagonal 이나 ddd

2.x 생성기는 @access, @owner, @password, @login, states:, @compute, @snapshot 을 경고 없이 무시합니다. 규칙 엔진에서도 Java 의 layered 는 2.x 호환 출력을 유지합니다(생성기가 권한을 강제하지 않는다고 경고). 생명주기와 파생 값은 ddd 나 hexagonal 이 필요합니다. 아키텍처 참고.

소스에서 직접 빌드하기​

저장소를 받아 ./gradlew publishToMavenLocal 을 실행하고(JDK 17~22, 컴파일에 쓰는 JDK 8·17 툴체인이 없으면 내려받습니다) 두 저장소 목록의 맨 앞에 mavenLocal() 을 넣습니다.

다음: 첫 프로젝트.