Creating a library jar using Spring boot

前端 未结 3 1627
眼角桃花
眼角桃花 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 12:57

    This project of mine may be of some interest to you. I have used Spring-Boot to make a library to be used in other projects.

    The main thing to note here is to have:

    @SpringBootApplication(scanBasePackages = {"me.ramswaroop.jbot", "example.jbot"})
    

    in the main class where you start the spring-boot application. See this main class to learn more. But to be honest, using Spring-Boot to make a library to be included in other projects isn't a good choice according to me. If I were to rewrite JBot then I wouldn't have used Spring-Boot this way surely.

    Spring-Boot is really good to create a stand-alone application that you can "just run" but to create a library, hmm, not sure. I think a library should have fewer dependencies as possible.

提交回复
热议问题