Creating a library jar using Spring boot

前端 未结 3 1665
眼角桃花
眼角桃花 2021-02-06 12:27

I created a spring boot application having REST web services and jpa dependencies. The application runs on its own as a standalone application. I\'m trying to add UI layer usin

3条回答
  •  广开言路
    2021-02-06 13:00

    Like Morphic said, you need to decide whether you're going to call the library methods natively using Java or whether you're setting up a web service. It sounds like you're building a REST API, in which case I wouldn't bother including it as a library. I would simply run your spring boot application (java -jar myservice.jar, or mvn spring:boot run), then just connect to it using HTTP REST on whatever port Spring Boot opens for your service.

    If you do decide to load the Spring Boot app as a library jar then you probably don't need Spring boot at all. All you need is your service methods and Spring config packaged together as a jar, mvn install to your local repo, then just reference your jar in the vaadin project's pom file (all this assuming you're creating it as a maven project).

提交回复
热议问题