Found a problem, very egg ache.
Our project is composed of n projects, the periphery is the Web project, the internal engineering is packaged into jars, and put into the peripheral engineering Web-inf/lib
The internal engineering uses spring annotations, such as @service, @Controller, etc., can be scanned before hitting the jar package, but after the jar package, it will not be scanned, the report nosuchbeanexception
After searching the internet, I found a way to check the Add directory entries when using the Eclipse export jar.
This can be solved by hitting out the jar package, which can also be scanned into the jar package with the bean in the note declaration. If the Add directory entries is not checked, it will not be
Using the jar command, compare the difference between the two methods of the jar package,
You can see, tick the Add directory entries after the shot of the jar package, more information about the path, perhaps this is the difference
But now the problem is, we can not all use the manual export jar in the way of exporting the jar package, do not know in Maven, to configure what parameters of the plug-in to achieve the same effect,
Reference Blog: http://kyfxbl.iteye.com/blog/1675368
About Maven, I'm free to study.
Beans declared with spring annotation cannot be scanned when packaged in a jar