gradle보다 intellij로 하는게 속도가 더 빠름(미래에는 gradle이 더 빨라질 수도? )
gradle - Build and run using : Intellij IDEA
gradle - Run and tests using : Intellij IDEA
콘솔 한글 깨짐, 테스트 코드 @DisplayName 한글 깨짐
1. File > Setting > File Encodings
UTF-8로 수정
2. C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3.3\bin
idea.exe.vmoptions, idea64.exe.vmoptions
맨 아래 줄에 추가
-Dfile.encoding=UTF-8
3. help > Edit Custom Vm Options
맨 아래에 추가
-Dfile.encoding=UTF-8
4. File > Setting > Build Tools > Gradle 에 Build and run using, Run tests using Intellij
intellij IDEA
5. 인텔리제이 재시작 후, gradle 새로고침.
롬복
1. settings
2. Build, Execution, Deployment > Compiler > Annotation Processors 메뉴
Enable annotation processing 체크
추천코드에서 설명 보이게 하는 설정
git bash Terminal에서 vi 에서 편집모드 진입 후에 esc 눌러서 명령 모드(escape) 이동이 안되는 경우 설정 방법
IntelliJ에서 Terminal(Alt-F12 또는 Option-F12) 사용 시에 git commit 메시지를 작성할 때 명령 모드 이동을 위해 esc 키를 눌렀을 때 명령 모드가 아닌 편집 창으로 이동됩니다. 이를 해결 하기 위해 단축키를 해제 또는 변경해야 합니다.
1. “File -> Settings” 메뉴 선택 후, “Tool -> Terminal” 항목으로 이동
2. 옵션 항목 중 “Override IDE shortcuts” 오른쪽에 있는 “Configure terminal keybindings” 링크 클릭
3. “Keymap” 설정에서 “Switch Focus To Editor” 항목을 단축키를 해제 또는 변경
SpellChecker 끄기 ( 주석에 영어와 한글을 붙여서 쓰는 경우 밑줄이 생기는 문제 )
1. [Files] > [Settings] [ 윈도우 단축키 [Ctrl] + [Alt] + S ]
2. [Editor] > [ Inspections 칸에서 Proofreading 검색]
3. [ Proofreading > Typo > Process comments 체크 해제 ]
코드나 리터럴에서도 밑줄이 보여 불편하다면 Process code , Process literals을 체크 해제하면 된다.
resource 아래의 정적 파일들( ex) js, css) 스프링 재시작 없이 자동 적용시키는 설정
1. build.gradle(또는 pom.xml)에 spring-boot-devtools 의존성 추가
spring.devtools.livereload.enabled는 기본적으로 true로 설정됩니다.
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools
implementation 'org.springframework.boot:spring-boot-devtools:2.6.2'
2. application.properties에서 템플릿 엔진의 cache false로 설정
각자 사용하는 템플릿엔진에 맞게 가운데를 수정(ex. thymeleaf, mustache, handlebars, ..)
spring.mustache.cache=false
3. "Preferences - Build, Execution, Deployment - Compiler"에서 "Build project automatically" 체크
4. "Preferences - Advanced Settings"에서 Compiler - "Allow auto-make to start even if deployed application is currently running" 체크
(이전 버전까지는 registry - "compiler.automake.allow.when.app.running"을 수정해야 했습니다)
5. 브라우저에서 새로고침할 때 캐시 지우고 새로 고치기 (크롬이면 cmd + shift + R)
폰드
settings - editors - font : JetBrains Mono 을 변경
import
Spring boot, 인텔리제이 import 에러 (velog.io)
cannot resolve String, cannot resolve Long 과 같은 에러 발생 시 해결
- File -> Project Structure -> Projects : SDK, Language level 을 build.gradle에서 설정한 자바 버전과 같게 설정
maven clean 오류
Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap Possible solution:
- Check your maven runner VM options. Open Maven Runner settings.
- Check your .mvn/jvm.config in module trumpia_middleware. Open jvm.config.