Adds autoconfiguration for springboot apps.#459
Conversation
Codecov Report
@@ Coverage Diff @@
## master #459 +/- ##
=========================================
Coverage 82.77% 82.77%
Complexity 930 930
=========================================
Files 79 79
Lines 2717 2717
Branches 269 269
=========================================
Hits 2249 2249
Misses 334 334
Partials 134 134 Continue to review full report at Codecov.
|
| <dependencyManagement> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-dependencies</artifactId> | ||
| <version>${springboot.version}</version> | ||
| <type>pom</type> | ||
| <scope>import</scope> | ||
| </dependency> | ||
| </dependencies> | ||
| </dependencyManagement> | ||
|
|
There was a problem hiding this comment.
Be careful of this segment, this will override okhttp version set in dapr-sdk, because spring boot also makes their version declaration in spring-boot-depencies, which conficts with dapr's.
There was a problem hiding this comment.
For this one I am OK since users would need to solve a version conflict too. If this becomes a problem we would know in our integration tests. Thanks for pointing this out. Learned one more thing.
| /** | ||
| * Dapr's Spring Boot AutoConfiguration. | ||
| */ | ||
| @Configuration | ||
| @ConditionalOnWebApplication | ||
| @ComponentScan("io.dapr.springboot") | ||
| public class DaprAutoConfiguration { | ||
| } |
There was a problem hiding this comment.
You can use @ComponentScan here, also, you can replace it with @Bean method and @ConditionalOnProperty to provide finer grained control of beans, e.g. you can use property like dapr.controller.enabled to control whether to create the controller bean.
There was a problem hiding this comment.
Would this be a breaking change? If not, you could send a PR after this. You have more knowledge about spring boot than me.
There was a problem hiding this comment.
No, we can release this version this time, and make additional improments in the future.
There was a problem hiding this comment.
Thanks. That will also give you time to prepare a PR with your ideas. This one was great BTW. Thanks a lot.
Description
Adds autoconfiguration for springboot apps.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #441
Inspired by #457
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: