Make management.port default to server.port

pull/1/merge
Dave Syer 12 years ago
parent e1c3dae8a1
commit 7800ebbdc7

@ -35,7 +35,7 @@ import org.springframework.context.event.ContextRefreshedEvent;
*
*/
@Configuration
@ConditionalOnExpression("${management.port:8080}>0")
@ConditionalOnExpression("${management.port:${server.port:8080}}>0")
public class ManagementConfiguration implements ApplicationContextAware, DisposableBean,
ApplicationListener<ContextRefreshedEvent> {
@ -48,7 +48,7 @@ public class ManagementConfiguration implements ApplicationContextAware, Disposa
@Autowired
private ManagementServerProperties management = new ManagementServerProperties();
@ConditionalOnExpression("${server.port:8080} == ${management.port:8080}")
@ConditionalOnExpression("${server.port:8080} == ${management.port:${server.port:8080}}")
@Configuration
@Import({ VarzConfiguration.class, HealthzConfiguration.class,
ShutdownConfiguration.class, TraceConfiguration.class })

@ -20,6 +20,7 @@ import java.net.InetAddress;
import javax.validation.constraints.NotNull;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
/**
@ -30,6 +31,7 @@ import org.springframework.bootstrap.context.annotation.ConfigurationProperties;
@ConfigurationProperties(name = "management", ignoreUnknownFields = false)
public class ManagementServerProperties {
@Value("${server.port:8080}")
private int port = 8080;
private InetAddress address;

Loading…
Cancel
Save