docs: Add translations for pom and property files.

This commit is contained in:
jiangjining 2021-01-07 18:56:56 +08:00
parent d4a7aa68b1
commit 281c53ad63
15 changed files with 109 additions and 91 deletions

12
pom.xml
View File

@ -87,7 +87,7 @@
<testTarget>${java.version}</testTarget>
</configuration>
</plugin>
<!-- 打包源码 -->
<!-- Package source codes -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
@ -121,9 +121,9 @@
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<!-- JavaDoc 编译错误不影响正常构建 -->
<!-- Prevent JavaDoc error from affecting building project. -->
<failOnError>false</failOnError>
<!-- 非严格模式...以后要好好按格式写注释啊... -->
<!-- Non-strict mode -->
<additionalJOption>-Xdoclint:none</additionalJOption>
</configuration>
<executions>
@ -164,7 +164,7 @@
</distributionManagement>
</profile>
<!-- 本地使用 -->
<!-- Local profile -->
<profile>
<id>dev</id>
<activation>
@ -173,7 +173,7 @@
<build>
<plugins>
<!-- 编译插件 -->
<!-- Maven compiler plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
@ -185,7 +185,7 @@
<testTarget>${java.version}</testTarget>
</configuration>
</plugin>
<!-- 编辑 MANIFEST.MF -->
<!-- Edit MANIFEST.MF -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>

View File

@ -37,7 +37,7 @@
<version>${powerjob.common.version}</version>
</dependency>
<!-- Junit 测试 -->
<!-- Junit tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>

View File

@ -76,7 +76,7 @@
<version>${commons.io.version}</version>
</dependency>
<!-- Junit 测试 -->
<!-- Junit tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>

View File

@ -6,7 +6,7 @@ import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 已部署的容器信息
* The class for deployed container.
*
* @author tjq
* @since 2020/5/18
@ -16,12 +16,20 @@ import lombok.NoArgsConstructor;
@AllArgsConstructor
public class DeployedContainerInfo implements OmsSerializable {
// 容器ID
/**
* Id of the container.
*/
private Long containerId;
// 版本
/**
* Version of the container.
*/
private String version;
// 部署时间
/**
* Deploy timestamp.
*/
private long deployedTime;
// 机器地址无需上报
/**
* Address of the server. Report is not required.
*/
private String workerAddress;
}

View File

@ -3,19 +3,27 @@ package com.github.kfcfans.powerjob.common.model;
import lombok.Data;
/**
* Git代码库信息
* The class for Git Repository.
*
* @author tjq
* @since 2020/5/17
*/
@Data
public class GitRepoInfo {
// 仓库地址
/**
* Address of Git repository.
*/
private String repo;
// 分支名称
/**
* Name of the branch.
*/
private String branch;
// 用户名
/**
* username of Git.
*/
private String username;
// 密码
/**
* Password of Git.
*/
private String password;
}

View File

@ -17,7 +17,7 @@
<swagger.version>2.9.2</swagger.version>
<springboot.version>2.3.4.RELEASE</springboot.version>
<powerjob.common.version>3.4.2</powerjob.common.version>
<!-- 数据库驱动版本使用的是spring-boot-dependencies管理的版本 -->
<!-- MySQL version that corresponds to spring-boot-dependencies version. -->
<mysql.version>8.0.19</mysql.version>
<ojdbc.version>19.7.0.0</ojdbc.version>
<mssql-jdbc.version>7.4.1.jre8</mssql-jdbc.version>
@ -32,7 +32,7 @@
<fastjson.version>1.2.68</fastjson.version>
<dingding.version>1.0.1</dingding.version>
<!-- 部署时跳过该module -->
<!-- Skip this module when deploying. -->
<maven.deploy.skip>true</maven.deploy.skip>
</properties>
@ -136,42 +136,42 @@
<scope>test</scope>
</dependency>
<!-- zip4jZip操作 -->
<!-- zip4j(Zip support) -->
<dependency>
<groupId>net.lingala.zip4j</groupId>
<artifactId>zip4j</artifactId>
<version>${zip4j.version}</version>
</dependency>
<!-- jGitGit操作 -->
<!-- jGit(Git support) -->
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>${jgit.version}</version>
</dependency>
<!-- 时间工具类NTP时间同步 -->
<!-- Time tools(NTP support) -->
<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>${commons.net.version}</version>
</dependency>
<!-- Maven Invoker(编译 maven 项目) -->
<!-- Maven Invoker(used for maven compilation) -->
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-invoker</artifactId>
<version>${mvn.invoker.version}</version>
</dependency>
<!-- fastJson(为了序列化 DAG 引用引入) -->
<!-- fastJson(used for serialization of DAG) -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
<!-- 钉钉 报警通知 -->
<!-- DingTalk SDK. -->
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>alibaba-dingtalk-service-sdk</artifactId>
@ -185,7 +185,6 @@
</dependency>
<!-- swagger2 -->
<dependency>
<groupId>io.springfox</groupId>
@ -201,7 +200,7 @@
</dependencies>
<!-- SpringBoot专用的打包插件 -->
<!-- SpringBoot maven plugin -->
<build>
<plugins>
<plugin>
@ -215,7 +214,7 @@
<execution>
<goals>
<goal>build-info</goal>
<goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
<goal>repackage</goal>
</goals>
</execution>
</executions>

View File

@ -7,7 +7,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* SpringBoot 启动入口
* SpringBoot entry.
*
* @author tjq
* @since 2020/3/29
@ -26,16 +26,16 @@ public class OhMyApplication {
public static void main(String[] args) {
// 完成前置工作
// Print tips before starting.
pre();
// 先启动 ActorSystem
// Init ActorSystem
OhMyServer.init();
// 再启动SpringBoot
// Start SpringBoot application.
try {
SpringApplication.run(OhMyApplication.class, args);
}catch (Throwable t) {
} catch (Throwable t) {
log.error(TIPS);
throw t;
}

View File

@ -1,7 +1,7 @@
oms.env=DAILY
logging.config=classpath:logback-dev.xml
####### 外部数据库配置(需要用户更改为自己的数据库配置) #######
####### Database properties(Configure according to the the environment) #######
spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.core.username=root
@ -9,11 +9,12 @@ spring.datasource.core.password=No1Bug2Please3!
spring.datasource.core.hikari.maximum-pool-size=20
spring.datasource.core.hikari.minimum-idle=5
####### mongoDB配置非核心依赖通过配置 oms.mongodb.enable=false 来关闭 #######
####### MongoDB properties(Non-core configuration properties) #######
####### configure oms.mongodb.enable=false to disable mongodb #######
oms.mongodb.enable=true
spring.data.mongodb.uri=mongodb+srv://zqq:No1Bug2Please3!@cluster0.wie54.gcp.mongodb.net/powerjob_daily?retryWrites=true&w=majority
####### 邮件配置(不需要邮件报警可以删除以下配置来避免报错) #######
####### Email properties(Comment out the mail properties if you do not have needs) #######
spring.mail.host=smtp.163.com
spring.mail.username=zqq@163.com
spring.mail.password=GOFZPNARMVKCGONV
@ -21,18 +22,19 @@ spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
####### 钉钉报警配置(不需要钉钉报警可以删除以下配置来避免报错) #######
####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) #######
oms.alarm.ding.app-key=dingauqwkvxxnqskknfv
oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl
oms.alarm.ding.agent-id=847044348
####### 资源清理配置 #######
####### Resource cleaning properties #######
oms.instanceinfo.retention=1
oms.container.retention.local=1
oms.container.retention.remote=-1
####### 缓存配置 #######
####### Cache properties #######
oms.instance.metadata.cache.size=1024
####### 精确获取 server 的百分比0100100代表每次 worker 获取 server 都会进行完整的探活流程,不存在脑裂问题,但有性能开销 #######
####### Threshold in fetching server(0~100). 100 means full detection of server, in which #######
####### split-brain could be avoided while performance overhead would increase. #######
oms.accurate.select.server.percentage = 50

View File

@ -1,7 +1,7 @@
oms.env=PRE
logging.config=classpath:logback-product.xml
####### 数据库配置 #######
####### Database properties(Configure according to the the environment) #######
spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.core.jdbc-url=jdbc:mysql://remotehost:3306/powerjob-pre?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.core.username=root
@ -9,11 +9,12 @@ spring.datasource.core.password=No1Bug2Please3!
spring.datasource.core.hikari.maximum-pool-size=20
spring.datasource.core.hikari.minimum-idle=5
####### mongoDB配置非核心依赖通过配置 oms.mongodb.enable=false 来关闭 #######
####### MongoDB properties(Non-core configuration properties) #######
####### configure oms.mongodb.enable=false to disable mongodb #######
oms.mongodb.enable=true
spring.data.mongodb.uri=mongodb://remotehost:27017/powerjob-pre
####### 邮件配置(不需要邮件报警可以删除以下配置来避免报错) #######
####### Email properties(Comment out the mail properties if you do not have needs) #######
spring.mail.host=smtp.qq.com
spring.mail.username=zqq
spring.mail.password=qqz
@ -21,18 +22,19 @@ spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
####### 钉钉报警配置(不需要钉钉报警可以删除以下配置来避免报错) #######
####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) #######
oms.alarm.ding.app-key=dingauqwkvxxnqskknfv
oms.alarm.ding.app-secret=XWrEPdAZMPgJeFtHuL0LH73LRj-74umF2_0BFcoXMfvnX0pCQvt0rpb1JOJU_HLl
oms.alarm.ding.agent-id=847044348
####### 资源清理配置 #######
####### Resource cleaning properties #######
oms.instanceinfo.retention=3
oms.container.retention.local=3
oms.container.retention.remote=-1
####### 缓存配置 #######
####### Cache properties #######
oms.instance.metadata.cache.size=1024
####### 精确获取 server 的百分比0100100代表每次 worker 获取 server 都会进行完整的探活流程,不存在脑裂问题,但有性能开销 #######
####### Threshold in fetching server(0~100). 100 means full detection of server, in which #######
####### split-brain could be avoided while performance overhead would increase. #######
oms.accurate.select.server.percentage = 50

View File

@ -1,7 +1,7 @@
oms.env=PRODUCT
logging.config=classpath:logback-product.xml
####### 数据库配置 #######
####### Database properties(Configure according to the the environment) #######
spring.datasource.core.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.core.jdbc-url=jdbc:mysql://localhost:3306/powerjob-product?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
spring.datasource.core.username=root
@ -9,11 +9,12 @@ spring.datasource.core.password=No1Bug2Please3!
spring.datasource.core.hikari.maximum-pool-size=20
spring.datasource.core.hikari.minimum-idle=5
####### mongoDB配置非核心依赖通过配置 oms.mongodb.enable=false 来关闭 #######
####### MongoDB properties(Non-core configuration properties) #######
####### configure oms.mongodb.enable=false to disable mongodb #######
oms.mongodb.enable=true
spring.data.mongodb.uri=mongodb://localhost:27017/powerjob-product
####### 邮件配置(不需要邮件报警可以删除以下配置来避免报错) #######
####### Email properties(Comment out the mail properties if you do not have needs) #######
spring.mail.host=smtp.qq.com
spring.mail.username=zqq
spring.mail.password=qqz
@ -21,18 +22,19 @@ spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
####### 钉钉报警配置(不需要钉钉报警可以删除以下配置来避免报错) #######
####### DingTalk properties(Comment out the DingTalk properties if you do not have needs) #######
oms.alarm.ding.app-key=
oms.alarm.ding.app-secret=
oms.alarm.ding.agent-id=
####### 资源清理配置 #######
####### Resource cleaning properties #######
oms.instanceinfo.retention=7
oms.container.retention.local=7
oms.container.retention.remote=-1
####### 缓存配置 #######
####### Cache properties #######
oms.instance.metadata.cache.size=2048
####### 精确获取 server 的百分比0100100代表每次 worker 获取 server 都会进行完整的探活流程,不存在脑裂问题,但有性能开销 #######
####### Threshold in fetching server(0~100). 100 means full detection of server, in which #######
####### split-brain could be avoided while performance overhead would increase. #######
oms.accurate.select.server.percentage = 50

View File

@ -1,4 +1,4 @@
# http 服务端口
# Http server port
server.port=7700
spring.profiles.active=daily
@ -7,14 +7,14 @@ spring.jpa.open-in-view=false
spring.data.mongodb.repositories.type=none
logging.level.org.mongodb=warn
# 文件上传配置
# Configuration for uploading files.
spring.servlet.multipart.enabled=true
spring.servlet.multipart.file-size-threshold=0
spring.servlet.multipart.max-file-size=209715200
spring.servlet.multipart.max-request-size=209715200
###### PowerJob 自身配置(该配置只允许存在于 application.properties 文件中) ######
# akka ActorSystem 服务端口
###### PowerJob self-owned configuration (The following properties should exist in application.properties only). ######
# Akka ActorSystem port.
oms.akka.port=10086
# 表前缀(默认无表前缀,有需求直接填入表前缀即可,比如 pj_
# Prefix for all tables. Default empty string. Config if you have needs, i.e. pj_
oms.table-prefix=

View File

@ -1,18 +1,18 @@
<?xml version="1.0"?>
<!-- 本地调试专用,所有日志都从 console 输出-->
<!-- Configuration for local environment, all logs would print in console. -->
<configuration>
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<!-- Configure color for logs. -->
<!-- Classes for rendering color. -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>
<conversionRule conversionWord="wex"
converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter"/>
<conversionRule conversionWord="wEx"
converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter"/>
<!-- 彩色日志格式 -->
<!-- Color log pattern. -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{20}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!-- Console 输出设置 -->
<!-- Configuration for console output. -->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
@ -20,13 +20,13 @@
</encoder>
</appender>
<!-- 定时调度信息控制台就不输出了,看着就乱 -->
<!-- Quit timing logs, which seems disordered. -->
<logger name="com.github.kfcfans.powerjob.server.service.timing" level="WARN" additivity="false">
<appender-ref ref="CONSOLE" />
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="com.github.kfcfans.powerjob" level="DEBUG" additivity="false">
<appender-ref ref="CONSOLE" />
<appender-ref ref="CONSOLE"/>
</logger>
<root level="INFO">

View File

@ -1,20 +1,20 @@
<?xml version="1.0"?>
<!-- 生产环境日志 -->
<!-- Configuration for production environment. -->
<configuration>
<!--默认配置-->
<!-- Default configuration. -->
<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<!--配置控制台(Console)-->
<!-- Configuration for console. -->
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
<!--
日志路径,注意权限问题,否则无法打印日志。
大坑记录:`~/logs`不会在用户目录下创建文件夹,而是在项目目录下创建名为~的文件夹
Log path, pay attention to permission, logs may be unable to generate.
Bug recording: Setting `~/logs`, is unable to create folder in user home directory,
a folder with the name ~ is created in project folder.
-->
<property name="LOG_PATH" value="${user.home}/powerjob-server/logs"/>
<!-- 系统所有异常日志ERROR双写 start -->
<!-- Configuration for ERROR logs. All error logs will write twice. -->
<appender name="ERROR_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH}/powerjob-server-error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
@ -31,9 +31,9 @@
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 系统所有异常日志ERROR双写 end -->
<!-- End of configuration for ERROR logs. -->
<!-- web 访问日志 start -->
<!-- Configuration for Web services. -->
<appender name="WEB_LOG_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH}/powerjob-server-web.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
@ -49,9 +49,9 @@
<logger name="WEB_LOG" level="INFO" additivity="false">
<appender-ref ref="WEB_LOG_APPENDER"/>
</logger>
<!-- web 访问日志 日志 end -->
<!-- End of configuration for Web services. -->
<!-- 系统主日志 start -->
<!-- Configuration for system logs. -->
<appender name="DEFAULT_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH}/powerjob-server-application.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
@ -64,7 +64,7 @@
</encoder>
<append>true</append>
</appender>
<!-- 系统主日志 日志 end -->
<!-- End of configuration for system logs. -->
<root level="INFO">
<appender-ref ref="CONSOLE"/>

View File

@ -50,7 +50,6 @@
</dependencies>
<!-- 谁说SpringBoot的打包插件只能给SpringBoot用的省的我写一堆配置还有BUG... -->
<build>
<plugins>
<plugin>
@ -63,7 +62,7 @@
<executions>
<execution>
<goals>
<goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中-->
<goal>repackage</goal>
</goals>
</execution>
</executions>

View File

@ -1,15 +1,13 @@
server.port=8081
spring.jpa.open-in-view=false
########### powerjob-worker 配置(老配置 powerjob.xxx 即将废弃,请使用 powerjob.worker.xxx ###########
# akka 工作端口,可选,默认 27777
########### PowerJob-worker properties. ###########
# Akka port, default is 27777
powerjob.worker.akka-port=27777
# 接入应用名称,用于分组隔离,推荐填写 本 Java 项目名称
# Application name, used for grouping applications. Recommend to set the same value as project name.
powerjob.worker.app-name=powerjob-agent-test
# 调度服务器地址IP:Port 或 域名,多值逗号分隔
# Address of PowerJob-server node(s). Ip:port or domain. Multiple addresses should be separated with comma.
powerjob.worker.server-address=127.0.0.1:7700,127.0.0.1:7701
# 持久化方式,可选,默认 disk
# Store strategy of H2 database. disk or memory. Default value is disk.
powerjob.worker.store-strategy=disk
# 返回值最大长度,默认 8096
# Max length of result. Results that are longer than the value will be truncated.
powerjob.worker.max-result-length=4096