diff --git a/spring-boot-actuator/pom.xml b/spring-boot-actuator/pom.xml index f9398c0b25..5adccd08d7 100644 --- a/spring-boot-actuator/pom.xml +++ b/spring-boot-actuator/pom.xml @@ -151,6 +151,12 @@ commons-dbcp true + + + org.springframework.boot + spring-boot-configuration-processor + true + ch.qos.logback diff --git a/spring-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000000..e34f94ad4d --- /dev/null +++ b/spring-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,8 @@ +{"properties": [ + { + "name": "spring.git.properties", + "dataType": "java.lang.String", + "description": "Resource reference to a generated git info properties file." + } +]} + diff --git a/spring-boot-autoconfigure/pom.xml b/spring-boot-autoconfigure/pom.xml index 61d4b3b820..32f4afcab9 100644 --- a/spring-boot-autoconfigure/pom.xml +++ b/spring-boot-autoconfigure/pom.xml @@ -390,6 +390,12 @@ aspectjweaver true + + + org.springframework.boot + spring-boot-configuration-processor + true + org.springframework.boot diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceConfigMetadata.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceConfigMetadata.java new file mode 100644 index 0000000000..d7faf1c493 --- /dev/null +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceConfigMetadata.java @@ -0,0 +1,49 @@ +/* + * Copyright 2012-2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.autoconfigure.jdbc; + +import com.zaxxer.hikari.HikariDataSource; +import org.apache.commons.dbcp.BasicDataSource; +import org.apache.tomcat.jdbc.pool.DataSource; + +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * Expose the metadata of the supported data sources. Only used to harvest + * the relevant properties metadata. + * + * @author Stephane Nicoll + * @since 1.2.0 + */ +class DataSourceConfigMetadata { + + @ConfigurationProperties(DataSourceProperties.PREFIX) + public DataSource tomcatDataSource() { + return (DataSource) DataSourceBuilder.create().type(DataSource.class).build(); + } + + @ConfigurationProperties(DataSourceProperties.PREFIX) + public HikariDataSource hikariDataSource() { + return (HikariDataSource) DataSourceBuilder.create().type(HikariDataSource.class).build(); + } + + @ConfigurationProperties(DataSourceProperties.PREFIX) + public BasicDataSource dbcpDataSource() { + return (BasicDataSource)DataSourceBuilder.create().type(BasicDataSource.class).build(); + } + +} diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java index fb8ee46c7e..1a752d4210 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java @@ -80,7 +80,7 @@ public class DataSourceProperties implements BeanClassLoaderAware, InitializingB .get(this.classLoader); } - protected String getDriverClassName() { + public String getDriverClassName() { if (StringUtils.hasText(this.driverClassName)) { Assert.state(ClassUtils.isPresent(this.driverClassName, null), "Cannot load driver class: " + this.driverClassName); diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 421e24488c..5a1a82c17b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -381,4 +381,5 @@ public class ServerProperties implements EmbeddedServletContainerCustomizer { } } + } diff --git a/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000000..2d0c34d1ea --- /dev/null +++ b/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,85 @@ +{"properties": [ + { + "name": "spring.aop.auto", + "dataType": "java.lang.Boolean", + "description": "Automatically adds @EnableAspectJAutoProxy.", + "defaultValue": true, + }, + { + "name": "spring.aop.proxy-target-class", + "dataType": "java.lang.Boolean", + "description": "Whether subclass-based (CGLIB) proxies are to be created (true) as opposed to standard Java interface-based proxies (false).", + "defaultValue": false, + }, + { + "name": "spring.batch.enabled", + "dataType": "java.lang.Boolean", + "description": "Execute all Spring Batch jobs in the context on startup.", + "defaultValue": true, + }, + { + "name": "spring.data.elasticsearch.repositories.enabled", + "dataType": "java.lang.Boolean", + "description": "Automatically enable Elasticsearch repositories.", + "defaultValue": true, + }, + { + "name": "spring.data.jpa.repositories.enabled", + "dataType": "java.lang.Boolean", + "description": "Automatically enable JPA repositories.", + "defaultValue": true, + }, + { + "name": "spring.data.mongo.repositories.enabled", + "dataType": "java.lang.Boolean", + "description": "Automatically enable Mongo repositories.", + "defaultValue": true, + }, + { + "name": "spring.data.solr.repositories.enabled", + "dataType": "java.lang.Boolean", + "description": "Automatically enable Solr repositories.", + "defaultValue": true, + }, + { + "name": "spring.jmx.enabled", + "dataType": "java.lang.Boolean", + "description": "Automatically expose management beans to the JMX domain", + "defaultValue": true, + }, + { + "name": "spring.jpa.open-in-view", + "dataType": "java.lang.Boolean", + "description": "Automatically register OpenEntityManagerInViewInterceptor. Binds a JPA EntityManager to the thread for the entire processing of the request.", + "defaultValue": true, + }, + { + "name": "spring.mobile.devicedelegatingviewresolver.enabled", + "dataType": "java.lang.Boolean", + "description": "Enable device view resolver.", + "defaultValue": false, + }, + { + "name": "spring.mobile.sitepreference.enabled", + "dataType": "java.lang.Boolean", + "description": "Enable SitePreferenceHandler.", + "defaultValue": true, + }, + { + "name": "spring.social.auto-connection-views", + "dataType": "java.lang.Boolean", + "description": "Automatically enable the connection status view for supported providers.", + "defaultValue": false, + }, + { + "name": "spring.view.prefix", + "dataType": "java.lang.String", + "description": "Spring MVC view prefix.", + }, + { + "name": "spring.view.suffix", + "dataType": "java.lang.String", + "description": "Spring MVC view suffix.", + } +]} + diff --git a/spring-boot/pom.xml b/spring-boot/pom.xml index d51218d1f2..fa1b23f683 100644 --- a/spring-boot/pom.xml +++ b/spring-boot/pom.xml @@ -169,6 +169,12 @@ snakeyaml true + + + org.springframework.boot + spring-boot-configuration-processor + true + org.apache.httpcomponents diff --git a/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json new file mode 100644 index 0000000000..526c4af3fa --- /dev/null +++ b/spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -0,0 +1,73 @@ +{"groups": [ + { + "name": "logging", + "sourceType": "org.springframework.boot.logging.LoggingApplicationListener" + } +],"properties": [ + { + "name": "logging.config", + "dataType": "java.lang.String", + "description": "Location of the logging configuration file." + }, + { + "name": "logging.file", + "dataType": "java.lang.String", + "description": "The name of the log file." + }, + { + "name": "logging.path", + "dataType": "java.lang.String", + "description": "Location of the log file." + }, + { + "name": "spring.mandatory-file-encoding", + "sourceType": "org.springframework.boot.context.FileEncodingApplicationListener", + "dataType": "java.lang.String", + "description": "The character encoding the application must use." + }, + { + "name": "spring.application.name", + "dataType": "java.lang.String", + "sourceType": "org.springframework.boot.context.ContextIdApplicationContextInitializer", + "description": "The name of the application." + }, + { + "name": "spring.application.index", + "dataType": "java.lang.Integer", + "sourceType": "org.springframework.boot.context.ContextIdApplicationContextInitializer", + "description": "Index of the application." + }, + { + "name": "spring.config.name", + "dataType": "java.lang.String", + "sourceType": "org.springframework.boot.context.config.ConfigFileApplicationListener", + "description": "Config file name", + "defaultValue": "application", + }, + { + "name": "spring.config.location", + "dataType": "java.lang.String", + "sourceType": "org.springframework.boot.context.config.ConfigFileApplicationListener", + "description": "Config file locations", + }, + { + "name": "spring.main.show-banner", + "dataType": "java.lang.Boolean", + "sourceType": "org.springframework.boot.SpringApplication", + "description": "Display the banner when the application runs", + "defaultValue": true, + }, + { + "name": "spring.main.sources", + "dataType": "java.util.Set", + "sourceType": "org.springframework.boot.SpringApplication", + "description": "Sources (class name, package name or XML resource location) used to create the ApplicationContext." + }, + { + "name": "spring.main.web-environment", + "dataType": "java.lang.Boolean", + "sourceType": "org.springframework.boot.SpringApplication", + "description": "Run the application in a web environment (auto-detected by default)" + } +]} +