Eclipse Error) Remote host terminated the handshake: SSL peer shut down incorrectly

반응형

 

이클립스를 사용하는 프레임워크에서 발생하는 에러입니다.

저는 전자정부프레임워크 4.0에서 발생하였습니다.

에러 원문

[ERROR] Failed to execute goal on project dbtest1:
Could not resolve dependencies for project dd:dbtest1:war:1.0.0:
Failed to collect dependencies at org.mybatis:mybatis:jar:3.5.11:
Failed to read artifact descriptor for org.mybatis:mybatis:jar:3.5.11:
Could not transfer artifact org.mybatis:mybatis:pom:3.5.11
from/to mvn2s (https://repo1.maven.org/maven2/):
Remote host terminated the handshake: SSL peer shut down incorrectly -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

서론

더보기

중요한 것은 에러에 있는 라이브러리 mybatis의 유무가 아닙니다.

어떠한 라이브러리를 추가해도 같은 에러가 발생합니다.

예를들어 mysql-connetor-j 를 <dependency>에 추가하게 된다면 위와 같은 에러가 mysql-connector-j로 바뀌어 출력됩니다.

의존성을 추가해서 에러가 났던 라이브러리들은 대개 DB관련이였습니다. (H2, mysql, mybatis) + @ spring starter

이게 이상하게도 집에서는 잘 되는데 회사에서만 실행하면 프로젝트가 빌드가 안됩니다 ㅠㅠ

인터넷에서는 방화벽 문제일 수 있다곤 하는데 해결 방법을 모르겠어서...

아무것도 못하는 상황이라 답답했습니다.

'SSL peer shut down incorrectly' 라는 에러를 아무리 검색해도 원하는 답변이 나오진 않았고,

전전긍긍하다가 우연히 한 블로그를 보고 따라하니 바로 해결되어서 기쁜 마음에 또 같은 실수를 반복하지 않고자 글을 남깁니다.


해결 방법

  • 에러가 나는 라이브러리의 이름을 메이븐 리파지토리에서 검색

https://mvnrepository.com/

 

  • 해당 라이브러리 다운로드 + Maven/Gradle 상황에 맞는 소스코드 복사하여 붙여넣기

 

  • pom.xml 파일에 dependency 코드 추가

 

  • 다운로드 한 파일 프로젝트에 추가
    • 편의를 위해 src/main/webapp/WEB-INF/lib 폴더에 저장

 

  • pom.xml 파일 수정
    • 추가한 라이브러리의 dependency 부분에 <scope> 와 <systemPath> 코드 입력
<dependency>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/'추가한 라이브러리 파일 이름'</systemPath>
</dependency>

 

<!-- 예시 -->
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.31</version>
    <scope>system</scope>
    <systemPath>${basedir}/src/main/webapp/WEB-INF/lib/mysql-connector-j-8.0.31.jar</systemPath>
</dependency>

 

  • 실제 pom.xml 수정 화면

 

  • 프로젝트 우클릭 - Maven - Update Project
    • (Gradle의 경우 Gradle - Refresh Gradle Project)

 

  • 프로젝트 우클릭 - Run As - Maven clean
  • 이후 Run As - Maven install
    • (Gradle의 경우 위의 과정 스킵)

 

  • 빌드 성공


참고

  • 싱아의 블로그 - [Maven] 수동으로 dependency 추가

https://m.blog.naver.com/alpine_knotweed/222024840212

 

[Maven] 수동으로 dependency 추가

Maven 사용 시에 보통 https://mvnrepository.com/사이트에서 repository를 검색 후에 pom.xml 파일에 적...

blog.naver.com

 

반응형