반응형
반응형
프로젝트 구조 build.gradle buildscript { repositories { mavenCentral() } dependencies { classpath "gradle.plugin.com.ewerk.gradle.plugins:querydsl-plugin:1.0.10" } } plugins { id 'java' id 'war' id 'org.springframework.boot' version '2.7.14' id 'io.spring.dependency-management' version '1.1.2' id 'com.ewerk.gradle.plugins.querydsl' version '1.0.10' // Querydsl 플러그인 추가 } group = 'com.naya' version = '0..
Spring Boot 및 Spring Data JPA 프로젝트의 구조를 잘 구성하는 것은 프로젝트의 확장성과 유지 관리성을 향상시키는 데 중요합니다. 아래에 제안하는 전형적인 프로젝트 구조를 참고하실 수 있습니다. 프로젝트 구조의 주요 구성 요소: Controller: 사용자의 HTTP 요청을 처리하고 응답을 생성하는 역할을 합니다. 주로 @Controller나 @RestController 어노테이션이 지정된 클래스입니다. src/ └── main/ └── java/ └── com/ └── example/ └── controller/ Service: 비즈니스 로직을 수행하는데 사용됩니다. 서비스 계층은 컨트롤러와 리포지토리 사이에서 중간 역할을 합니다. 주로 @Service 어노테이션이 지정된 클래스입니..
IntelliJ IDEA를 사용하여 스프링 부트(Spring Boot) 기반의 웹 애플리케이션을 개발하며, JPA(Java Persistence API)를 통해 MySQL 데이터베이스를 사용하고 Thymeleaf를 사용하여 간단한 게시판의 CRUD(Create, Read, Update, Delete) 기능을 구현하는 과정을 설명합니다. 이 프로젝트를 만들기 위한 단계별 가이드입니다. 전제 조건: - IntelliJ IDEA 설치 - JDK 11 설치 - 스프링 부트 프로젝트 생성 및 설정 - MySQL 데이터베이스 설치 및 설정 IntelliJ IDEA로 스프링 부트 프로젝트 생성 IntelliJ IDEA를 열고 "File" 메뉴에서 "New"를 선택한 다음 "Project"를 클릭합니다. "Spring..
JAVA 11 사용 build.gradle plugins { id 'java' id 'war' id 'org.springframework.boot' version '2.7.14' id 'io.spring.dependency-management' version '1.1.2' } group = 'com.naya' version = '0.0.1-SNAPSHOT' java { sourceCompatibility = '11' } configurations { compileOnly { extendsFrom annotationProcessor } } repositories { mavenCentral() } dependencies { implementation 'org.springframework.boot:spring..
Java 파일과 thymeleaf 템플릿 html 파일수정시 새로고침 없이 자동으로 리로드 되는 방법을 소개합니다. mac : cmd + shift +a window : ctrl + shift +a registry 검색 후 compiler.automake.allow.when.app.running 체크 setting > Build, Execution, Depoyment >Compiler Build project automatically 체크 resources > application.yml server: port: 8080 spring: datasource: driver-class-name: net.sf.log4jdbc.sql.jdbcapi.DriverSpy url: jdbc:log4jdbc:mysql:/..