比如有個工程里邊有2個不同的模塊,module001和module002都有相同包路徑:org.hello.service而且都有相同的類:helloService.java但是他們不相互依賴,但是父類模塊是一個(maven) <modules> <module>module001</module> <module>module002</module> </modules>那么如果spring注入配置<context:component-scan base-package="org.hello.service"/>他是掃描001還是掃描002下的helloService?或者說,打包成war的時候,會合并這2個文件?還有為什么2個模塊包和名一樣,還能建立2個不同文件,雖然物理路徑不同,但是打包war以后,路徑應(yīng)該都是org.hello.service.helloService.java吧,不會沖突什么的嗎?
java中2個不同模塊,但是包路徑一樣,是否會引起沖突?
拉風(fēng)的咖菲貓
2019-03-12 13:14:56