From e10a4c2c30039d5aa39ef44d5036d8a89da3a254 Mon Sep 17 00:00:00 2001 From: zhangdaiscott <zhangdaiscott@163.com> Date: Mon, 30 Nov 2020 22:18:01 +0800 Subject: [PATCH] JeecgBoot 2.4 微服务正式版本发布,基于SpringBoot的低代码平台 --- jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml | 2 +- jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml b/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml index 0c91811..43be798 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml @@ -131,7 +131,7 @@ spring: connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 datasource: master: - url: jdbc:mysql://127.0.0.1:3306/jeecg-boot-os-re?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai + url: jdbc:mysql://127.0.0.1:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai username: root password: root driver-class-name: com.mysql.cj.jdbc.Driver diff --git a/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java b/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java new file mode 100644 index 0000000..c6250dd --- /dev/null +++ b/jeecg-boot/jeecg-cloud-module/jeecg-cloud-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java @@ -0,0 +1,57 @@ +package org.jeecg; + +import lombok.extern.slf4j.Slf4j; +import org.apache.catalina.Context; +import org.apache.tomcat.util.scan.StandardJarScanner; +import org.jeecg.common.util.oConvertUtils; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.ConfigurableApplicationContext; +import org.springframework.context.annotation.Bean; +import org.springframework.core.env.Environment; + +import java.net.InetAddress; +import java.net.UnknownHostException; + +@Slf4j +@SpringBootApplication +@EnableFeignClients(basePackages = {"org.jeecg"}) +public class JeecgSystemApplication extends SpringBootServletInitializer { + + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { + return application.sources(JeecgSystemApplication.class); + } + + public static void main(String[] args) throws UnknownHostException { + ConfigurableApplicationContext application = SpringApplication.run(JeecgSystemApplication.class, args); + Environment env = application.getEnvironment(); + String ip = InetAddress.getLocalHost().getHostAddress(); + String port = env.getProperty("server.port"); + String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path")); + log.info("\n----------------------------------------------------------\n\t" + + "Application Jeecg-Boot is running! Access URLs:\n\t" + + "Local: \t\thttp://localhost:" + port + path + "/doc.html\n" + + "External: \thttp://" + ip + ":" + port + path + "/doc.html\n" + + "Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" + + "----------------------------------------------------------"); + + } + + /** + * tomcat-embed-jasper引用后提示jar找不到的问题 + */ + @Bean + public TomcatServletWebServerFactory tomcatFactory() { + return new TomcatServletWebServerFactory() { + @Override + protected void postProcessContext(Context context) { + ((StandardJarScanner) context.getJarScanner()).setScanManifest(false); + } + }; + } +} \ No newline at end of file -- libgit2 0.22.2