Springboot references controller from another springboot project

under the same maven project, one of the springboot modules A refers to the Controller,An in the other springboot module B and calls the BMagia A project through inheritance. It can be run directly, but when packaging with maven, A module is prompted to find the inherited B module Controller.

what"s going on?

Dec.14,2021

the call of the controller layer can go to httpclient. It is not very clear about the problem you described


use feign

@EnableFeignClients
@FeignClient(value = "${appsweb.appis.name}", path = "${appsweb.appis.context-path}", configuration = FeignConfiguration.class)
public interface AlarmBaseInfoService {
        @RequestMapping(value = "/alarmBaseInfo/selectDetailByAlarmId", method = RequestMethod.POST, consumes="application/json")
        AjaxMessage<List<AlarmBaseInfo>> selectDetailByAlarmId(@RequestParam(value = "alarmID", required = false) String alarmID);
}

you can specify dependencies in the editor, but you can't find dependencies when packaging. You can set up the city maven father and son project, and you can pack it together. Also, package the B module into jar and rely on the A project

Menu