我有一个使用Spring-data-rest的项目,有一个依赖项目仅使用Spring Data。这两个项目都有Spring Data repositories,并使用@EnableJpaRepositories
来实现它们的repository接口,但是我只想在父项目中导出repositories。
我的问题是:是否有一种配置Spring Data REST的方法,可以仅为父项目中的资源公开rest端点,而无需显式地用@RepositoryRestResource(exported = false)
注释依赖项项目中的每个repository?
如果我只能通过禁用@RepositoryRestResource
来实现此操作,更糟糕的是,其他使用情况不同的项目将无法为这些repositories启用REST端点,则我的依赖项目将不得不仅包括Spring Data REST…
org.springframework.boot:spring-boot-starter-data-rest
。 - Julien