Spring Boot Microservice depends on another Microservice in Jenkins

落花浮王杯 提交于 2020-01-25 06:52:33

问题


I have developed two Springboot michroservices ex- service1 and service2. service2 microservice having dependency of service1.

I've added dependency of service1 in service2 pom file and working expected in eclipse while running service2. but when I deployed in Jenkins and I've created project(Jenkins Job) for service1 and ran with maven goal 'clean install', project builds successfully.

When I created project(Jenkins Job) for service2 and running the Jenkins Job, build is failing because service2 is not able to find the dependency of service1.


回答1:


Issue Resolved!!! whenever we are using spring dependency in depedent project we don't need to add maven/spring compiler plug-in.




回答2:


Your jenkins should be configured with an artifact repository like Nexus, if this is the case make sure the maven config of your project is set to publish the artifact to the repository.

On the other hand, it's not a good practice to make dependencies between microservices. Instead communications could be done via other protocols REST/HTTP,...



来源:https://stackoverflow.com/questions/57768517/spring-boot-microservice-depends-on-another-microservice-in-jenkins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!