nacos server本地化采用jar方式启动,简化开发

This commit is contained in:
zhangdaiscott
2021-03-08 20:29:36 +08:00
parent b9185a211a
commit 22bc2a219c
4 changed files with 132 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package com.alibaba.nacos;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* Nacos 启动类
* 引用的nacos console 源码运行,简化开发
* 生产建议从官网下载最新版配置运行
* @author zyf
*/
@SpringBootApplication(scanBasePackages = "com.alibaba.nacos")
@ServletComponentScan
@EnableScheduling
public class JeecgNacosApplication {
/**
* 是否单机模式启动
*/
private static String standalone = "true";
/**
* 是否开启鉴权
*/
private static String enabled = "false";
public static void main(String[] args) {
System.setProperty("nacos.standalone", standalone);
System.setProperty("nacos.core.auth.enabled", enabled);
SpringApplication.run(JeecgNacosApplication.class, args);
}
}