Project/Buy me If you can

Buyme TIL240826 멀티모듈 통신오류

Albosa2lol 2024. 8. 29. 05:59

첫번째, Execution failed for task ':bootJar' 라는 오류가 발생했다.

이는 org.springframework.boot:spring-boot-dependencies:3.3.2 외부 종속성을 해결할 수 없어서 발생하는 오류로, 모노리스 서비스를 멀티모듈화 하면서 엔티티 등의 결합 관계가 제대로 정립되지 않아 발생하였다. 일부 엔티티 연결등을 통해 해당 오류를 해결했다.

 

 

 

두번째,

docker-compose up --build  를 통해 빌드업을 하는 중 다음과 같은 에러가 발생했다,

=> [order-service build 3/5] COPY ../../ ./                                                                                                                                                        0.2s
 => ERROR [order-service build 4/5] RUN ./gradlew build --no-daemon                                                                                                                                34.6s
------
 > [order-service build 4/5] RUN ./gradlew build --no-daemon:
0.203 Downloading https://services.gradle.org/distributions/gradle-8.8-bin.zip
1.856 .............10%.............20%.............30%.............40%.............50%.............60%..............70%.............80%.............90%.............100%
18.72 
18.72 Welcome to Gradle 8.8!
18.72 
18.72 Here are the highlights of this release:
18.72  - Running Gradle on Java 22
18.72  - Configurable Gradle daemon JVM
18.72  - Improved IDE performance for large projects
18.72 
18.72 For more details see https://docs.gradle.org/8.8/release-notes.html
18.72 
18.82 To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/8.8/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
19.42 Daemon will be stopped at the end of the build 
33.92 > Task :compileJava NO-SOURCE
33.92 > Task :processResources NO-SOURCE
33.92 > Task :classes UP-TO-DATE
33.92 > Task :resolveMainClassName
34.02 > Task :bootJar FAILED
34.02 
34.02 FAILURE: Build failed with an exception.
34.02 
34.02 * What went wrong:
34.02 Execution failed for task ':bootJar'.
34.02 > Could not resolve all artifacts for configuration ':detachedConfiguration17'.
34.02    > Cannot resolve external dependency org.springframework.boot:spring-boot-dependencies:3.3.2 because no repositories are defined.
34.02      Required by:
34.02          project :
34.02 
34.02 * Try:
34.02 > Run with --stacktrace option to get the stack trace.
34.02 > Run with --info or --debug option to get more log output.
34.02 > Run with --scan to get full insights.
34.02 > Get more help at https://help.gradle.org.
34.02 
34.02 BUILD FAILED in 33s2 actionable tasks: 2 executed
34.02 
------
failed to solve: process "/bin/sh -c ./gradlew build --no-daemon" did not complete successfully: exit code: 1

./gradlew build --no-daemon 등의 불필요한 dependency 들을 삭제하여 해결하였다.

-> 불필요한 dependency 제거 후, 각 모듈의 application 실행하여 정상적인지 확인하여 점검