【发布时间】:2014-12-12 11:32:50
【问题描述】:
不确定这是 Gradle 问题还是 Spring Boot 问题,但这里是……
我在 Spring Boot 应用程序中使用 Spring 安全性和 LDAP。
我的 build.gradle 中有以下依赖项:
compile 'org.springframework.security:spring-security-ldap:3.2.4.RELEASE'
compile 'org.apache.directory.server:apacheds-server-jndi:1.5.5'
其中的第二个提供了仅在开发期间才需要的嵌入式 LDAP 服务器。
我已经建立了一个 SB @Profile 并将一个 LDIF 文件配置/加载到具有 @Profile('development') 注释的类中的嵌入式服务器中。
问题是:不处于dev模式时如何去除第二个依赖?
我在我的 config/application.yml 文件中建立了 spring.profiles.active 属性,因此:
spring:
profiles:
active: development
我可以引用 spring.profiles.active 以便以某种方式排除不需要的依赖项吗?
【问题讨论】:
-
不在开发模式下是什么意思?其他模式是如何准备的?战争?命令行?是什么决定的?
标签: gradle spring-boot