mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 08:20:31 +08:00
feat: add service config templates and extraction script
Former-commit-id: 1de24b7eb79676d1aba9d799a58c5a753290cf52
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
# 来源:星河湾星中星/星中心/cw-elevator-application-V1.0.0.20211103/application-access-control.properties(生产门禁 access-control 参数)
|
||||
# profile=access-control 时与本目录 application.properties 合并加载;勿随意删减与分表相关项。
|
||||
# \u56FE\u7247\u524D\u7F00
|
||||
cloudwalk.elevator.common.relativePrefix=/cwos-portal/portal/fileManager/imgByPath?path=
|
||||
# \u6570\u636E\u5E93sharding\u914D\u7F6E
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
# 与 V1 运行包 cw-elevator-application-V1.0.0.20211103/bootstrap.properties 中 Consul 段对齐。
|
||||
# Dubbo/ZooKeeper:V1 fat-jar 内含 dubbo 注册地址,本 Maven V2 工程未使用 Dubbo,故不写 zookeeper 段。
|
||||
# Consul 宿主机按本环境(局域网 Docker)覆盖。
|
||||
spring.cloud.consul.host=192.168.3.12
|
||||
server.port=16112
|
||||
server.tomcat.uri-encoding=UTF-8
|
||||
spring.application.name=elevator-app
|
||||
spring.profiles.active=access-control
|
||||
# consul\u914D\u7F6E
|
||||
spring.cloud.consul.host=371bfca4972c43d2aefcf302d0a4a277
|
||||
spring.cloud.consul.port=8500
|
||||
spring.cloud.consul.enabled=true
|
||||
spring.cloud.consul.discovery.register=true
|
||||
@@ -10,5 +12,7 @@ spring.cloud.consul.discovery.prefer-ip-address=true
|
||||
spring.cloud.consul.discovery.instance-id=${spring.application.name}-${spring.cloud.client.ipAddress}:${server.port}
|
||||
spring.cloud.consul.discovery.ip-address=${spring.cloud.client.ipAddress}
|
||||
spring.cloud.consul.discovery.deregister=false
|
||||
|
||||
spring.profiles.active=access-control
|
||||
# zookeeper\u914D\u7F6E
|
||||
dubbo.registry.address=zookeeper://10.0.22.207:2181
|
||||
dubbo.protocol.port=16107
|
||||
dubbo.provider.version=1.0
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+56
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration debug="false" scan="true">
|
||||
<property name="CONTEXT_NAME" value="api.1.0.0"/>
|
||||
<contextName>${CONTEXT_NAME}</contextName>
|
||||
|
||||
<springProperty scope="context" name="fileName" source="logging.file" defaultValue="default"/>
|
||||
|
||||
<!--myibatis log configure-->
|
||||
<logger name="com.apache.ibatis" level="DEBUG"/>
|
||||
<logger name="java.sql.Connection" level="DEBUG"/>
|
||||
<logger name="java.sql.Statement" level="DEBUG"/>
|
||||
<logger name="java.sql.PreparedStatement" level="DEBUG"/>
|
||||
|
||||
<!-- 控制台输出 -->
|
||||
<appender name="S" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %-5level %logger{50}:%line - %msg%n</pattern>
|
||||
<!-- 设置字符集 -->
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="R" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<File>${LOG_PATH}/${fileName}.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_PATH}/${fileName}.%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<MaxHistory>7</MaxHistory>
|
||||
<!--日志文件大小 -->
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>50MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||
<pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %-5level %logger{50}:%line - %msg%n</pattern>
|
||||
<!-- 设置字符集 -->
|
||||
<charset>UTF-8</charset>
|
||||
</encoder>
|
||||
|
||||
<!--日志文件最大的大小-->
|
||||
<!-- <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> -->
|
||||
<!-- <MaxFileSize>10MB</MaxFileSize> -->
|
||||
<!-- </triggeringPolicy> -->
|
||||
</appender>
|
||||
|
||||
<!-- 日志输出级别 -->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="S"/>
|
||||
<appender-ref ref="R"/>
|
||||
</root>
|
||||
</configuration>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
Manifest-Version: 1.0
|
||||
Implementation-Title: cw-elevator-application-starter
|
||||
Implementation-Version: 2.0-SNAPSHOT
|
||||
Archiver-Version: Plexus Archiver
|
||||
Built-By: zebra
|
||||
Implementation-Vendor-Id: cn.cloudwalk.elevator
|
||||
Spring-Boot-Version: 1.5.17.RELEASE
|
||||
Implementation-Vendor: Pivotal Software, Inc.
|
||||
Main-Class: org.springframework.boot.loader.JarLauncher
|
||||
Start-Class: cn.cloudwalk.elevator.ElevatorApplication
|
||||
Spring-Boot-Classes: BOOT-INF/classes/
|
||||
Spring-Boot-Lib: BOOT-INF/lib/
|
||||
Created-By: Apache Maven 3.9.10
|
||||
Build-Jdk: 1.8.0_482
|
||||
Implementation-URL: http://projects.spring.io/spring-boot/cw-elevator-
|
||||
application-reactor/cw-elevator-application-starter/
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
#Generated by Apache Maven
|
||||
#Wed Apr 29 12:15:25 CST 2026
|
||||
version=2.0-SNAPSHOT
|
||||
groupId=cn.cloudwalk.elevator
|
||||
artifactId=cw-elevator-application-starter
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
<?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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>cn.cloudwalk.elevator</groupId>
|
||||
<artifactId>cw-elevator-application-reactor</artifactId>
|
||||
<version>2.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<artifactId>cw-elevator-application-starter</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>cw-elevator-application-starter</name>
|
||||
<description>可执行 Spring Boot 入口:repackage 为单 JAR 发布包(对齐历史 V1 starter 形态)。</description>
|
||||
|
||||
<properties>
|
||||
<alibaba.eclipse.codestyle.path>${project.basedir}/../../docs/style/alibaba-eclipse-codestyle.xml</alibaba.eclipse.codestyle.path>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-cache</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.cloudwalk</groupId>
|
||||
<artifactId>cloudwalk-device-sdk-protocol-entity</artifactId>
|
||||
<version>2.2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.cloudwalk.elevator</groupId>
|
||||
<artifactId>cw-elevator-application-web</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${elevator.release.finalName}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>net.revelc.code.formatter</groupId>
|
||||
<artifactId>formatter-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -2,14 +2,23 @@
|
||||
# 与当前目录下 application.properties 同路径启动 V2(maven 构建)包。
|
||||
# 默认优先系统 JDK 8;若只有 JDK11+ 会自动附加 --add-opens。
|
||||
# ELEVATOR_USE_ENV_JAVA=1 ./run.sh 使用当前 JAVA_HOME(如 Conda)。
|
||||
# 发布包内脚本与 JAR、properties 均位于发布根目录(与 cw-elevator-application-V1.0.0.20211103 布局一致)。
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
# shellcheck source=../common-java.sh
|
||||
source "$(cd "$(dirname "$0")" && pwd)/../common-java.sh"
|
||||
source "${SCRIPT_DIR}/../common-java.sh"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
JAR="cw-elevator-application-2.0.0.jar"
|
||||
if [[ ! -f "$JAR" ]]; then
|
||||
echo "缺少 $JAR,请在 deploy 目录执行: ./sync-jars.sh" >&2
|
||||
JAR=""
|
||||
for candidate in $(ls -1t cw-elevator-application-*.jar 2>/dev/null || true); do
|
||||
if [[ "${candidate}" == *.jar.original ]]; then
|
||||
continue
|
||||
fi
|
||||
JAR="${candidate}"
|
||||
break
|
||||
done
|
||||
if [[ -z "${JAR}" || ! -f "${JAR}" ]]; then
|
||||
echo "缺少 cw-elevator-application-*.jar,请在 deploy 目录执行: ./sync-jars.sh" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -24,16 +33,6 @@ while IFS= read -r line; do
|
||||
[[ -n "$line" ]] && OPEN_FLAGS+=("$line")
|
||||
done < <(_jdk8_open_flags "$JAVA")
|
||||
|
||||
# 同 v1:由 redis-override.properties 合并出 SPRING_APPLICATION_JSON。
|
||||
if ! command -v python3 >/dev/null 2>&1; then
|
||||
echo "需要 python3(deploy/merge-redis-json.sh)。请安装 python3。" >&2
|
||||
exit 1
|
||||
fi
|
||||
MERGE="$(cd "$(dirname "$0")" && pwd)/../merge-redis-json.sh"
|
||||
if [[ ! -x "$MERGE" ]]; then
|
||||
chmod +x "$MERGE" 2>/dev/null || true
|
||||
fi
|
||||
export SPRING_APPLICATION_JSON="$("$MERGE" "$PWD/redis-override.properties")"
|
||||
# 强制走 Consul:不再注入本地 application*.properties / redis-override.properties。
|
||||
# shellcheck disable=SC2086
|
||||
exec "$JAVA" "${OPEN_FLAGS[@]}" ${ELEVATOR_JAVA_OPTS:-} -jar "$JAR" \
|
||||
--spring.config.location=file:./application.properties,file:./application-access-control.properties,file:./redis-override.properties
|
||||
exec "$JAVA" "${OPEN_FLAGS[@]}" ${ELEVATOR_JAVA_OPTS:-} -jar "$JAR"
|
||||
|
||||
Reference in New Issue
Block a user