File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
src/main/java/io/github/wayn111/mybatis/xmlreload Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 55 <packaging >jar</packaging >
66 <groupId >io.github.wayn111</groupId >
77 <artifactId >mybatis-xmlreload-spring-boot-starter</artifactId >
8- <version >3.0.2 </version >
8+ <version >3.0.3 </version >
99 <name >mybatis-xmlreload-spring-boot-starter</name >
1010 <url >https://github.com/wayn111/mybatis-xmlreload-spring-boot-starter</url >
1111 <description >mybais springboot项目中xml文件热加载支持</description >
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public void xmlReload() throws IOException {
4646 PathMatchingResourcePatternResolver patternResolver = new PathMatchingResourcePatternResolver ();
4747 String CLASS_PATH_TARGET = File .separator + "target" + File .separator + "classes" ;
4848 String MAVEN_RESOURCES = "/src/main/resources" ;
49- Pattern CLASS_PATH_PATTERN = Pattern .compile ("(classpath\\ *?:)(\\ w*)" );
49+ // Pattern CLASS_PATH_PATTERN = Pattern.compile("(classpath\\*?:)(\\w*)");
5050
5151 List <Resource > mapperLocationsTmp = Stream .of (Optional .of (prop .getMapperLocations ()).orElse (new String [0 ]))
5252 .flatMap (location -> Stream .of (getResources (patternResolver , location ))).toList ();
Original file line number Diff line number Diff line change 33import io .github .wayn111 .mybatis .xmlreload .MybatisXmlReload ;
44import org .apache .ibatis .session .SqlSessionFactory ;
55import org .springframework .boot .autoconfigure .condition .ConditionalOnMissingBean ;
6+ import org .springframework .boot .autoconfigure .condition .ConditionalOnProperty ;
67import org .springframework .boot .context .properties .EnableConfigurationProperties ;
78import org .springframework .context .annotation .Bean ;
89import org .springframework .context .annotation .Configuration ;
@@ -24,7 +25,9 @@ public class MybatisXmlReloadConfiguration {
2425 public MybatisXmlReload mybatisXmlReload (MybatisXmlReloadProperties prop ,
2526 List <SqlSessionFactory > sqlSessionFactories ) throws IOException {
2627 MybatisXmlReload mybatisXmlReload = new MybatisXmlReload (prop , sqlSessionFactories );
27- mybatisXmlReload .xmlReload ();
28+ if (prop .getEnabled ()) {
29+ mybatisXmlReload .xmlReload ();
30+ }
2831 return mybatisXmlReload ;
2932 }
3033
You can’t perform that action at this time.
0 commit comments