完善插件
This commit is contained in:
+1
-2
@@ -2,8 +2,6 @@ package com.micro.fast.mybatis.generator.extend.mojo;
|
||||
|
||||
|
||||
import com.micro.fast.mybatis.generator.extend.service.MybatisGeneratorExtend;
|
||||
import com.micro.fast.mybatis.generator.extend.util.FreemarkerUtil;
|
||||
import com.micro.fast.mybatis.generator.extend.util.JarUtil;
|
||||
import com.micro.fast.mybatis.generator.extend.util.PropertiesUtil;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
@@ -35,6 +33,7 @@ public class MybatisGeneratorExtendMojo extends AbstractMojo {
|
||||
}
|
||||
}
|
||||
}
|
||||
//加载插件所需要的配置文件
|
||||
new PropertiesUtil().loadProperties(projectPath);
|
||||
MybatisGeneratorExtend.GenerateMybatisGeneratorNeedFilesByTemplates(projectPath);
|
||||
}
|
||||
|
||||
-2
@@ -105,7 +105,5 @@ public class MybatisGeneratorExtend {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+12
@@ -8,13 +8,25 @@ import java.util.jar.JarInputStream;
|
||||
|
||||
public class JarUtil {
|
||||
|
||||
/**
|
||||
* 获取当前jar的绝对路径
|
||||
* @return
|
||||
*/
|
||||
public static String getThisJarPath(){
|
||||
return JarUtil.class.getProtectionDomain().getCodeSource().getLocation().getPath();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前jar绝对路径的父路径
|
||||
* @return
|
||||
*/
|
||||
public static String getThisJarPathParent(){
|
||||
return new File(getThisJarPath()).getParent();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解压当前jar中所需要的文件
|
||||
*/
|
||||
public static void unThisJar(){
|
||||
JarInputStream jarInputStream = null;
|
||||
JarFile jarFile = null;
|
||||
|
||||
-3
@@ -6,9 +6,6 @@ import java.util.Properties;
|
||||
public class PropertiesUtil {
|
||||
private static final String PROPERTIES_PATH = "mybatisStart.properties";
|
||||
private static Properties properties = null;
|
||||
static {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据key获取property的value
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#mybatisGeneratorExtend\u6240\u9700\u8981\u7684\u53C2\u6570
|
||||
#mybatisGeneratorExtend 所需要的必要的配置文件
|
||||
db.driverLocation=/root/mysql-connector-java-5.1.40-bin.jar
|
||||
db.driverClassName=com.mysql.jdbc.Driver
|
||||
db.url=jdbc:mysql://172.17.0.1:3317/micro?useUncoide=true&chracterEncoding=utf-8&useSSL=false
|
||||
|
||||
Reference in New Issue
Block a user