Make HATEOAS properly optional
This commit is contained in:
@@ -113,6 +113,7 @@
|
||||
<groupId>org.springframework.hateoas</groupId>
|
||||
<artifactId>spring-hateoas</artifactId>
|
||||
<version>1.1.0.M1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -21,12 +21,14 @@ import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.cloud.client.hypermedia.CloudHypermediaAutoConfiguration.CloudHypermediaProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.hateoas.Link;
|
||||
|
||||
/**
|
||||
* Registers a default {@link RemoteResourceRefresher} if at least one
|
||||
@@ -36,6 +38,7 @@ import org.springframework.context.annotation.Configuration;
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ConditionalOnClass(Link.class)
|
||||
@ConditionalOnBean(type = "org.springframework.cloud.client.hypermedia.RemoteResource")
|
||||
@EnableConfigurationProperties(CloudHypermediaProperties.class)
|
||||
public class CloudHypermediaAutoConfiguration {
|
||||
@@ -49,8 +52,7 @@ public class CloudHypermediaAutoConfiguration {
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
public RemoteResourceRefresher discoveredResourceRefresher() {
|
||||
return new RemoteResourceRefresher(this.discoveredResources,
|
||||
this.properties.getRefresh().getFixedDelay(),
|
||||
return new RemoteResourceRefresher(this.discoveredResources, this.properties.getRefresh().getFixedDelay(),
|
||||
this.properties.getRefresh().getInitialDelay());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user