Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
eureka-server
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cmiov005
eureka-server
Commits
883ded6b
Commit
883ded6b
authored
Jun 18, 2019
by
houg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
apollo
parent
05cf1163
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
136 additions
and
88 deletions
+136
-88
pom.xml
pom.xml
+90
-77
EurekaServerApplication.java
...com/enovate/newretail/eureka/EurekaServerApplication.java
+14
-11
TestController.java
...ain/java/com/enovate/newretail/eureka/TestController.java
+23
-0
apollo-env.properties
src/main/resources/apollo-env.properties
+4
-0
application.properties
src/main/resources/application.properties
+5
-0
No files found.
pom.xml
View file @
883ded6b
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.test
</groupId>
<groupId>
com.test
</groupId>
<artifactId>
eureka-server
</artifactId>
<artifactId>
eureka-server
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
<version>
0.0.1-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<packaging>
jar
</packaging>
<name>
eureka-server
</name>
<name>
eureka-server
</name>
<description>
Demo project for Spring Boot
</description>
<description>
Demo project for Spring Boot
</description>
<parent>
<parent>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
2.1.5.RELEASE
</version>
<version>
2.1.5.RELEASE
</version>
<relativePath
/>
<!-- lookup parent from repository -->
<relativePath
/>
<!-- lookup parent from repository -->
</parent>
</parent>
<properties>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
<java.version>
1.8
</java.version>
<spring-cloud.version>
Finchley.RC2
</spring-cloud.version>
<spring-cloud.version>
Finchley.RC2
</spring-cloud.version>
</properties>
</properties>
<dependencies>
<dependencies>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter
</artifactId>
<artifactId>
spring-cloud-starter
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-netflix-eureka-server
</artifactId>
<artifactId>
spring-cloud-starter-netflix-eureka-server
</artifactId>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-security
</artifactId>
<artifactId>
spring-boot-starter-security
</artifactId>
</dependency>
</dependency>
</dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependencyManagement>
<dependency>
<dependencies>
<groupId>
com.ctrip.framework.apollo
</groupId>
<dependency>
<artifactId>
apollo-client
</artifactId>
<groupId>
org.springframework.cloud
</groupId>
<version>
1.1.1
</version>
<artifactId>
spring-cloud-dependencies
</artifactId>
</dependency>
<version>
${spring-cloud.version}
</version>
<dependency>
<type>
pom
</type>
<groupId>
org.springframework.boot
</groupId>
<scope>
import
</scope>
<artifactId>
spring-boot-starter-data-rest
</artifactId>
</dependency>
</dependency>
</dependencies>
</dependencies>
</dependencyManagement>
<build>
<dependencyManagement>
<plugins>
<dependencies>
<plugin>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<artifactId>
spring-cloud-dependencies
</artifactId>
<executions>
<version>
${spring-cloud.version}
</version>
<execution>
<type>
pom
</type>
<goals>
<scope>
import
</scope>
<goal>
build-info
</goal>
</dependency>
</goals>
</dependencies>
</execution>
</dependencyManagement>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<build>
<repository>
<plugins>
<id>
central
</id>
<plugin>
<url>
http://maven.aliyun.com/nexus/content/groups/public/
</url>
<groupId>
org.springframework.boot
</groupId>
<name>
aliyun
</name>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</repository>
<executions>
<repository>
<execution>
<id>
spring-milestones
</id>
<goals>
<name>
Spring Milestones
</name>
<goal>
build-info
</goal>
<url>
https://repo.spring.io/milestone
</url>
</goals>
<snapshots>
</execution>
<enabled>
false
</enabled>
</executions>
</snapshots>
</plugin>
</repository>
</plugins>
</repositories>
</build>
<repositories>
<repository>
<id>
central
</id>
<url>
http://maven.aliyun.com/nexus/content/groups/public/
</url>
<name>
aliyun
</name>
</repository>
<repository>
<id>
spring-milestones
</id>
<name>
Spring Milestones
</name>
<url>
https://repo.spring.io/milestone
</url>
<snapshots>
<enabled>
false
</enabled>
</snapshots>
</repository>
</repositories>
</project>
</project>
src/main/java/com/enovate/newretail/eureka/EurekaServerApplication.java
View file @
883ded6b
...
@@ -7,24 +7,27 @@ import org.springframework.context.annotation.Configuration;
...
@@ -7,24 +7,27 @@ import org.springframework.context.annotation.Configuration;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig
;
/**
/**
* @author Ryan
* @author Ryan
*/
*/
@EnableEurekaServer
@EnableEurekaServer
@SpringBootApplication
@SpringBootApplication
@EnableApolloConfig
public
class
EurekaServerApplication
{
public
class
EurekaServerApplication
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
EurekaServerApplication
.
class
,
args
);
SpringApplication
.
run
(
EurekaServerApplication
.
class
,
args
);
}
}
@Configuration
@Configuration
public
static
class
SecurityPermitAllConfig
extends
WebSecurityConfigurerAdapter
{
public
static
class
SecurityPermitAllConfig
extends
WebSecurityConfigurerAdapter
{
@Override
@Override
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
protected
void
configure
(
HttpSecurity
http
)
throws
Exception
{
http
.
authorizeRequests
().
anyRequest
().
permitAll
()
//
http
.
authorizeRequests
().
anyRequest
().
permitAll
()
//
.
and
().
csrf
().
disable
();
.
and
().
csrf
().
disable
();
}
}
}
}
}
}
src/main/java/com/enovate/newretail/eureka/TestController.java
0 → 100644
View file @
883ded6b
package
com
.
enovate
.
newretail
.
eureka
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.ctrip.framework.apollo.Config
;
import
com.ctrip.framework.apollo.spring.annotation.ApolloConfig
;
@RestController
@RequestMapping
(
path
=
"/config"
)
public
class
TestController
{
@ApolloConfig
private
Config
config
;
@RequestMapping
(
path
=
"/get/{key}"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
String
get
(
@PathVariable
(
"key"
)
String
key
)
{
return
config
.
getProperty
(
key
,
config
.
getSourceType
().
name
());
}
}
src/main/resources/apollo-env.properties
0 → 100644
View file @
883ded6b
dev.meta
=
http://132.232.68.227:8080
fat.meta
=
http://172.21.28.19:8080
uat.meta
=
http://192.168.1.38:8082
pro.meta
=
http://192.168.1.38:8083
\ No newline at end of file
src/main/resources/application.properties
View file @
883ded6b
spring.application.name
=
eureka-server
spring.application.name
=
eureka-server
server.port
=
8761
server.port
=
8761
app.id
=
evonate-newretail-eureka
apollo.meta
=
http://192.168.1.38:8080
#spring.profiles.active = apollo-env.properties
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment