我有问题。我们使用注释等声明了一些spring bean:
@Controller
public class BookAction{}
它工作得很好。但是当我们把它打包到一个罐子里时,豆子计数不会被扫描,因为我们已经设置了:
<context:component-scan base-package="com.xxx.nsm.framework" />
有人说,在eclipse中,我们可以export-->jar,勾选“Add Directory Entiries”,解决这个问题,就可以了
以下是不同之处:
带有目录条目的 jar:
C:\>jar tf test_inside_with_de.jar
META-INF/MANIFEST.MF
net/
net/kyfxbl/
net/kyfxbl/test/
net/kyfxbl/test/inside/
net/kyfxbl/test/inside/action/
net/kyfxbl/test/inside/action/BookAction.class
net/kyfxbl/test/inside/action/BookAction.java
net/kyfxbl/test/inside/service/
net/kyfxbl/test/inside/service/IBookService.class
net/kyfxbl/test/inside/service/IBookService.java
net/kyfxbl/test/inside/service/impl/
net/kyfxbl/test/inside/service/impl/BookService.class
net/kyfxbl/test/inside/service/impl/BookService.java
spring-config.xml
struts.xml
没有目录条目的 jar:
C:\>jar tf test_inside.jar
META-INF/MANIFEST.MF
net/kyfxbl/test/inside/action/BookAction.class
net/kyfxbl/test/inside/action/BookAction.java
net/kyfxbl/test/inside/service/IBookService.class
net/kyfxbl/test/inside/service/IBookService.java
net/kyfxbl/test/inside/service/impl/BookService.class
net/kyfxbl/test/inside/service/impl/BookService.java
spring-config.xml
struts.xml
但我们使用的是 maven,所以我的问题是:如何在 MAVEN3 中制作一个带有目录条目的 jar?
多谢 !