Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mikite
spring-boot-examples
提交
59b87e79
S
spring-boot-examples
项目概览
Mikite
/
spring-boot-examples
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-boot-examples
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
59b87e79
编写于
2月 06, 2018
作者:
微笑很纯洁
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
m
上级
b90dce5e
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
371 addition
and
0 deletion
+371
-0
spring-boot-actuator/pom.xml
spring-boot-actuator/pom.xml
+59
-0
spring-boot-actuator/src/main/java/com/neo/ActuatorApplication.java
...t-actuator/src/main/java/com/neo/ActuatorApplication.java
+12
-0
spring-boot-actuator/src/main/java/com/neo/controller/HelloController.java
...tor/src/main/java/com/neo/controller/HelloController.java
+13
-0
spring-boot-actuator/src/main/resources/application.yml
spring-boot-actuator/src/main/resources/application.yml
+15
-0
spring-boot-actuator/src/test/java/com/neo/ActuatorApplicationTests.java
...uator/src/test/java/com/neo/ActuatorApplicationTests.java
+18
-0
spring-boot-actuator/src/test/java/com/neo/controller/HelloTests.java
...actuator/src/test/java/com/neo/controller/HelloTests.java
+36
-0
spring-boot-actuator/src/test/java/com/neo/controller/HelloWorldControlerTests.java
...est/java/com/neo/controller/HelloWorldControlerTests.java
+34
-0
spring-boot-admin-simple/pom.xml
spring-boot-admin-simple/pom.xml
+53
-0
spring-boot-admin-simple/spring-boot-admin-client/pom.xml
spring-boot-admin-simple/spring-boot-admin-client/pom.xml
+30
-0
spring-boot-admin-simple/spring-boot-admin-client/src/main/java/com/neo/AdminClientApplication.java
...-client/src/main/java/com/neo/AdminClientApplication.java
+12
-0
spring-boot-admin-simple/spring-boot-admin-client/src/main/resources/application.properties
...ot-admin-client/src/main/resources/application.properties
+4
-0
spring-boot-admin-simple/spring-boot-admin-client/src/test/java/com/neo/AdminClientApplicationTests.java
...nt/src/test/java/com/neo/AdminClientApplicationTests.java
+16
-0
spring-boot-admin-simple/spring-boot-admin-server/pom.xml
spring-boot-admin-simple/spring-boot-admin-server/pom.xml
+35
-0
spring-boot-admin-simple/spring-boot-admin-server/src/main/java/com/neo/AdminServerApplication.java
...-server/src/main/java/com/neo/AdminServerApplication.java
+16
-0
spring-boot-admin-simple/spring-boot-admin-server/src/main/resources/application.properties
...ot-admin-server/src/main/resources/application.properties
+2
-0
spring-boot-admin-simple/spring-boot-admin-server/src/test/java/com/neo/AdminServerApplicationTests.java
...er/src/test/java/com/neo/AdminServerApplicationTests.java
+16
-0
未找到文件。
spring-boot-actuator/pom.xml
0 → 100644
浏览文件 @
59b87e79
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
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"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.neo
</groupId>
<artifactId>
spring-boot-actuator
</artifactId>
<version>
1.0.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<name>
spring-boot-actuator
</name>
<description>
Demo project for Spring Boot
</description>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.9.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<java.version>
1.8
</java.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-web
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-actuator
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-devtools
</artifactId>
<optional>
true
</optional>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<configuration>
<fork>
true
</fork>
</configuration>
</plugin>
</plugins>
</build>
</project>
spring-boot-actuator/src/main/java/com/neo/ActuatorApplication.java
0 → 100644
浏览文件 @
59b87e79
package
com.neo
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
ActuatorApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
ActuatorApplication
.
class
,
args
);
}
}
spring-boot-actuator/src/main/java/com/neo/controller/HelloController.java
0 → 100644
浏览文件 @
59b87e79
package
com.neo.controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
public
class
HelloController
{
@RequestMapping
(
"/hello"
)
public
String
index
()
{
return
"Hello World"
;
}
}
\ No newline at end of file
spring-boot-actuator/src/main/resources/application.yml
0 → 100644
浏览文件 @
59b87e79
server
:
port
:
8080
management
:
security
:
enabled
:
false
#关掉安全认证
port
:
8088
#管理端口调整成8088
context-path
:
/monitor
#actuator的访问路径
endpoints
:
shutdown
:
enabled
:
true
info
:
app
:
name
:
spring-boot-actuator
version
:
1.0.0
\ No newline at end of file
spring-boot-actuator/src/test/java/com/neo/ActuatorApplicationTests.java
0 → 100644
浏览文件 @
59b87e79
package
com.neo
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringJUnit4ClassRunner
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
ActuatorApplicationTests
{
@Test
public
void
contextLoads
()
{
System
.
out
.
println
(
"hello word"
);
}
}
spring-boot-actuator/src/test/java/com/neo/controller/HelloTests.java
0 → 100644
浏览文件 @
59b87e79
package
com.neo.controller
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.http.MediaType
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.request.MockMvcRequestBuilders
;
import
org.springframework.test.web.servlet.setup.MockMvcBuilders
;
import
static
org
.
hamcrest
.
Matchers
.
equalTo
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
content
;
import
static
org
.
springframework
.
test
.
web
.
servlet
.
result
.
MockMvcResultMatchers
.
status
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
HelloTests
{
private
MockMvc
mvc
;
@Before
public
void
setUp
()
throws
Exception
{
mvc
=
MockMvcBuilders
.
standaloneSetup
(
new
HelloController
()).
build
();
}
@Test
public
void
getHello
()
throws
Exception
{
mvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/hello"
).
accept
(
MediaType
.
APPLICATION_JSON
))
.
andExpect
(
status
().
isOk
())
.
andExpect
(
content
().
string
(
equalTo
(
"Hello World"
)));
}
}
\ No newline at end of file
spring-boot-actuator/src/test/java/com/neo/controller/HelloWorldControlerTests.java
0 → 100644
浏览文件 @
59b87e79
package
com.neo.controller
;
import
org.junit.Before
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.http.MediaType
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
org.springframework.test.web.servlet.MockMvc
;
import
org.springframework.test.web.servlet.request.MockMvcRequestBuilders
;
import
org.springframework.test.web.servlet.result.MockMvcResultHandlers
;
import
org.springframework.test.web.servlet.result.MockMvcResultMatchers
;
import
org.springframework.test.web.servlet.setup.MockMvcBuilders
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
HelloWorldControlerTests
{
private
MockMvc
mvc
;
@Before
public
void
setUp
()
throws
Exception
{
mvc
=
MockMvcBuilders
.
standaloneSetup
(
new
HelloController
()).
build
();
}
@Test
public
void
getHello
()
throws
Exception
{
mvc
.
perform
(
MockMvcRequestBuilders
.
get
(
"/hello"
).
accept
(
MediaType
.
APPLICATION_JSON
))
.
andExpect
(
MockMvcResultMatchers
.
status
().
isOk
())
.
andDo
(
MockMvcResultHandlers
.
print
())
.
andReturn
();
}
}
\ No newline at end of file
spring-boot-admin-simple/pom.xml
0 → 100644
浏览文件 @
59b87e79
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
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"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.neo
</groupId>
<artifactId>
spring-boot-admin-simple
</artifactId>
<version>
1.0.0.BUILD-SNAPSHOT
</version>
<modules>
<module>
spring-boot-admin-server
</module>
<module>
spring-boot-admin-client
</module>
</modules>
<packaging>
pom
</packaging>
<name>
Spring boot admin
</name>
<description>
Demo project for Spring Boot
</description>
<parent>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-parent
</artifactId>
<version>
1.5.9.RELEASE
</version>
<relativePath/>
<!-- lookup parent from repository -->
</parent>
<properties>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<project.reporting.outputEncoding>
UTF-8
</project.reporting.outputEncoding>
<java.version>
1.8
</java.version>
<spring-cloud.version>
Edgware.SR1
</spring-cloud.version>
</properties>
<dependencies>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-dependencies
</artifactId>
<version>
${spring-cloud.version}
</version>
<type>
pom
</type>
<scope>
import
</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
\ No newline at end of file
spring-boot-admin-simple/spring-boot-admin-client/pom.xml
0 → 100644
浏览文件 @
59b87e79
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
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"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
com.neo
</groupId>
<artifactId>
spring-boot-admin-simple
</artifactId>
<version>
1.0.0.BUILD-SNAPSHOT
</version>
</parent>
<artifactId>
spring-boot-admin-client
</artifactId>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-starter-client
</artifactId>
<version>
1.5.6
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
spring-boot-admin-simple/spring-boot-admin-client/src/main/java/com/neo/AdminClientApplication.java
0 → 100644
浏览文件 @
59b87e79
package
com.neo
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
@SpringBootApplication
public
class
AdminClientApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
AdminClientApplication
.
class
,
args
);
}
}
spring-boot-admin-simple/spring-boot-admin-client/src/main/resources/application.properties
0 → 100644
浏览文件 @
59b87e79
server.port
=
8001
spring.boot.admin.url
=
http://localhost:8000
management.security.enabled
=
false
spring-boot-admin-simple/spring-boot-admin-client/src/test/java/com/neo/AdminClientApplicationTests.java
0 → 100644
浏览文件 @
59b87e79
package
com.neo
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
AdminClientApplicationTests
{
@Test
public
void
contextLoads
()
{
}
}
spring-boot-admin-simple/spring-boot-admin-server/pom.xml
0 → 100644
浏览文件 @
59b87e79
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
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"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
com.neo
</groupId>
<artifactId>
spring-boot-admin-simple
</artifactId>
<version>
1.0.0.BUILD-SNAPSHOT
</version>
</parent>
<artifactId>
spring-boot-admin-server
</artifactId>
<packaging>
jar
</packaging>
<dependencies>
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-server
</artifactId>
<version>
1.5.6
</version>
</dependency>
<dependency>
<groupId>
de.codecentric
</groupId>
<artifactId>
spring-boot-admin-server-ui
</artifactId>
<version>
1.5.6
</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
</plugin>
</plugins>
</build>
</project>
spring-boot-admin-simple/spring-boot-admin-server/src/main/java/com/neo/AdminServerApplication.java
0 → 100644
浏览文件 @
59b87e79
package
com.neo
;
import
de.codecentric.boot.admin.config.EnableAdminServer
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@EnableAutoConfiguration
@EnableAdminServer
public
class
AdminServerApplication
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
AdminServerApplication
.
class
,
args
);
}
}
spring-boot-admin-simple/spring-boot-admin-server/src/main/resources/application.properties
0 → 100644
浏览文件 @
59b87e79
server.port
=
8000
spring-boot-admin-simple/spring-boot-admin-server/src/test/java/com/neo/AdminServerApplicationTests.java
0 → 100644
浏览文件 @
59b87e79
package
com.neo
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
AdminServerApplicationTests
{
@Test
public
void
contextLoads
()
{
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录