• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

build 배포 따라하는 도중에 오류가 나네요

23.05.06 01:45 작성 조회수 922

0

아래는 shell에 ./gradlew clean build를 하니 나온 오류입니다. 인텔리제이에서 테스트는 잘 되는데 왜 build가 안되는지 잘모르겠어요..


jpashop ./gradlew clean build

Welcome to Gradle 7.6.1!

Here are the highlights of this release:

- Added support for Java 19.

- Introduced --rerun flag for individual task rerun.

- Improved dependency block for test suites to be strongly typed.

- Added a pluggable system for Java toolchains provisioning.

For more details see https://docs.gradle.org/7.6.1/release-notes.html

> Task :test FAILED

JpashopApplicationTests > initializationError FAILED

org.junit.runners.model.InvalidTestClassError at ParentRunner.java:525

2023-05-06T01:42:49.688+09:00 INFO 9580 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'

2023-05-06T01:42:49.689+09:00 INFO 9580 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...

2023-05-06T01:42:49.694+09:00 INFO 9580 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.

2 tests completed, 1 failed

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':test'.

> There were failing tests. See the report at: file:///Users/shfur2918/Desktop/spring_study/스프링_실전1편/jpashop/build/reports/tests/test/index.html

* 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 3s

8 actionable tasks: 8 executed

답변 2

·

답변을 작성해보세요.

1

김지수님의 프로필

김지수

질문자

2023.05.06

jar 빌드해서 동작하면 근데 뭐가 좋은건가요?

codesweaver님의 프로필

codesweaver

2023.05.16

안녕하세요 김지수 답변이 늦어 죄송합니다.

프로젝트를 다운받아 확인하여 보니 JUnit 테스트 실행 중 실패가 뜨는 것 같습니다.

/test/java/jpabook/jpashop/JpashopApplicationTests 코드 전체와

/test/java/jpabook/jpashop/MemberRepositoryTest 코드 전체를 주석 처리한 후 다시 빌드해보시고, 계속 문제가 발생한다면 build.gradle 의 다음을 최신 버전으로 변경하여 주세요. (jUnit은 5버전을 사용하시기 바랍니다)

implementation 'com.github.gavlyukovskiy:p6spy-spring-boot-starter:1.5.6'

testImplementation 'junit:junit:4.13.1'//이걸 넣어야지, 탬플릿에서 html 빌드 컴파일 후 바로 바뀜

0

codesweaver님의 프로필

codesweaver

2023.05.08

안녕하세요. 김지수 님, 공식 서포터즈 codesweaver 입니다.

-jar 실행방법은, 로컬에서 개발한 애플리케이션을 실제 서버에 배포(업로드)한 후, 서버에서 실행해야 하기 때문에 필요합니다 :) 그리고 정확한 오류를 알 기 위해 소스 코드를 공유해주세요.


전체 프로젝트를 압축해서 구글 드라이브로 공유해서 링크를 남겨주세요.
구글 드라이브 업로드 방법은 다음을 참고해주세요.
구글 드라이브 업로드 방법 링크

주의: 업로드시 권한 문제 꼭 확인해주세요
감사합니다.

김지수님의 프로필

김지수

질문자

2023.05.09

image

다시 해봐도 이렇게 오류가 나서 구글 드라이브에 업로드하였습니다.

링크 확인 부탁드립니다

김지수님의 프로필

김지수

질문자

2023.05.15

답변주시면 감사하겠습니다