설치 가이드
ElastiCORE 설치 및 개발 환경 설정 방법을 단계별로 안내합니다.
시스템 요구 사항
필수
- Java 11 이상 ☕ (권장: JDK 17+)
- Gradle 7.x 이상 또는 Maven 3.6+ 🏗️
- Spring Boot: 3.x
권장
- Java 17 이상
- Gradle 8.x 이상
- Spring Boot 3.4 이상
설치
방법 1: Gradle 설정 (권장)
1. 프로젝트 생성
mkdir my-elasticore-project
cd my-elasticore-project
gradle init --type java-application
2. build.gradle 설정
build.gradle
import org.gradle.api.tasks.JavaExec
import org.gradle.jvm.toolchain.JavaLanguageVersion
plugins {
id 'java'
id 'org.springframework.boot' version '3.5.0'
id 'io.spring.dependency-management' version '1.1.7'
}
group = 'com.example.myproject'
version = '0.0.1-SNAPSHOT'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configurations {
compileOnly {
extendsFrom annotationProcessor
}
}
repositories {
mavenCentral()
maven { url 'https://repo.spring.io/release' }
}
ext {
set('elcoreVersion', '1.8.250922-SNAPSHOT')
}
dependencies {
// Spring Boot
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'
// ElastiCORE
implementation "io.elasticore:elasticore-base:${elcoreVersion}"
implementation "io.elasticore.springboot3:elasticore-springboot3:${elcoreVersion}"
// 데이터베이스 (개발용 H2)
runtimeOnly 'com.h2database:h2'
// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
// 테스트
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
// ElastiCORE 코드 생성 태스크
tasks.register('elcore', JavaExec) {
compileJava.enabled = false
classpath = sourceSets.main.runtimeClasspath
mainClass = 'io.elasticore.base.extract.ModelExtractor'
standardInput = System.in
doFirst {
def mode = "default"
project.gradle.startParameter.taskNames.each { taskName ->
if (taskName != "elcore") mode = taskName
}
jvmArgs = ['-Dfile.encoding=UTF-8', "-Dmode=${mode}"]
args "$projectDir/src/main/java"
}
}
gradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(elcore)) {
compileJava.enabled = false
} else {
compileJava.enabled = true
}
}
tasks.named('test') {
useJUnitPlatform()
}
프로젝트 구조 설정
1. 소스 디렉토리 생성
mkdir -p src/main/java/com/example/myproject
mkdir -p src/main/resources/blueprint
mkdir -p src/test/java/com/example/myproject
2. 메인 애플리케이션 클래스 생성
src/main/java/com/example/myproject/Application.java
package com.example.myproject;
import io.elasticore.springboot3.EnableElastiCore;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableElastiCore // ElastiCORE 활성화
@SpringBootApplication
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
3. 애플리케이션 설정
src/main/resources/application.yml
spring:
application:
name: my-elasticore-project
datasource:
url: jdbc:h2:mem:testdb
driver-class-name: org.h2.Driver
username: sa
password:
jpa:
hibernate:
ddl-auto: update
show-sql: true
properties:
hibernate:
format_sql: true
h2:
console:
enabled: true
server:
port: 8080
logging:
level:
io.elasticore: DEBUG
com.example.myproject: DEBUG
설치 확인
1. ElastiCORE 코드 생성 실행
./gradlew elcore
모델 생성이 정상적으로 시작되면 다음과 같은 출력이 표시됩니다:
______ _ _ _ _____ ____ _____ ______
| ____|| | | | (_) ___|/ __ \| __ \| ____|
| |__ | | __ _ ___| |_ _ | | | | | | |__) | |__
| __| | | / _` |/ __| __| || | | | | | _ /| __|
| |____|| || (_| |\__ \ |_| || |___| |__| | | \ \| |____
|______||_| \__,_||___/\__|_||_____|\____/|_| \_\______|
ElastiCORE v1.6.7-SNAPSHOT - Ready for code generation!
2. 프로젝트 빌드
./gradlew build
3. 애플리케이션 실행
./gradlew bootRun
4. 확인
브라우저에서 다음 URL에 접속하여 확인합니다:
- 애플리케이션: http://localhost:8080
- H2 콘솔: http://localhost:8080/h2-console
문제 해결
자주 발생하는 오류
1. Java 버전 오류
Error: LinkageError occurred while loading main class
해결 방법: Java 17 이상을 사용하고 있는지 확인합니다:
java -version
2. 블루프린트 디렉토리 오류
ElastiCORE: No blueprint directory found
해결 방법: src/main/resources/blueprint 디렉토리를 생성합니다.
도움 받기
설치 중 문제가 발생하면:
- 공식 문서: ElastiCORE 문서
- 이메일 지원: elasticore@xsolcorpkorea.com
- 이메일 지원: support@elasticore.io
다음 단계
설치가 완료되었으면 첫 번째 프로젝트를 만들어 보세요!
💡 개발 팁
ElastiCORE를 보다 편리하게 개발하려면:
- IntelliJ IDEA: Lombok 플러그인 설치 (권장)
- VS Code: Java Extension Pack 설치
- Eclipse: Lombok 설치 가이드 참조