RT,比如说 我想在项目的 core 包中, 封装 SpringContextHolder 这样一个操作 springbean 的工具类, 用来在项目的多个 springboot 应用中引入 core 依赖, 然后使用 SpringContextHolder 等其它封装好的公共类。
但是,在编写 SpringContextHolder 的时候又需要引入 springboot 的依赖 (不然没有 ApplicationContextAware 这样的接口类...之类的问题)
所有我的问题是如何在 core 的 pom 里面引入 springboot 的依赖, 而不使用(因为 core 不是个应用,只是编写了一些公共类), 我知道直接引入跑起来也没问题, 但是主要是为了让 core 不那么重。
是使用<scope>?或者<optional>?