본문 바로가기

개발/Java

Base64.encodeBase64String 메서드 - Gradle 빌드에러

728x90
반응형

 

apache commons-codec-1.11 라이브러리에서 제공하는 Base64.encodeBase64String 메서드를 사용하면 로컬환경, STS에서는 문제없이 구동이 되었으나 Gradle compileJava 시 에러가 발생

Working Directory: C:\Users\developer\git\app
Gradle user home: C:\Users\developer\.gradle
Gradle Distribution: Local installation at C:\Develop\Gradle\gradle-5.5.1
Gradle Version: 5.5.1
Java Home: C:\Develop\JDK\jdk-11.0.2
JVM Arguments: None
Program Arguments: None
Build Scans Enabled: false
Offline Mode Enabled: false
Gradle Tasks: build


> Task :compileJava
C:\Users\developer\git\app\src\main\java\kr\co\app\ServiceImpl.java:84: error: cannot find symbol
			String encAuth = Base64.encodeBase64String(auth.getBytes());
			                       ^
  symbol:   method encodeBase64String(byte[])
  location: class Base64
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 31s
1 actionable task: 1 executed

 

Gradle의 문제인줄 알았으나 Base64.encodeBase64 메서드로 변경하니 문제없이 Gradle compileJava 가 수행된다.

commons-codec 라이브러리의 Base64.encodeBase64String 메서드는 사용하지 않는 것이 좋을듯하다.

 

728x90
반응형