mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 09:08:24 +08:00
!34 processor 读取 mybatis-flex.properties 文件添加使用 ClassLoader 读取
Merge pull request !34 from Saoforest/main
This commit is contained in:
commit
e15de1ac9f
@ -25,8 +25,8 @@ import java.util.Properties;
|
|||||||
|
|
||||||
class MyBatisFlexProps {
|
class MyBatisFlexProps {
|
||||||
|
|
||||||
protected Properties properties = new Properties();
|
|
||||||
private static final String DEFAULT_ENCODING = "UTF-8";
|
private static final String DEFAULT_ENCODING = "UTF-8";
|
||||||
|
protected Properties properties = new Properties();
|
||||||
|
|
||||||
public MyBatisFlexProps(Filer filer) {
|
public MyBatisFlexProps(Filer filer) {
|
||||||
InputStream inputStream = null;
|
InputStream inputStream = null;
|
||||||
@ -37,6 +37,8 @@ class MyBatisFlexProps {
|
|||||||
File propertiesFile = new File(propertiesFileObject.toUri());
|
File propertiesFile = new File(propertiesFileObject.toUri());
|
||||||
if (propertiesFile.exists()) {
|
if (propertiesFile.exists()) {
|
||||||
inputStream = propertiesFileObject.openInputStream();
|
inputStream = propertiesFileObject.openInputStream();
|
||||||
|
} else if (getClass().getClassLoader().getResource("mybatis-flex.properties") != null) {
|
||||||
|
inputStream = getClass().getClassLoader().getResourceAsStream("mybatis-flex.properties");
|
||||||
} else {
|
} else {
|
||||||
File pomXmlFile = new File(propertiesFile.getParentFile().getParentFile().getParentFile(), "pom.xml");
|
File pomXmlFile = new File(propertiesFile.getParentFile().getParentFile().getParentFile(), "pom.xml");
|
||||||
if (pomXmlFile.exists()) {
|
if (pomXmlFile.exists()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user