From f1e3f8df225357d9989681d7192eb94edbc3f18c Mon Sep 17 00:00:00 2001 From: XiaoLin Date: Wed, 17 May 2023 01:00:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20processor=20=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=20mybatis-flex.properties=20=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BD=BF=E7=94=A8=20ClassLoader=20=E8=AF=BB?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mybatisflex/processor/MyBatisFlexProps.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mybatis-flex-processor/src/main/java/com/mybatisflex/processor/MyBatisFlexProps.java b/mybatis-flex-processor/src/main/java/com/mybatisflex/processor/MyBatisFlexProps.java index 1b2e368b..192eb120 100644 --- a/mybatis-flex-processor/src/main/java/com/mybatisflex/processor/MyBatisFlexProps.java +++ b/mybatis-flex-processor/src/main/java/com/mybatisflex/processor/MyBatisFlexProps.java @@ -25,8 +25,8 @@ import java.util.Properties; class MyBatisFlexProps { - protected Properties properties = new Properties(); private static final String DEFAULT_ENCODING = "UTF-8"; + protected Properties properties = new Properties(); public MyBatisFlexProps(Filer filer) { InputStream inputStream = null; @@ -37,6 +37,8 @@ class MyBatisFlexProps { File propertiesFile = new File(propertiesFileObject.toUri()); if (propertiesFile.exists()) { inputStream = propertiesFileObject.openInputStream(); + } else if (getClass().getClassLoader().getResource("mybatis-flex.properties") != null) { + inputStream = getClass().getClassLoader().getResourceAsStream("mybatis-flex.properties"); } else { File pomXmlFile = new File(propertiesFile.getParentFile().getParentFile().getParentFile(), "pom.xml"); if (pomXmlFile.exists()) {