forked from spring-projects/spring-boot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate standard configuration meta-data
Update the `spring-boot`, `spring-boot-autoconfigure` and `spring-boot-actuator` project to generate configuration meta-data files during compilation. See spring-projectsgh-1001
- Loading branch information
Showing
9 changed files
with
235 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...g-boot-actuator/src/main/resources/META-INF/additional-spring-configuration-metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{"properties": [ | ||
{ | ||
"name": "spring.git.properties", | ||
"dataType": "java.lang.String", | ||
"description": "Resource reference to a generated git info properties file." | ||
} | ||
]} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...e/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceConfigMetadata.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -381,4 +381,5 @@ public void customize(Connector connector) { | |
} | ||
|
||
} | ||
|
||
} |
85 changes: 85 additions & 0 deletions
85
...t-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.", | ||
} | ||
]} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
spring-boot/src/main/resources/META-INF/additional-spring-configuration-metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<java.lang.Object>", | ||
"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)" | ||
} | ||
]} | ||
|