본문 바로가기

Backend/Spring

Spring Boot Banner.txt (프로젝트 타이틀 콘솔 출력)

Spring Boot 프로젝트를 생성하고 실행하면 아래 사진과 같은 배너를 확인할 수 있어요.

이 배너를 바꿔보려고 해요.

 

 

src/main/resources 경로에 banner.txt 파일을 생성해주고 내용을 입력해주세요.

 

 

banner.txt

아래 내용을 그대로 복사하여 banner.txt에 붙여넣어보세요.

 

                                                                                
,--.  ,--.         ,--. ,--.           ,--.   ,--.                 ,--.    ,--. 
|  '--'  |  ,---.  |  | |  |  ,---.    |  |   |  |  ,---.  ,--.--. |  |  ,-|  | 
|  .--.  | | .-. : |  | |  | | .-. |   |  |.'.|  | | .-. | |  .--' |  | ' .-. | 
|  |  |  | \   --. |  | |  | ' '-' '   |   ,'.   | ' '-' ' |  |    |  | \ `-' | 
`--'  `--'  `----' `--' `--'  `---'    '--'   '--'  `---'  `--'    `--'  `---'  

${AnsiColor.BRIGHT_GREEN}:: Spring Boot ::${AnsiColor.DEFAULT}${spring-boot.formatted-version}

 

실행 화면입니다.

 

 

banner.txt 파일에서 자동완성 단축키(ctrl + space)를 누르면 아래와 같은 창이 뜹니다.

글자색 뿐만 아니라 배경색도 지정할 수 있구요.

 

 

그외 애플리케이션, 부트 관련 속성도 사용할 수 있어요.

각 속성에 대한 : 예시 값도 적어놨습니다.

${application.formatted-version} : (v1.0.0)
${application.title} : My application
${application.version} : 1.0.0
${spring-boot.formatted-version} : (v2.2.5.RELEASE)
${spring-boot.version} : 2.2.5.RELEASE

배너 이쁘게 생성해주는 사이트 참고

위에 Hello World 글자 제가 그린거 아니에요.

 

https://devops.datenkollektiv.de/banner.txt

 

Spring Boot banner.txt generator

 

devops.datenkollektiv.de

http://patorjk.com/software/taag

 

Text to ASCII Art Generator (TAAG)

 

patorjk.com

 

application.yml 에 다음과 같은 설정도 사용해보세요.

요건 안써봐서 자세한 설명은 나중에 시간되면 공부해서 적어볼게요.

정말 애정이 넘치는 프로젝트가 아닌 한 이 정도까지 사용할지는 모르겠네요 ㅋㅋ

 

spring:
  banner:
    charset: UTF-8
    location: classpath:banner.txt
    image:
      location: classpath:banner.gif
      bitdepth: 1
      invert: false
      margin: 2
      pixelmode: text
      width: 5
      height: 5