-
Notifications
You must be signed in to change notification settings - Fork 693
Creates spring-cloud-gcp-autoconfigure module #276
Changes from 29 commits
f2624c8
932a437
1ec45bf
41aea29
9213f28
c669ea9
203d0cf
0a4362a
2942c60
13dd3d6
8303715
0f609e0
2287602
77364d4
b231149
ac3dedb
2de9f93
a53aef5
902eea3
2b7852a
5813ae8
0d47060
c5486c7
2ccc845
1da213a
96c58fd
2d39c0d
7c3da59
252a533
13c45aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?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"> | ||
<parent> | ||
<artifactId>spring-cloud-gcp</artifactId> | ||
<groupId>org.springframework.cloud</groupId> | ||
<version>1.0.0.BUILD-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>spring-cloud-gcp-autoconfigure</artifactId> | ||
<name>Spring Cloud GCP Autoconfigure Module</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-autoconfigure</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-gcp-core</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
<!-- Configuration processor --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-configuration-processor</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-gcp-config</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ | ||
org.springframework.cloud.gcp.autoconfigure.core.GcpContextAutoConfiguration | ||
|
||
org.springframework.cloud.bootstrap.BootstrapConfiguration=\ | ||
org.springframework.cloud.gcp.autoconfigure.config.GcpConfigAutoConfiguration,\ | ||
org.springframework.cloud.gcp.autoconfigure.core.GcpContextAutoConfiguration | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know enough about that stuff to be positive but the fact those classes are both auto-config and bootstrap config is a smell IMO. (nothing to do with this issue per se but I thought I'd mention it). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?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"> | ||
<parent> | ||
<artifactId>spring-cloud-gcp</artifactId> | ||
<groupId>org.springframework.cloud</groupId> | ||
<version>1.0.0.BUILD-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>spring-cloud-gcp-config</artifactId> | ||
<name>Spring Cloud GCP Runtime Configuration Module</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-web</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-logging</groupId> | ||
<artifactId>commons-logging</artifactId> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1. Can't have commons-logging as a transitive for user apps. OTOH, if we just merge this tiny module and make it depend on Spring Boot (like it feels it should), then it's probably moot. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Merger of the As per my comment, I don't think it's doable, but your input is welcome! |
||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-context</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-gcp-core</artifactId> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Copyright 2017 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.cloud.gcp.config; | ||
|
||
import org.springframework.cloud.gcp.core.Credentials; | ||
|
||
/** | ||
* Provides the required properties for Spring Cloud GCP Runtime Configuration. | ||
* | ||
* @author João André Martins | ||
*/ | ||
public interface GcpConfigPropertiesProvider { | ||
|
||
/** | ||
* Determines if Spring Cloud GCP Runtime Configuration is enabled. | ||
*/ | ||
boolean isEnabled(); | ||
|
||
/** | ||
* The name of the Spring Application being run. | ||
*/ | ||
String getName(); | ||
|
||
/** | ||
* The profile running the app. For example, "prod", "dev", etc. | ||
*/ | ||
String getProfile(); | ||
|
||
/** | ||
* The timeout for reaching Google Runtime Configuration API. | ||
*/ | ||
int getTimeoutMillis(); | ||
|
||
/** | ||
* An override to the GCP project ID in the core module. | ||
*/ | ||
String getProjectId(); | ||
|
||
/** | ||
* An override to the GCP credentials in the core module. | ||
*/ | ||
Credentials getCredentials(); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
org.springframework.cloud.bootstrap.BootstrapConfiguration=\ | ||
org.springframework.cloud.gcp.config.GoogleConfigPropertySourceLocator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not
BootstrapConfiguration
part. This must be for theorg.springframework.boot.autoconfigure.EnableAutoConfiguration
propertyThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is correct, because it's for
BootstrapConfiguration
, as required by Spring Cloud Config.