mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58:24 +08:00
feat: ✨ processor 读取 mybatis-flex.properties 文件添加使用 ClassLoader 读取
This commit is contained in:
parent
d454ff78d0
commit
f1e3f8df22
@ -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()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user