package com.example.config;
import org.springframework.boot.context.properties.ConfigurationProperties;
@ConfigurationProperties(prefix = "hello")
public class HelloProperties {
private String url;
private String port;
private String username;
private String password;
public void setUrl(String url) {
this.url = url;
}
public void setPort(String port) {
this.port = port;
}
public void setUsername(String username) {
this.username = username;
}
public void setPassword(String password) {
this.password = password;
}
public String getUrl() {
return url;
}
public String getPort() {
return port;
}
public String getUsername() {
return username;
}
public String getPassword() {
return password;
}
@Override
public String toString() {
return "HelloProperties{" +
"url='" + url + '\'' +
", port='" + port + '\'' +
", username='" + username + '\'' +
", password='" + password + '\'' +
'}';
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
自定义spring boot Starter,请参考博文:https://blog.csdn.net/cj151525/article/details/131366473?spm=1001.2014.3001.5501 Spring Boot starter 我们知道Spring Boot大大简化了项目初始搭建以及开发过程,而这些都是通过Spring Boot提供的starter来完成的。在实际项目中一些基础模块其本质就是starter,所以我们需要对Spring Boot的starter有一个全面深入的了解,这是我们的必备知识。 starter介绍 spring boot 在配置上相比spring要简单许多, 其核心在于spring-boot-starter, 在使用spring boot来搭建一个项目时, 只需要引入官方提供的starter, 就可以直接使用, 免去了各种配置。starter简单来讲就是引入了一些相关依赖和一些初始化的配置。
资源推荐
资源详情
资源评论
收起资源包目录
hello-spring-boot-starter.zip (41个子文件)
pom.xml 1KB
src
main
resources
META-INF
spring.factories 114B
java
com
example
service
HelloService.java 895B
config
HelloProperties.java 1KB
HelloServiceAutoConfiguration.java 1KB
.idea
jarRepositories.xml 1KB
uiDesigner.xml 9KB
workspace.xml 3KB
misc.xml 541B
inspectionProfiles
Project_Default.xml 328B
compiler.xml 916B
.gitignore 184B
encodings.xml 267B
target
classes
META-INF
spring-configuration-metadata.json 737B
spring.factories 114B
com
example
service
HelloService.class 1KB
config
HelloServiceAutoConfiguration.class 1KB
HelloProperties.class 2KB
site
dependencies.html 35KB
css
maven-base.css 3KB
site.css 53B
print.css 1KB
maven-theme.css 4KB
dependency-management.html 0B
images
close.gif 279B
logos
maven-feather.png 3KB
build-by-maven-black.png 2KB
build-by-maven-white.png 2KB
icon_warning_sml.gif 576B
expanded.gif 52B
icon_info_sml.gif 606B
external.png 230B
icon_error_sml.gif 1010B
icon_success_sml.gif 990B
collapsed.gif 53B
newwindow.png 220B
dependency-info.html 5KB
hello-spring-boot-starter-1.0-SNAPSHOT.jar 5KB
maven-status
maven-compiler-plugin
compile
default-compile
createdFiles.lst 179B
inputFiles.lst 336B
maven-archiver
pom.properties 81B
generated-sources
annotations
共 41 条
- 1
资源评论
矩阵科学
- 粉丝: 2914
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功