mirror of
https://github.com/wahyd4/Martian.git
synced 2026-08-09 05:16:21 +10:00
update version
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>Mars</artifactId>
|
||||
<groupId>com.github.yuyenews</groupId>
|
||||
<version>3.0.13</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>mars-start-base</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.yuyenews</groupId>
|
||||
<artifactId>mars-mvc</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.yuyenews</groupId>
|
||||
<artifactId>mars-redis</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.yuyenews</groupId>
|
||||
<artifactId>mars-jdbc</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.mars.start.base;
|
||||
|
||||
import com.mars.core.annotation.MarsTest;
|
||||
import com.mars.core.base.config.MarsConfig;
|
||||
import com.mars.core.util.MarsConfiguration;
|
||||
import com.mars.jdbc.load.InitJdbc;
|
||||
import com.mars.start.startmap.StartLoadList;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* 单测基类
|
||||
*/
|
||||
public abstract class BaseJunit {
|
||||
|
||||
private Logger logger = LoggerFactory.getLogger(BaseJunit.class);
|
||||
|
||||
public BaseJunit(){
|
||||
MarsTest marsTest = this.getClass().getAnnotation(MarsTest.class);
|
||||
if(marsTest == null || marsTest.startClass() == null){
|
||||
logger.error("没有正确的配置MarsTest注解");
|
||||
} else {
|
||||
init(marsTest.startClass());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取配置信息
|
||||
* @return
|
||||
*/
|
||||
public abstract MarsConfig getMarsConfig();
|
||||
|
||||
/**
|
||||
* 加载单测需要的资源
|
||||
* @param packName 包
|
||||
*/
|
||||
public void init(Class packName){
|
||||
MarsConfiguration.loadConfig(getMarsConfig());
|
||||
MarsJunitStart.setStartList(StartLoadList.initTestStartList());
|
||||
MarsJunitStart.start(getInitJdbc(),packName,this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取加载jdbc的类
|
||||
* @return 类
|
||||
*/
|
||||
public abstract InitJdbc getInitJdbc();
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.mars.start.base;
|
||||
|
||||
import com.mars.core.util.MarsConfiguration;
|
||||
import com.mars.jdbc.load.InitJdbc;
|
||||
import com.mars.netty.server.MarsServer;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 启动Mars框架
|
||||
* @author yuye
|
||||
*
|
||||
*/
|
||||
public class BaseStartMars {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(BaseStartMars.class);
|
||||
|
||||
private static Map<Integer, StartMap> startList;
|
||||
|
||||
public static void setStartList(Map<Integer, StartMap> startList) {
|
||||
BaseStartMars.startList = startList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动Mars框架
|
||||
* @param clazz
|
||||
*/
|
||||
public static void start(Class<?> clazz, InitJdbc initJdbc) {
|
||||
try {
|
||||
|
||||
log.info("程序启动中......");
|
||||
|
||||
/* 加载框架数据 */
|
||||
StartLoad.load(initJdbc,clazz,startList);
|
||||
|
||||
/* 启动tomcat */
|
||||
MarsServer.start(getPort());
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("启动失败",e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取端口号,默认8080
|
||||
* @return
|
||||
*/
|
||||
private static int getPort() {
|
||||
return MarsConfiguration.getConfig().port();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.mars.start.base;
|
||||
|
||||
import com.mars.core.constant.MarsConstant;
|
||||
import com.mars.core.constant.MarsSpace;
|
||||
import com.mars.core.load.LoadHelper;
|
||||
import com.mars.core.load.WriteFields;
|
||||
import com.mars.jdbc.load.InitJdbc;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 单测启动器
|
||||
*/
|
||||
public class MarsJunitStart {
|
||||
|
||||
private static Logger log = LoggerFactory.getLogger(MarsJunitStart.class);
|
||||
|
||||
/**
|
||||
* 获取全局存储空间
|
||||
*/
|
||||
private static MarsSpace constants = MarsSpace.getEasySpace();
|
||||
|
||||
private static Map<Integer, StartMap> startList;
|
||||
|
||||
public static void setStartList(Map<Integer, StartMap> startList) {
|
||||
MarsJunitStart.startList = startList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动Mars框架
|
||||
*/
|
||||
public static void start(InitJdbc initJdbc, Class<?> packName, Object obj) {
|
||||
try {
|
||||
if(constants.getAttr(MarsConstant.HAS_TEST) == null){
|
||||
log.info("程序启动中......");
|
||||
|
||||
/* 加载框架数据 */
|
||||
StartLoad.load(initJdbc,packName,startList);
|
||||
|
||||
/* 标记已经为单测创建过资源了 */
|
||||
constants.setAttr(MarsConstant.HAS_TEST,"yes");
|
||||
}
|
||||
|
||||
/* 给单测注入属性 */
|
||||
autoWrite(obj);
|
||||
|
||||
/* 标识是否已经启动 */
|
||||
constants.setAttr(MarsConstant.HAS_NETTY_START,"yes");
|
||||
|
||||
log.info("开始执行单测......");
|
||||
} catch (Exception e) {
|
||||
log.error("启动失败",e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 给单测注入属性
|
||||
*/
|
||||
public static void autoWrite(Object obj) {
|
||||
try {
|
||||
Class cls = obj.getClass();
|
||||
WriteFields.writeFields(cls,obj,LoadHelper.getBeanObjectMap());
|
||||
} catch (Exception e){
|
||||
log.error("初始化单测出现异常",e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.mars.start.base;
|
||||
|
||||
import com.mars.jdbc.load.InitJdbc;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 加载所需的资源
|
||||
*/
|
||||
public class StartLoad {
|
||||
|
||||
/**
|
||||
* 加载所需的资源
|
||||
* @param initJdbc jdbc加载器
|
||||
* @param packName 要扫描的包
|
||||
* @param startList 要加载的责任链
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
public static void load(InitJdbc initJdbc, Class<?> packName, Map<Integer, StartMap> startList) throws Exception{
|
||||
|
||||
StartParam startParam = new StartParam();
|
||||
startParam.setClazz(packName);
|
||||
startParam.setInitJdbc(initJdbc);
|
||||
|
||||
for(int i=0; i < startList.size(); i++){
|
||||
startList.get(i).load(startParam);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.mars.start.startmap;
|
||||
|
||||
import com.mars.start.startmap.impl.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 启动框架需要加载的资源
|
||||
*/
|
||||
public class StartLoadList {
|
||||
|
||||
/**
|
||||
* 启动框架需要加载的资源
|
||||
* @return 返回值
|
||||
*/
|
||||
public static Map<Integer, StartMap> initStartList(){
|
||||
|
||||
Map<Integer, StartMap> startList = new HashMap<>();
|
||||
|
||||
startList.put(0, new StartCoreServlet());
|
||||
startList.put(1, new StartLoadClass());
|
||||
startList.put(2, new StartBeans());
|
||||
startList.put(3, new StartJDBC());
|
||||
startList.put(4, new StartBeanObject());
|
||||
startList.put(5, new StartMarsApi());
|
||||
startList.put(6, new StartInter());
|
||||
startList.put(7, new HasStart());
|
||||
startList.put(8, new StartMarsTimer());
|
||||
startList.put(9, new StartLoadAfter());
|
||||
startList.put(10, new StartExecuteTimer());
|
||||
return startList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动单测需要加载的资源
|
||||
* @return 返回值
|
||||
*/
|
||||
public static Map<Integer,StartMap> initTestStartList(){
|
||||
|
||||
Map<Integer, StartMap> startList = new HashMap<>();
|
||||
|
||||
startList.put(0, new StartLoadClass());
|
||||
startList.put(1, new StartBeans());
|
||||
startList.put(2, new StartJDBC());
|
||||
startList.put(3, new StartBeanObject());
|
||||
startList.put(4, new HasStart());
|
||||
startList.put(5, new StartMarsTimer());
|
||||
startList.put(6, new StartLoadAfter());
|
||||
startList.put(7, new StartExecuteTimer());
|
||||
return startList;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.mars.start.startmap;
|
||||
|
||||
/**
|
||||
* 启动map
|
||||
*/
|
||||
public interface StartMap {
|
||||
|
||||
/**
|
||||
* 要加载的东西
|
||||
* @param startParam 参数
|
||||
*/
|
||||
void load(StartParam startParam) throws Exception ;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.mars.start.startmap;
|
||||
|
||||
import com.mars.jdbc.load.InitJdbc;
|
||||
|
||||
/**
|
||||
* 启动框架的参数
|
||||
*/
|
||||
public class StartParam {
|
||||
|
||||
/**
|
||||
* 启动类
|
||||
*/
|
||||
private Class<?> clazz;
|
||||
/**
|
||||
* 启动类所在的包
|
||||
*/
|
||||
private String startClassName;
|
||||
/**
|
||||
* 加载JDBC的类
|
||||
*/
|
||||
private InitJdbc initJdbc;
|
||||
/**
|
||||
* 配置文件标识
|
||||
*/
|
||||
private String suffix;
|
||||
|
||||
public Class<?> getClazz() {
|
||||
return clazz;
|
||||
}
|
||||
|
||||
public String getStartClassName() {
|
||||
return startClassName;
|
||||
}
|
||||
|
||||
public void setStartClassName(String startClassName) {
|
||||
this.startClassName = startClassName;
|
||||
}
|
||||
|
||||
public void setClazz(Class<?> clazz) {
|
||||
this.clazz = clazz;
|
||||
}
|
||||
|
||||
public InitJdbc getInitJdbc() {
|
||||
return initJdbc;
|
||||
}
|
||||
|
||||
public void setInitJdbc(InitJdbc initJdbc) {
|
||||
this.initJdbc = initJdbc;
|
||||
}
|
||||
|
||||
public String getSuffix() {
|
||||
return suffix;
|
||||
}
|
||||
|
||||
public void setSuffix(String suffix) {
|
||||
this.suffix = suffix;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.core.constant.MarsConstant;
|
||||
import com.mars.core.constant.MarsSpace;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
|
||||
/**
|
||||
* 标识createBean方法已经调用完毕
|
||||
*/
|
||||
public class HasStart implements StartMap {
|
||||
|
||||
/**
|
||||
* 获取全局存储空间
|
||||
*/
|
||||
private MarsSpace constants = MarsSpace.getEasySpace();
|
||||
|
||||
/**
|
||||
* 标识createBean方法已经调用完毕
|
||||
* @param startParam 参数
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
constants.setAttr(MarsConstant.HAS_START,"yes");
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.ioc.load.LoadMarsBean;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
|
||||
/**
|
||||
* 创建bean对象
|
||||
*/
|
||||
public class StartBeanObject implements StartMap {
|
||||
|
||||
/**
|
||||
* 创建bean对象
|
||||
* @param startParam 参数
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
LoadMarsBean.loadBean();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.core.load.LoadBeans;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
|
||||
/**
|
||||
* 扫描包
|
||||
*/
|
||||
public class StartBeans implements StartMap {
|
||||
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
LoadBeans.loadBeans();
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.core.ncfg.mvc.CoreServletClass;
|
||||
import com.mars.mvc.servlet.MarsCoreServlet;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
|
||||
/**
|
||||
* 配置核心servlet
|
||||
*/
|
||||
public class StartCoreServlet implements StartMap {
|
||||
|
||||
/**
|
||||
* 配置核心servlet
|
||||
* @param startParam 参数
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
CoreServletClass.setCls(MarsCoreServlet.class);
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
import com.mars.timer.execute.ExecuteMarsTimer;
|
||||
|
||||
public class StartExecuteTimer implements StartMap {
|
||||
|
||||
/**
|
||||
* 执行定时任务
|
||||
* @param startParam 参数
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
ExecuteMarsTimer.execute();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.mvc.load.LoadInters;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
|
||||
/**
|
||||
* 创建interceptor对象
|
||||
*/
|
||||
public class StartInter implements StartMap {
|
||||
|
||||
/**
|
||||
* 创建interceptor对象
|
||||
* @param startParam 参数
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
LoadInters.loadIntersList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
|
||||
/**
|
||||
* 加载JDBC模块
|
||||
*/
|
||||
public class StartJDBC implements StartMap {
|
||||
|
||||
/**
|
||||
* 加载JDBC模块
|
||||
* @param startParam 参数
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
if(startParam.getInitJdbc() != null){
|
||||
startParam.getInitJdbc().init();
|
||||
}
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.core.after.StartAfter;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
|
||||
public class StartLoadAfter implements StartMap {
|
||||
|
||||
/**
|
||||
* 启动after方法
|
||||
* @param startParam 参数
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
StartAfter.after();
|
||||
}
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.core.load.LoadClass;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
|
||||
/**
|
||||
* 扫描包下面的类
|
||||
*/
|
||||
public class StartLoadClass implements StartMap {
|
||||
|
||||
/**
|
||||
* 扫描包
|
||||
* @param startParam 参数
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
/*获取要扫描的包*/
|
||||
String className = getClassName(startParam);
|
||||
|
||||
/* 获取此包下面的所有类(包括jar中的) */
|
||||
LoadClass.scanClass(className);
|
||||
}
|
||||
|
||||
/**
|
||||
* 截取main方法所在包名
|
||||
* @param startParam 类
|
||||
* @return 返回值
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
private String getClassName(StartParam startParam) throws Exception {
|
||||
String className = startParam.getClazz().getName();
|
||||
if(className.lastIndexOf(".") > 0){
|
||||
className = className.substring(0,className.lastIndexOf("."));
|
||||
}
|
||||
|
||||
if(className.indexOf(".") < 0){
|
||||
throw new Exception("启动服务的main方法所在的类,必须放在两层包名中,比如[com.mars,com.test]等,不允许放在[com,cn]等包中,更不允许放在包外面");
|
||||
}
|
||||
return className;
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.mvc.load.LoadMarsApi;
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
|
||||
/**
|
||||
* 创建controller对象
|
||||
*/
|
||||
public class StartMarsApi implements StartMap {
|
||||
|
||||
/**
|
||||
* 创建controller对象
|
||||
* @param startParam 参数
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
LoadMarsApi.loadMarsApis();
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.mars.start.startmap.impl;
|
||||
|
||||
import com.mars.start.startmap.StartMap;
|
||||
import com.mars.start.startmap.StartParam;
|
||||
import com.mars.timer.load.LoadMarsTimer;
|
||||
|
||||
/**
|
||||
* 加载timer对象
|
||||
*/
|
||||
public class StartMarsTimer implements StartMap {
|
||||
|
||||
/**
|
||||
* 加载timer对象
|
||||
* @param startParam 参数
|
||||
* @throws Exception 异常
|
||||
*/
|
||||
@Override
|
||||
public void load(StartParam startParam) throws Exception {
|
||||
LoadMarsTimer.loadMarsTimers();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>Mars</artifactId>
|
||||
<groupId>com.github.yuyenews</groupId>
|
||||
<version>3.0.13</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>jar</packaging>
|
||||
<artifactId>mars-start-pure</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.github.yuyenews</groupId>
|
||||
<artifactId>mars-start-base</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.mars.junit;
|
||||
|
||||
import com.mars.jdbc.load.InitJdbc;
|
||||
import com.mars.start.base.BaseJunit;
|
||||
|
||||
/**
|
||||
* junit
|
||||
*/
|
||||
public abstract class MarsJunit extends BaseJunit {
|
||||
|
||||
@Override
|
||||
public InitJdbc getInitJdbc() {
|
||||
return new InitJdbc();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.mars.start;
|
||||
|
||||
import com.mars.core.base.config.MarsConfig;
|
||||
import com.mars.core.util.MarsConfiguration;
|
||||
import com.mars.jdbc.load.InitJdbc;
|
||||
import com.mars.start.base.BaseStartMars;
|
||||
import com.mars.start.startmap.StartLoadList;
|
||||
|
||||
/**
|
||||
* 启动Mars框架
|
||||
* @author yuye
|
||||
*
|
||||
*/
|
||||
public class StartMars {
|
||||
/**
|
||||
* 启动Mars框架
|
||||
* @param clazz
|
||||
*/
|
||||
public static void start(Class<?> clazz, MarsConfig marsConfig){
|
||||
BaseStartMars.setStartList(StartLoadList.initStartList());
|
||||
if(marsConfig != null){
|
||||
MarsConfiguration.loadConfig(marsConfig);
|
||||
}
|
||||
BaseStartMars.start(clazz,new InitJdbc());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>Mars</artifactId>
|
||||
<groupId>com.github.yuyenews</groupId>
|
||||
<version>3.0.13</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<packaging>pom</packaging>
|
||||
<artifactId>mars-start</artifactId>
|
||||
|
||||
<modules>
|
||||
<module>mars-start-base</module>
|
||||
<module>mars-start-pure</module>
|
||||
</modules>
|
||||
</project>
|
||||
Reference in New Issue
Block a user