How to set Spring component scan in the Spring YML configuration file? -
i can see can component scan , restrict packages scanned using xml file.
<beans> <context:component-scan base-package="com.mycompany"/> </beans>
how can same in yml file?
yml load properties, refer spring documentation.
24.6 using yaml instead of properties yaml superset of json, , such convenient format specifying hierarchical configuration data. springapplication class automatically support yaml alternative properties whenever have snakeyaml library on classpath.
this explained here.
you can use yaml ('.yml') files alternative '.properties'.
so cannot define/configure beans using yml.
Comments
Post a Comment