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

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -