[spring boot] method of including external jar on spring boot maven project 스프링부트에서 외부jar파일 추가 방법(배포시에도 정상적으로 추가됨) 1. 아래 이미지 처럼, 프로젝트에 lib 폴더 생성 후, 외부jar를 추가한다. 2. 아래 이미지 우측처럼, pom.xml 에, <properties> ... <webapp.lib>${basedir}/lib</webapp.lib> </properties> 추가 후, <dependencies> <dependency> <groupId>external</groupId> <artifactId>external</artifactId> <version>1.0</version> <scope>system</scope> <systemPath>${webapp.lib}/external.jar</systemPath> </dependency> </dependencies> 를 추가해준다. (주의] scope 는 system이다. 설정후, 프로젝트 클린&빌드를 한다. 여기까지 설정하면, 프로젝트에서 외부jar파일을 프로젝트에 포함되어 프로젝트가 해당 jar를 인식한다. 스프링부트의 boot dashboard 상으로 local실행시에 외부 jar가 빌드시 프로젝트내에 추가되어 잘 실행된다. 그러나, 배포를 위해 maven install 시에는, 설정한 jar파일들이 프로젝트의 WEB-INF/classes 폴더 (기본설정값) 로 저장되어, 배포시 외부jar를 사용하는 class에서 org.springframework.beans....
댓글
댓글 쓰기