简体   繁体   中英

want to filter scanned jars for Spring component scanning

I am trying to optimize a massive Spring 4, Tomcat app. Startup time is about 2 mins, and I'm wondering if there is a way to exclude certain jar files from being scanned? eg, I don't need commons-lang being scanned b/c Spring doeesn't care about that, but since you define the scanning based on context:component-scan/base-package in applicationContext.xml, i don't quite understand how I can do that. Any ideas? Maybe do something with the resource-pattern attribute?

In Spring 5, one can try a new feature, which generates a list of candidates at compile time. Reference: 1.10.9. Generating an index of candidate components

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM