随笔分类 - springboot
摘要:<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
阅读全文
摘要:public class EnvironmentTest { @Test public void propertyTest() { // Java 系统属性 String key = "java.home"; StandardEnvironment environment = new Standar
阅读全文
摘要:https://www.cnblogs.com/free-wings/p/10254998.html 1.服务端(消息提供者) springboot amqp 默认非持久化 <parent> <groupId>org.springframework.boot</groupId> <artifactI
阅读全文
摘要:<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/P
阅读全文
摘要:使用SpringBoot 默认的StandardServletMultipartResolver,不依赖commons-fileupload。 使用commons-fileupload的CommonsMultipartResolver, 排除默认 spring: autoconfigure: exc
阅读全文
摘要:idea 启动类有启动按钮,点击没反应问题 打开idea file-settings搜索插件找到Groovy这个然后把这个插件enable前面的对勾去掉即可。 idea 启动问题解决 Command line is too long. In order to reduce its length cl
阅读全文
摘要:1.打包jar <packaging>jar</packaging> <build> <!-- 定义包含这些资源文件,能在jar包中获取这些文件 --> <resources> <resource> <directory>src/main/java</directory> <includes> <i
阅读全文
摘要:ctrl + shift + a 搜索命令:registry –> 勾选compiler.automake.allow.when.app.running* <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spr
阅读全文
摘要:# # COMMON SPRING BOOT PROPERTIES## This sample file is provided as a guideline. Do NOT copy it in its# entirety to your own application. ^^^# # # COR
阅读全文
摘要:自动配置中使用的条件化注解 条件化注解 配置生效条件@ConditionalOnBean 配置了某个特定Bean@ConditionalOnMissingBean 没有配置特定的Bean@ConditionalOnClass Classpath里有指定的类@ConditionalOnMissingC
阅读全文
摘要:一、静态属性 1、配置文件属性映射(完全映射,名称必须一致) @Value(value="${config.name}") 2、有时候属性太多了,一个个绑定到属性字段上太累,官方提倡绑定一个对象的bean,这里我们建一个ConfigBean.java类,顶部需要使用注解@ConfigurationP
阅读全文
摘要:在Spring Boot中多环境配置文件名需要满足application-{profile}.properties的格式,其中{profile}对应你的环境标识,比如: application-dev.properties:开发环境 application-prod.properties:生产环境
阅读全文
摘要:ConditionalOnClass :用于指定在Classpath下拥有某些Class时才生效 ConditionalOnMissingClass :用于指定在Classpath下不存在某些Class时才生效 ConditionalOnBean :用于指定在bean容器中存在某些bean时生效 C
阅读全文
摘要:config.name=configname config.password=configpassword @Configuration @ConfigurationProperties(prefix = "config") @PropertySource("classpath:/config.pr
阅读全文
摘要:覆盖默认版本 <properties> <spring-data-releasetrain.version>Fowler-SR2</spring-data-releasetrain.version> </properties>*************************************
阅读全文