SpringData JPA 排除 扫描 exclude-filter 不能使用解决

在加上JPA的配置外,还需要再加上 :
xmlns:repository="http://www.springframework.org/schema/data/repository"
http://www.springframework.org/schema/data/repository http://www.springframework.org/schema/data/repository/spring-repository.xsd

否则 会提示 找不到 exclude-filter 这个元素,
在配上上面的定义后, 就可以使用排除:
<repository:exclude-filter type="regex" expression=".*DAO"/>

以下是相关关键代码:

xmlns 配置说明 :

描包及排除 配置说明 :

<jpa:repositories base-package="com.XXX.XX.XXX.dao"  repository-impl-postfix="Impl" entity-manager-factory-ref="entityManagerFactory" transaction-manager-ref="transactionManager"  >
	<repository:exclude-filter type="regex" expression=".*DAO"/>
</jpa:repositories>
原文地址:https://www.cnblogs.com/wuyifu/p/5649312.html