@@ -1,25 +0,0 @@
|
|||||||
碰到问题,请在 <https://gitee.com/zhijiantianya/yudao-cloud/issues> 搜索是否存在相似的 issue。
|
|
||||||
|
|
||||||
不按照模板提交的 issue,会被系统自动删除。
|
|
||||||
|
|
||||||
### 基本信息
|
|
||||||
|
|
||||||
- ruoyi-vue-pro 版本:
|
|
||||||
- 操作系统:
|
|
||||||
- 数据库:
|
|
||||||
|
|
||||||
### 你猜测可能的原因
|
|
||||||
|
|
||||||
(必填)我花费了 2-4 小时自查,发现可能的原因是:xxxxxx
|
|
||||||
|
|
||||||
### 复现步骤
|
|
||||||
|
|
||||||
第一步,
|
|
||||||
|
|
||||||
第二步,
|
|
||||||
|
|
||||||
第三步,
|
|
||||||
|
|
||||||
### 报错信息
|
|
||||||
|
|
||||||
带上必要的截图
|
|
||||||
34
.github/ISSUE_TEMPLATE/question.md
vendored
34
.github/ISSUE_TEMPLATE/question.md
vendored
@@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
name: 问题反馈
|
|
||||||
about: 请详细描述,以便更高快的获得到解决
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
碰到问题,请在 <https://github.com/YunaiV/yudao-cloud/issues> 搜索是否存在相似的 issue。
|
|
||||||
|
|
||||||
不按照模板提交的 issue,会被系统自动删除。
|
|
||||||
|
|
||||||
### 基本信息
|
|
||||||
|
|
||||||
- ruoyi-vue-pro 版本:
|
|
||||||
- 操作系统:
|
|
||||||
- 数据库:
|
|
||||||
|
|
||||||
### 你猜测可能的原因
|
|
||||||
|
|
||||||
(必填)我花费了 2-4 小时自查,发现可能的原因是:xxxxxx
|
|
||||||
|
|
||||||
### 复现步骤
|
|
||||||
|
|
||||||
第一步,
|
|
||||||
|
|
||||||
第二步,
|
|
||||||
|
|
||||||
第三步,
|
|
||||||
|
|
||||||
### 报错信息
|
|
||||||
|
|
||||||
带上必要的截图
|
|
||||||
30
.github/workflows/maven.yml
vendored
30
.github/workflows/maven.yml
vendored
@@ -1,30 +0,0 @@
|
|||||||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
|
||||||
|
|
||||||
name: Java CI with Maven
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
# pull_request:
|
|
||||||
# branches: [ master ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
java: [ '8', '11', '17' ]
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Set up JDK ${{ matrix.Java }}
|
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
|
||||||
java-version: ${{ matrix.java }}
|
|
||||||
distribution: 'temurin'
|
|
||||||
cache: maven
|
|
||||||
- name: Build with Maven
|
|
||||||
run: mvn -B package --file pom.xml -Dmaven.test.skip=true
|
|
||||||
@@ -158,6 +158,28 @@ public class ModuleGenerator {
|
|||||||
return processErrorCodeConstants(content, moduleName, packageName, author);
|
return processErrorCodeConstants(content, moduleName, packageName, author);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理配置文件
|
||||||
|
if (fileName.endsWith(".yml") || fileName.endsWith(".yaml")) {
|
||||||
|
String newContent = content;
|
||||||
|
|
||||||
|
// 替换应用名称
|
||||||
|
newContent = newContent.replace("name: yudao-module-template-server", "name: yudao-module-" + moduleName + "-server");
|
||||||
|
|
||||||
|
// 处理端口配置
|
||||||
|
if (newContent.contains("port:")) {
|
||||||
|
// 使用更精确的正则表达式来匹配端口行
|
||||||
|
newContent = newContent.replaceAll("(?m)^(\\s*)port:\\s*\\d+\\s*$", "$1port: " + port);
|
||||||
|
} else if (newContent.contains("server:")) {
|
||||||
|
// 如果有server配置但没有port,在server下添加port
|
||||||
|
newContent = newContent.replaceAll("(?m)^(\\s*)server:\\s*$", "$1server:\n$1 port: " + port);
|
||||||
|
} else {
|
||||||
|
// 如果完全没有server配置,在文件开头添加
|
||||||
|
newContent = "server:\n port: " + port + "\n\n" + newContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return newContent;
|
||||||
|
}
|
||||||
|
|
||||||
return content.replace("yudao-module-template", "yudao-module-" + moduleName)
|
return content.replace("yudao-module-template", "yudao-module-" + moduleName)
|
||||||
.replace("cn.iocoder.yudao.module.template", BASE_PACKAGE + packageName)
|
.replace("cn.iocoder.yudao.module.template", BASE_PACKAGE + packageName)
|
||||||
.replace("TemplateServerApplication", capitalizedModuleName + "ServerApplication")
|
.replace("TemplateServerApplication", capitalizedModuleName + "ServerApplication")
|
||||||
|
|||||||
@@ -35,10 +35,7 @@ public class ServerGenerator {
|
|||||||
int startPort = Integer.parseInt(scanner.nextLine());
|
int startPort = Integer.parseInt(scanner.nextLine());
|
||||||
scanner.close();
|
scanner.close();
|
||||||
|
|
||||||
// 分割服务器名
|
// 分割服务名
|
||||||
String[] servers = baseNames.split(",");
|
|
||||||
|
|
||||||
// 分割服务器名
|
|
||||||
String[] servers = baseNames.split(",");
|
String[] servers = baseNames.split(",");
|
||||||
|
|
||||||
// 2. 定义项目根路径
|
// 2. 定义项目根路径
|
||||||
@@ -149,17 +146,22 @@ public class ServerGenerator {
|
|||||||
// 移除对 yudao-module-xxx-server 的依赖,但保留 system-server 和 infra-server
|
// 移除对 yudao-module-xxx-server 的依赖,但保留 system-server 和 infra-server
|
||||||
return newContent.replaceAll("(?m)^\\s*<dependency>\\s*<groupId>cn\\.iocoder\\.cloud</groupId>\\s*<artifactId>yudao-module-(?!system-server|infra-server).*-server</artifactId>[\\s\\S]*?</dependency>\\s*", "");
|
return newContent.replaceAll("(?m)^\\s*<dependency>\\s*<groupId>cn\\.iocoder\\.cloud</groupId>\\s*<artifactId>yudao-module-(?!system-server|infra-server).*-server</artifactId>[\\s\\S]*?</dependency>\\s*", "");
|
||||||
case "application.yaml":
|
case "application.yaml":
|
||||||
case "application.yml":
|
case "application-dev.yaml":
|
||||||
// 替换应用名称和端口号
|
case "application-prod.yaml":
|
||||||
|
case "application-test.yaml":
|
||||||
|
case "application-local.yaml":
|
||||||
|
// 替换应用名称
|
||||||
newContent = newContent.replace("name: yudao-server", "name: " + serverName);
|
newContent = newContent.replace("name: yudao-server", "name: " + serverName);
|
||||||
// 如果有端口配置,替换端口号,如果没有则添加端口配置
|
|
||||||
if (newContent.contains("server:")) {
|
// 处理端口配置 - 更精确的替换逻辑
|
||||||
if (newContent.contains("port:")) {
|
if (newContent.contains("port:")) {
|
||||||
newContent = newContent.replaceAll("(?m)^\\s*port:.*$", " port: " + port);
|
// 使用更精确的正则表达式来匹配端口行
|
||||||
} else {
|
newContent = newContent.replaceAll("(?m)^(\\s*)port:\\s*\\d+\\s*$", "$1port: " + port);
|
||||||
newContent = newContent.replace("server:", "server:\n port: " + port);
|
} else if (newContent.contains("server:")) {
|
||||||
}
|
// 如果有server配置但没有port,在server下添加port
|
||||||
|
newContent = newContent.replaceAll("(?m)^(\\s*)server:\\s*$", "$1server:\n$1 port: " + port);
|
||||||
} else {
|
} else {
|
||||||
|
// 如果完全没有server配置,在文件开头添加
|
||||||
newContent = "server:\n port: " + port + "\n\n" + newContent;
|
newContent = "server:\n port: " + port + "\n\n" + newContent;
|
||||||
}
|
}
|
||||||
return newContent;
|
return newContent;
|
||||||
|
|||||||
Reference in New Issue
Block a user