diff --git a/apollo-assembly/pom.xml b/apollo-assembly/pom.xml deleted file mode 100644 index c196214d974db0e5e1a4aef4f1b2d4aa96a901cb..0000000000000000000000000000000000000000 --- a/apollo-assembly/pom.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - com.ctrip.apollo - apollo - 0.0.1-SNAPSHOT - ../pom.xml - - 4.0.0 - apollo-assembly - Apollo Assembly - diff --git a/apollo-configadmin/pom.xml b/apollo-configadmin/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..4296905318c9613374e2cc6defb45b30fc059b41 --- /dev/null +++ b/apollo-configadmin/pom.xml @@ -0,0 +1,67 @@ + + + + com.ctrip.apollo + apollo + 0.0.1-SNAPSHOT + ../pom.xml + + 4.0.0 + apollo-configadmin + Apollo ConfigAdmin + + + + com.ctrip.apollo + apollo-biz + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + provided + + + + + org.springframework.data + spring-data-redis + + + redis.clients + jedis + + + + + org.springframework.cloud + spring-cloud-starter-eureka + + + + + javax.servlet + jstl + + + org.apache.tomcat.embed + tomcat-embed-jasper + provided + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + diff --git a/apollo-configadmin/src/main/java/com/ctrip/apollo/configadmin/AdminServiceApplication.java b/apollo-configadmin/src/main/java/com/ctrip/apollo/configadmin/AdminServiceApplication.java new file mode 100644 index 0000000000000000000000000000000000000000..e22a0703844bfb6f210bf513f7d77f0937cbefc3 --- /dev/null +++ b/apollo-configadmin/src/main/java/com/ctrip/apollo/configadmin/AdminServiceApplication.java @@ -0,0 +1,14 @@ +package com.ctrip.apollo.configadmin; + +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.cloud.netflix.eureka.EnableEurekaClient; + + +@SpringBootApplication +@EnableEurekaClient +public class AdminServiceApplication { + public static void main(String[] args) { + new SpringApplicationBuilder(AdminServiceApplication.class).web(true).run(args); + } +} diff --git a/apollo-configadmin/src/main/resources/application.yml b/apollo-configadmin/src/main/resources/application.yml new file mode 100644 index 0000000000000000000000000000000000000000..30ef14451fb7d2b284dfa20fec385fcf3f590f71 --- /dev/null +++ b/apollo-configadmin/src/main/resources/application.yml @@ -0,0 +1,12 @@ +spring: + application: + name: apollo-configadmin + +server: + port: 9080 + +logging: + level: + org.springframework.cloud: 'DEBUG' + file: /opt/logs/apollo-configadmin.log + diff --git a/apollo-metaserver/src/main/resources/bootstrap.yml b/apollo-configadmin/src/main/resources/bootstrap.yml similarity index 78% rename from apollo-metaserver/src/main/resources/bootstrap.yml rename to apollo-configadmin/src/main/resources/bootstrap.yml index 4412c0af80e9fbee7b5e3849346d63a72dc02057..8551470ec220cdc02725279fbcf2131af4a14e21 100644 --- a/apollo-metaserver/src/main/resources/bootstrap.yml +++ b/apollo-configadmin/src/main/resources/bootstrap.yml @@ -1,6 +1,3 @@ -server: - port: 8761 - eureka: instance: hostname: localhost @@ -8,4 +5,4 @@ eureka: serviceUrl: defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ healthcheck: - enabled: true + enabled: true \ No newline at end of file diff --git a/apollo-configserver/pom.xml b/apollo-configserver/pom.xml index 89d07da5d8112b37032cbc6207546cdbfd22bdef..f790cd6ee4694aea68f49e8854341576fc4ba2b9 100644 --- a/apollo-configserver/pom.xml +++ b/apollo-configserver/pom.xml @@ -42,7 +42,7 @@ org.springframework.cloud - spring-cloud-starter-eureka + spring-cloud-starter-eureka-server diff --git a/apollo-configserver/src/main/java/com/ctrip/apollo/ServerApplication.java b/apollo-configserver/src/main/java/com/ctrip/apollo/ServerApplication.java index a0ec713a1fa3e6fd67465220e6a9c6f82e08e6e9..0a09ab01e79d95a6355e5b34b3fce1893f187a8b 100644 --- a/apollo-configserver/src/main/java/com/ctrip/apollo/ServerApplication.java +++ b/apollo-configserver/src/main/java/com/ctrip/apollo/ServerApplication.java @@ -1,17 +1,19 @@ package com.ctrip.apollo; -import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.cloud.netflix.eureka.EnableEurekaClient; +import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; /** * Spring boot application entry point * @author Jason Song(song_s@ctrip.com) */ @SpringBootApplication -@EnableDiscoveryClient +@EnableEurekaServer +@EnableEurekaClient public class ServerApplication { public static void main(String[] args) { - SpringApplication.run(ServerApplication.class, args); + new SpringApplicationBuilder(ServerApplication.class).web(true).run(args); } } diff --git a/apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/controller/ServiceController.java b/apollo-configserver/src/main/java/com/ctrip/apollo/metaserver/controller/ServiceController.java similarity index 100% rename from apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/controller/ServiceController.java rename to apollo-configserver/src/main/java/com/ctrip/apollo/metaserver/controller/ServiceController.java diff --git a/apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/service/DiscoveryService.java b/apollo-configserver/src/main/java/com/ctrip/apollo/metaserver/service/DiscoveryService.java similarity index 100% rename from apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/service/DiscoveryService.java rename to apollo-configserver/src/main/java/com/ctrip/apollo/metaserver/service/DiscoveryService.java diff --git a/apollo-configserver/src/main/resources/application.yml b/apollo-configserver/src/main/resources/application.yml index 55b1b3d2614924cae5cd4c69bbb6cc012d7a3d7a..88a5f1abcd739e99051659452488db4855a3c3b0 100644 --- a/apollo-configserver/src/main/resources/application.yml +++ b/apollo-configserver/src/main/resources/application.yml @@ -1,5 +1,9 @@ +spring: + application: + name: apollo-configserver + server: - port: 8888 + port: 80 logging: level: diff --git a/apollo-configserver/src/main/resources/bootstrap.yml b/apollo-configserver/src/main/resources/bootstrap.yml index 4fb91a9b6cb535a18227a0e7645fe01240c6eeb7..8551470ec220cdc02725279fbcf2131af4a14e21 100644 --- a/apollo-configserver/src/main/resources/bootstrap.yml +++ b/apollo-configserver/src/main/resources/bootstrap.yml @@ -1,9 +1,8 @@ -spring: - application: - name: apollo-configserver eureka: instance: hostname: localhost client: serviceUrl: - defaultZone: http://${eureka.instance.hostname}:8761/eureka/ + defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ + healthcheck: + enabled: true \ No newline at end of file diff --git a/apollo-metaserver/pom.xml b/apollo-metaserver/pom.xml deleted file mode 100644 index 817e1ec2ad21c19e2cd72de15b2adbfd788342b9..0000000000000000000000000000000000000000 --- a/apollo-metaserver/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - com.ctrip.apollo - apollo - 0.0.1-SNAPSHOT - ../pom.xml - - 4.0.0 - apollo-metaserver - Apollo MetaServer - - - com.ctrip.apollo - apollo-core - - - org.springframework.cloud - spring-cloud-starter-eureka-server - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - diff --git a/apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/MetaServerApplication.java b/apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/MetaServerApplication.java deleted file mode 100644 index f61e2b1e585d739caa227bc3cbd886634a0ee3a6..0000000000000000000000000000000000000000 --- a/apollo-metaserver/src/main/java/com/ctrip/apollo/metaserver/MetaServerApplication.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ctrip.apollo.metaserver; - -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.cloud.netflix.eureka.EnableEurekaClient; -import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; - -@SpringBootApplication -@EnableEurekaServer -@EnableEurekaClient -public class MetaServerApplication { - - public static void main(String[] args) { - new SpringApplicationBuilder(MetaServerApplication.class).web(true).run(args); - } -} diff --git a/apollo-metaserver/src/main/resources/application.yml b/apollo-metaserver/src/main/resources/application.yml deleted file mode 100644 index 530cdcee72f442f5b798f32c3731dbe2f9d71946..0000000000000000000000000000000000000000 --- a/apollo-metaserver/src/main/resources/application.yml +++ /dev/null @@ -1,11 +0,0 @@ -spring: - application: - name: apollo-metaserver - profiles: - active: native - -logging: - level: - - - \ No newline at end of file diff --git a/apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/AbstractMetaServerTest.java b/apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/AbstractMetaServerTest.java deleted file mode 100644 index 6938e1eea4a4eb35d739eabe72f97df0e81af064..0000000000000000000000000000000000000000 --- a/apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/AbstractMetaServerTest.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.ctrip.apollo.metaserver; - -import org.junit.runner.RunWith; -import org.springframework.boot.test.SpringApplicationConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -@RunWith(SpringJUnit4ClassRunner.class) -@SpringApplicationConfiguration(classes = MetaServerApplication.class) -public abstract class AbstractMetaServerTest { - -} diff --git a/apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/AllTests.java b/apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/AllTests.java deleted file mode 100644 index 122ef92ae8dff9e20f2ea1cdf2d2f24894a1acee..0000000000000000000000000000000000000000 --- a/apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/AllTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.ctrip.apollo.metaserver; - -import org.junit.runner.RunWith; -import org.junit.runners.Suite; -import org.junit.runners.Suite.SuiteClasses; - -@RunWith(Suite.class) -@SuiteClasses({ - -}) -public class AllTests { - -} diff --git a/apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/controller/DiscoveryControllerTest.java b/apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/controller/DiscoveryControllerTest.java deleted file mode 100644 index e39cf15013c1d37fe4beb9e5e18e29f3eeb2f37b..0000000000000000000000000000000000000000 --- a/apollo-metaserver/src/test/java/com/ctrip/apollo/metaserver/controller/DiscoveryControllerTest.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.ctrip.apollo.metaserver.controller; - -import java.net.URI; -import java.net.URISyntaxException; - -import org.junit.Assert; -import org.junit.Test; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.test.TestRestTemplate; -import org.springframework.boot.test.WebIntegrationTest; -import org.springframework.web.client.RestTemplate; - -import com.ctrip.apollo.core.ServiceIdConsts; -import com.ctrip.apollo.metaserver.AbstractMetaServerTest; -import com.netflix.appinfo.InstanceInfo; - - -@WebIntegrationTest -public class DiscoveryControllerTest extends AbstractMetaServerTest { - - RestTemplate restTemplate = new TestRestTemplate(); - - @Value("${local.server.port}") - String serverPort; - - @Test - public void testGetMetaServerServices() throws InterruptedException, URISyntaxException { - // Wait Eureka Client to fresh meta - Thread.sleep(5000); - - URI uri = new URI("http://localhost:" + serverPort + "/services/meta"); - InstanceInfo[] serviceInstances = restTemplate.getForObject(uri, InstanceInfo[].class); - Assert.assertEquals(1, serviceInstances.length); - Assert.assertEquals(ServiceIdConsts.APOLLO_METASERVER, - serviceInstances[0].getAppName().toLowerCase()); - } -} diff --git a/apollo-metaserver/src/test/resources/application.yml b/apollo-metaserver/src/test/resources/application.yml deleted file mode 100644 index 00a181dae4c103b3eef3b1e5047940c01a8b15d2..0000000000000000000000000000000000000000 --- a/apollo-metaserver/src/test/resources/application.yml +++ /dev/null @@ -1,5 +0,0 @@ -spring: - application: - name: apollo-metaserver - profiles: - active: native diff --git a/apollo-metaserver/src/test/resources/bootstrap.yml b/apollo-metaserver/src/test/resources/bootstrap.yml deleted file mode 100644 index fc734f65a2f7de65af3ab5db55b520565e8fce22..0000000000000000000000000000000000000000 --- a/apollo-metaserver/src/test/resources/bootstrap.yml +++ /dev/null @@ -1,14 +0,0 @@ -server: - port: 8761 - -eureka: - instance: - hostname: localhost - leaseRenewalIntervalInSeconds: 1 - client: - # initialInstanceInfoReplicationIntervalSeconds: 1 - registryFetchIntervalSeconds: 2 - serviceUrl: - defaultZone: http://${eureka.instance.hostname}:${server.port:8761}/eureka/ - healthcheck: - enabled: true \ No newline at end of file diff --git a/pom.xml b/pom.xml index 4be7bb86571d31b003f860802e0cb05fc7be164d..6c3072211a2b42696845ab90ccb9edf9b093f3d4 100644 --- a/pom.xml +++ b/pom.xml @@ -65,13 +65,12 @@ apollo-core - apollo-metaserver apollo-client + apollo-biz apollo-configserver + apollo-configadmin apollo-portal - apollo-assembly apollo-demo - apollo-biz