Commit 345cc9b6 by Dave Syer

Convert Eureka client autoconfig to @EnableEurekaClient

parent 10d1ed38
/*
* Copyright 2013-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.platform.netflix.eureka;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Import;
/**
* @author Dave Syer
*
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import(EurekaClientConfiguration.class)
public @interface EnableEurekaClient {
}
......@@ -43,10 +43,10 @@ import com.netflix.discovery.EurekaClientConfig;
EurekaInstanceConfigBean.class })
@ConditionalOnClass(EurekaClientConfig.class)
@ConditionalOnExpression("${eureka.client.enabled:true}")
public class EurekaClientAutoConfiguration implements
public class EurekaClientConfiguration implements
ApplicationListener<ContextRefreshedEvent>, SmartLifecycle, Ordered {
private static final Logger logger = LoggerFactory.getLogger(EurekaClientAutoConfiguration.class);
private static final Logger logger = LoggerFactory.getLogger(EurekaClientConfiguration.class);
private boolean running;
......
......@@ -32,7 +32,6 @@ import com.netflix.blitz4j.LoggingConfiguration;
import com.netflix.eureka.EurekaBootStrap;
import com.netflix.eureka.EurekaServerConfig;
import com.netflix.eureka.EurekaServerConfigurationManager;
import com.netflix.eureka.PeerAwareInstanceRegistry;
/**
* @author Dave Syer
......@@ -42,6 +41,7 @@ import com.netflix.eureka.PeerAwareInstanceRegistry;
@EnableConfigurationProperties(EurekaServerConfigBean.class)
@ConditionalOnClass(EurekaServerConfig.class)
@ConditionalOnExpression("${eureka.server.enabled:true}")
@EnableEurekaClient
public class EurekaServerAutoConfiguration implements ServletContextAware,
SmartLifecycle, Ordered {
......
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
org.springframework.platform.netflix.archaius.ArchaiusAutoConfiguration,\
org.springframework.platform.netflix.eureka.EurekaClientAutoConfiguration,\
org.springframework.platform.netflix.eureka.EurekaServerAutoConfiguration,\
org.springframework.platform.netflix.feign.FeignAutoConfiguration
\ No newline at end of file
......@@ -18,6 +18,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<!--skip deploy (this is just a test module) -->
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
......
......@@ -18,6 +18,13 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<!--skip deploy (this is just a test module) -->
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
......
......@@ -17,18 +17,16 @@
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<!--skip deploy (this is just a test module) -->
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment