본문 바로가기

나만의 작업/Mac

brew로 gradle 버전 업그레이드

* What went wrong:

An exception occurred applying plugin request [id: 'org.springframework.boot', version: '2.3.3.(']

> Failed to apply plugin [id 'org.springframework.boot']

   > Spring Boot plugin requires Gradle 5 (5.6.x only) or Gradle 6 (6.3 or later). The current version is Gradle 5.1

* 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

 

Spring Boot 2.3.3.RELEASE 버전에서 Gradle 5.6.X 버전이나 Gradle 6(6.3 or later)을 써야하는 에러로그를 만났다.

Mac에서 brew를 이용한 초간단 gradle upgrade 해주기.

 

현재버전 확인

# gradle --version

------------------------------------------------------------
Gradle 5.1
------------------------------------------------------------

Build time:   2019-01-02 18:57:47 UTC
Revision:     d09c2e354576ac41078c322815cc6db2b66d976e

Kotlin DSL:   1.1.0
Kotlin:       1.3.11
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on July 10 2018
JVM:          11.0.1 (Oracle Corporation 11.0.1+13)

 

# brew upgrade gradle
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 3 taps (homebrew/core, homebrew/cask and homebrew/services).
==> New Formulae
djl-serving         leaf-proxy          linux-pam           moto                multitime           orgalorg            pure                python-tk@3.9       rosa-cli            spaceship           timg
==> Updated Formulae
Updated 310 formulae.
==> New Casks
betelguese                                  drovio                                      free42-decimal                              offset-explorer                             xbar
coinomi-wallet                              free42-binary                               northernspysoftware-colorpicker             sonobus
==> Updated Casks
Updated 243 casks.
==> Deleted Casks
adobe-dng-converter                         craft                                       kafka-tool                                  use-engine                                  veonim

==> Upgrading 1 outdated package:
gradle 5.1 -> 6.8.3
==> Upgrading gradle 5.1 -> 6.8.3
==> Downloading https://homebrew.bintray.com/bottles/openjdk-15.0.2.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/25b541c2de04a0ccbe55a2c53ce1c1de32ae0da23e162ecb38ca3ecda630efd9?response-content-disposition=attachment%3Bfilename%3D%22openjdk-15.0.2.mojave.bottle.tar.gz%22&P
######################################################################## 100.0%
==> Downloading https://services.gradle.org/distributions/gradle-6.8.3-all.zip
==> Downloading from https://downloads.gradle-dn.com/distributions/gradle-6.8.3-all.zip
######################################################################## 100.0%
==> Installing dependencies for gradle: openjdk
==> Installing gradle dependency: openjdk
==> Pouring openjdk-15.0.2.mojave.bottle.tar.gz
==> Caveats
For the system Java wrappers to find this JDK, symlink it with
  sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

openjdk is keg-only, which means it was not symlinked into /usr/local,
because macOS provides similar software and installing this software in
parallel can cause all kinds of trouble.

If you need to have openjdk first in your PATH, run:
  echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> ~/.zshrc

For compilers to find openjdk you may need to set:
  export CPPFLAGS="-I/usr/local/opt/openjdk/include"

==> Summary
🍺  /usr/local/Cellar/openjdk/15.0.2: 614 files, 323.9MB
==> Installing gradle
🍺  /usr/local/Cellar/gradle/6.8.3: 11,239 files, 259MB, built in 23 seconds
Removing: /usr/local/Cellar/gradle/4.6... (199 files, 79.3MB)
Removing: /usr/local/Cellar/gradle/5.1... (13,265 files, 234.9MB)
==> Caveats
==> openjdk
For the system Java wrappers to find this JDK, symlink it with
  sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

openjdk is keg-only, which means it was not symlinked into /usr/local,
because macOS provides similar software and installing this software in
parallel can cause all kinds of trouble.

If you need to have openjdk first in your PATH, run:
  echo 'export PATH="/usr/local/opt/openjdk/bin:$PATH"' >> ~/.zshrc

For compilers to find openjdk you may need to set:
  export CPPFLAGS="-I/usr/local/opt/openjdk/include"

 

업그레이드 적용이 잘되었는지 확인

# gradle --version

------------------------------------------------------------
Gradle 6.8.3
------------------------------------------------------------

Build time:   2021-02-22 16:13:28 UTC
Revision:     9e26b4a9ebb910eaa1b8da8ff8575e514bc61c78

Kotlin:       1.4.20
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          15.0.2 (Oracle Corporation 15.0.2+7)
OS:           Mac OS X 10.14 x86_64