init commit
This commit is contained in:
parent
3a2b93c749
commit
10a7ccdd0f
|
@ -0,0 +1,8 @@
|
|||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
|
@ -0,0 +1,9 @@
|
|||
<component name="libraryTable">
|
||||
<library name="gradle-wrapper">
|
||||
<CLASSES>
|
||||
<root url="jar://$PROJECT_DIR$/gradle/wrapper/gradle-wrapper.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES />
|
||||
</library>
|
||||
</component>
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 (3)" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/scict2.iml" filepath="$PROJECT_DIR$/.idea/scict2.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/shkd-cosmic-debug/shkd-cosmic-debug.iml" filepath="$PROJECT_DIR$/shkd-cosmic-debug/shkd-cosmic-debug.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/sys/sys.iml" filepath="$PROJECT_DIR$/sys/sys.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
* If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
* Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
* Author: liebin.zheng
|
||||
* Generate Date: 2024-10-25 13:35:51
|
||||
*/
|
||||
|
||||
apply from: '../../config.gradle'
|
||||
|
||||
def bos = ext.path.bos
|
||||
def trd = ext.path.trd
|
||||
def cus = ext.path.cus
|
||||
def biz = ext.path.biz
|
||||
|
||||
dependencies {
|
||||
api fileTree(dir: bos, include: '*.jar')
|
||||
|
||||
api fileTree(trd) { include '*.jar' exclude 'qing-arthas-*.jar' }
|
||||
//如果出现本地启动出现log4j相关依赖包版本冲突的问题,则可以参考以下方式手工解决
|
||||
//api fileTree(trd) {
|
||||
// include '*.jar'
|
||||
// exclude 'log4j-api-*.jar','logback-*.jar','slf4j-*.jar','qing-arthas-*.jar'
|
||||
//}
|
||||
//api 'cn.hutool:hutool-all:5.8.20'
|
||||
//api 'ch.qos.logback:logback-classic:1.2.12'
|
||||
//api 'org.slf4j:log4j-over-slf4j:1.7.36'
|
||||
//api 'org.apache.logging.log4j:log4j-to-slf4j:2.20.0'
|
||||
|
||||
runtimeOnly fileTree(dir: biz, include: '*.jar')
|
||||
runtimeOnly fileTree(dir: cus, include: '*.jar')
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
/*
|
||||
* This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
* If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
* Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
* Author: liebin.zheng
|
||||
* Generate Date: 2024-10-25 13:35:51
|
||||
*/
|
||||
|
||||
dependencies {
|
||||
api project(':shkd-base-common')
|
||||
}
|
||||
|
|
@ -0,0 +1,151 @@
|
|||
/**
|
||||
* This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
* If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
* Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
* Author: liebin.zheng
|
||||
* Generate Date: 2024-10-25 13:35:51
|
||||
*/
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
//https://docs.gradle.org/current/userguide/java_library_plugin.html#java_library_plugin
|
||||
id 'java-library'
|
||||
//id 'maven-publish'
|
||||
//https://docs.gradle.org/current/userguide/idea_plugin.html
|
||||
//id 'idea'
|
||||
//https://docs.gradle.org/current/userguide/eclipse_plugin.html
|
||||
//id 'eclipse'
|
||||
//id "org.sonarqube" version "3.5.0.2730"
|
||||
}
|
||||
|
||||
apply from: 'config.gradle'
|
||||
|
||||
def bos = ext.path.bos
|
||||
def trd = ext.path.trd
|
||||
def cus = ext.path.cus
|
||||
def biz = ext.path.biz
|
||||
def outputdir = ext.path.outputdir
|
||||
|
||||
//所有工程共用的配置
|
||||
allprojects {
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'java-library'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
|
||||
repositories{
|
||||
mavenLocal()
|
||||
maven{ url'https://maven.aliyun.com/repository/public/'}
|
||||
maven{ url'https://maven.aliyun.com/repository/gradle-plugin'}
|
||||
mavenCentral()
|
||||
//maven { url 'https://repo.gradle.org/gradle/libs-releases' }
|
||||
//gradlePluginPortal()
|
||||
}
|
||||
|
||||
group = System.getProperty('groupId')
|
||||
version = System.getProperty('version')
|
||||
|
||||
def jdk_version = System.getProperty('jdk.version')
|
||||
sourceCompatibility = jdk_version
|
||||
targetCompatibility = jdk_version
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
//implementation 'cn.hutool:hutool-all:5.8.20'
|
||||
//implementation 'ch.qos.logback:logback-classic:1.2.12'
|
||||
//implementation 'org.slf4j:log4j-over-slf4j:1.7.36'
|
||||
//implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.20.0'
|
||||
//testImplementation platform('org.junit:junit-bom:5.9.1')
|
||||
//testImplementation 'org.junit.jupiter:junit-jupiter'
|
||||
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
//withJavadocJar()
|
||||
}
|
||||
|
||||
Date now = new Date()
|
||||
String date = now.format('yyyy-MM-dd HH:mm:ss')
|
||||
String buildNum = now.format('yyyyMMddHHmmssSSS')
|
||||
|
||||
String gitCommitShortHash = ''
|
||||
String gitBranch = ''
|
||||
try{
|
||||
gitCommitShortHash = 'git log -1 --pretty=%H'.execute([], project.rootDir).text.trim()
|
||||
gitBranch = 'git branch --show-current'.execute([], project.rootDir).text.trim()
|
||||
} catch(Exception e){
|
||||
println "warning: the commandline tools of git was not installed!"
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes 'Group-Name': project.group
|
||||
attributes 'Project-Name': project.name
|
||||
attributes 'Bundle-Version': project.version
|
||||
attributes 'Build-Num': buildNum
|
||||
attributes 'Build-Date': date
|
||||
attributes 'Build-Jdk': System.getProperty('java.version')
|
||||
attributes 'Built-By': 'Kingdee Cosmic Developer Tools'
|
||||
attributes 'Build-Tool': 'Gradle ' + project.gradle.gradleVersion
|
||||
attributes 'Git-Commit-Hash': gitCommitShortHash
|
||||
attributes 'Git-Branch': gitBranch
|
||||
attributes 'Cloud-Name': ''
|
||||
attributes 'App-Name': ''
|
||||
attributes 'Jar-Id': ''
|
||||
attributes 'Build-Image': ''
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//所有子工程共用的配置
|
||||
subprojects {
|
||||
|
||||
dependencies {
|
||||
|
||||
}
|
||||
|
||||
//生成本工程jar包并拷贝到outputdir目录
|
||||
task buildJar(type: Copy, dependsOn: build){
|
||||
group 'build'
|
||||
description '生成本工程jar包并拷贝到outputdir目录'
|
||||
from 'build/libs'
|
||||
into outputdir
|
||||
exclude '*sources.jar','*javadoc.jar','*cosmic-debug*.jar'
|
||||
processResources{
|
||||
from('src/main/java'){
|
||||
include '**/*.properties'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//生成本工程jar包并拷贝到拷贝到cus目录
|
||||
task deployJar(type: Copy, dependsOn: build){
|
||||
group 'build'
|
||||
description '生成本工程jar包并拷贝到拷贝到cus目录'
|
||||
from 'build/libs'
|
||||
into cus
|
||||
exclude '*sources.jar','*javadoc.jar','*cosmic-debug*.jar'
|
||||
processResources{
|
||||
from('src/main/java'){
|
||||
include '**/*.properties'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test.ignoreFailures true
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
/**
|
||||
* This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
* If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
* Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
* Author: liebin.zheng
|
||||
* Generate Date: 2024-10-25 13:35:51
|
||||
*/
|
||||
def cosmic_libs_path = System.getProperty('cosmic_libs_path')
|
||||
def cosmic_home = null
|
||||
|
||||
if(cosmic_libs_path == null){
|
||||
//println "NO 'cosmic_libs_path' property was setted in gradle.properties. "
|
||||
//println "Try to find the 'cosmic_home' property in gradle.properties."
|
||||
cosmic_home = System.getProperty('cosmic_home')
|
||||
}
|
||||
|
||||
if(cosmic_home == null){
|
||||
//println "NO 'cosmic_home' property was setted in gradle.properties. "
|
||||
//println "Try to find the 'COSMIC_HOME' property in System environment."
|
||||
cosmic_home = System.getenv('COSMIC_HOME')
|
||||
}
|
||||
|
||||
if(cosmic_home != null){
|
||||
cosmic_libs_path = "${cosmic_home}/mservice-cosmic/lib"
|
||||
}
|
||||
|
||||
if(cosmic_libs_path == null){
|
||||
throw new RuntimeException("Neither 'COSMIC_LIBS_PATH' was setted in System environment, nor 'cosmic_libs_path' property was setted in gradle.properties.")
|
||||
}
|
||||
|
||||
|
||||
println "The 'cosmic_libs_path' is: '${cosmic_libs_path}'."
|
||||
|
||||
ext {
|
||||
|
||||
path = [
|
||||
trd : "${cosmic_libs_path}/trd",
|
||||
bos : "${cosmic_libs_path}/bos",
|
||||
biz : "${cosmic_libs_path}/biz",
|
||||
cus : "${cosmic_libs_path}/cus",
|
||||
outputdir : "${cosmic_libs_path}/outputdir"
|
||||
]
|
||||
|
||||
}
|
|
@ -0,0 +1,2 @@
|
|||
#Fri Oct 25 13:35:51 CST 2024
|
||||
MCServerURL=http://10.1.7.85:8090/appstore/dev_env
|
Binary file not shown.
After Width: | Height: | Size: 63 KiB |
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
After Width: | Height: | Size: 65 KiB |
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
|
@ -0,0 +1,25 @@
|
|||
### ----------------------------
|
||||
### This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
### If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
### Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
### Author: liebin.zheng
|
||||
### Generate Date: 2024-10-25 13:35:51
|
||||
### ----------------------------
|
||||
systemProp.kddt_version=2.1.6
|
||||
systemProp.template_type=app
|
||||
systemProp.groupId=shkd.cosmic
|
||||
systemProp.artifactId=shkd-cosmic
|
||||
systemProp.version=1.0.0
|
||||
systemProp.jdk.version=1.8
|
||||
systemProp.developer_flag=shkd
|
||||
systemProp.project_dir=E:/scict2
|
||||
systemProp.cosmic_home=E:/scict_sever2
|
||||
#systemProp.cosmic_libs_path=E:/scict_sever2/mservice-cosmic/lib
|
||||
#systemProp.cosmic_static_path=E:/scict_sever2/static-file-service
|
||||
#systemProp.res_url=http://10.1.7.85:8090/appstore/dev_env
|
||||
#systemProp.zk_url=10.1.7.85:2181
|
||||
#systemProp.mc_url=http://10.1.7.85:8090/mc
|
||||
org.gradle.parallel=true
|
||||
org.gradle.daemon=true
|
||||
org.gradle.caching=true
|
||||
org.gradle.jvmargs=-Xms256m -Xmx1024m -XX:MaxMetaspaceSize=128m
|
Binary file not shown.
|
@ -0,0 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-7.6.3-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
|
@ -0,0 +1,240 @@
|
|||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=${0##*/}
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx1024m" "-Xms256m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
|
@ -0,0 +1,91 @@
|
|||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx1024m" "-Xms256m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
|
@ -0,0 +1,150 @@
|
|||
# 金蝶云苍穹Gradle模板使用说明
|
||||
|
||||
## 1.启动服务
|
||||
|
||||
### 1) DebugApplication中设置好环境必要的参数
|
||||
|
||||
- setClusterNumber: 集群编码
|
||||
- setTenantNumber: 租户编码
|
||||
- setMcServerUrl: 设置MC服务地址
|
||||
- setCosmicWepPort: 设置苍穹服务端口
|
||||
- setConfigUrl: 设置zk服务地址及用户密码
|
||||
- setFsServerUrl: 设置文件服务地址
|
||||
- setImageServerUrl: 设置图像服务地址
|
||||
|
||||
|
||||
例:
|
||||
|
||||
```java
|
||||
cosmic.setClusterNumber("cosmic");
|
||||
cosmic.setTenantNumber("sample");
|
||||
cosmic.setMcServerUrl("http://127.0.0.1:8090");
|
||||
cosmic.setCosmicWepPort(8080)
|
||||
cosmic.setConfigUrl("127.0.0.1:2182?user=zk&password=xxxxxx");
|
||||
cosmic.setFsServerUrl("127.0.0.1", 8100);
|
||||
cosmic.setImageServerUrl("127.0.0.1", 8100);
|
||||
```
|
||||
|
||||
|
||||
### 2) 启动服务
|
||||
|
||||
```java
|
||||
kd.cosmic.DebugApplication
|
||||
```
|
||||
首次运行,请检查项目默认的JDK,确保为1.8版本,否则会提示启动异常。
|
||||
|
||||
|
||||
### 3) 登录
|
||||
启动完毕后打开:http://127.0.0.1:8080/ierp
|
||||
|
||||
注意:此处的端口为setCosmicWepPort所配置的具体端口数值
|
||||
|
||||
|
||||
## 2.更新环境
|
||||
菜单操作路径:苍穹开发助手-->更新环境
|
||||
|
||||
将从MC服务器上更新最新包:cosmic.zip、webapp.zip,解压到统一的苍穹资源目录下,可通过系统环境变量"COSMIC_HOME"或项目中gradle.properties的"systemProp.cosmic_home"配置项指定。
|
||||
|
||||
默认的web静态资源目录为:System.getenv("COSMIC_HOME") + "/static-file-service",也可通过以下代码修改:
|
||||
|
||||
```java
|
||||
cosmic.setWebResPath("xxx/static-file-service")
|
||||
```
|
||||
|
||||
注意:更新版本时请先停止在正在跑或调试的工程,避免文件占用无法覆盖。
|
||||
|
||||
## 3.工程打包与部署
|
||||
|
||||
工程打包有多种方式,可通过Idea或Eclipse中Gradle命令界面build菜单下的"buildJar"任务,也可以打开CMD终端使用"gradle buildJar"命令方式实现。
|
||||
|
||||
```cmd
|
||||
cd your_project_dir
|
||||
gradle buildJar
|
||||
```
|
||||
|
||||
Jar包部署有多种方式,可通过Idea或Eclipse中Gradle命令界面build菜单下的"deployJar"任务,也可以打开CMD终端使用"gradle deployJar"命令方式实现。
|
||||
|
||||
```cmd
|
||||
cd your_project_dir
|
||||
gradle deployJar
|
||||
```
|
||||
|
||||
推荐开发工具自带的Gradle构建菜单进行工程的构建、清理及部署等任务。
|
||||
|
||||
Idea Gradle工具菜单如下图:
|
||||
|
||||
![idea-gradle](docs/images/idea-gradle.png)
|
||||
|
||||
|
||||
Eclipse Gradle工具菜单如下图:
|
||||
|
||||
![idea-gradle](docs/images/eclipse-gradle.png)
|
||||
|
||||
|
||||
|
||||
## 6.金蝶代码扫描
|
||||
右键项目工程目录,在右侧菜单中,点击“金蝶代码分析/金蝶代码扫描”功能,即可实现对该工程代码的静态代码扫描。
|
||||
|
||||
![code1](docs/images/code1.png)
|
||||
|
||||
|
||||
## 5.插件选项
|
||||
菜单操作路径:File->Settings->苍穹开发助手
|
||||
|
||||
|
||||
## 6.搜索工具窗
|
||||
菜单操作路径:View->Tool Windows->苍穹开发助手
|
||||
|
||||
若当前为苍穹工程(工程根目录下有cosmic.properties文件),苍穹开发助手自行显示,停靠在右上角。
|
||||
|
||||
提供文档检索功能。
|
||||
|
||||
|
||||
## 7.菜单-登录开发者门户
|
||||
未登录:苍穹开发助手(工具窗)-社区文章-可搜索“开发者社区”文档
|
||||
登录后:苍穹开发助手(工具窗)-社区文章-可搜索“开发者社区+开发者门户”文档
|
||||
|
||||
## 8.常见问题
|
||||
8.1. 忘记ZK账号密码,可通过从MC服务查看的环境变量configUrl,或可通过SQL在MC数据库实例中查询,参考如下SQL
|
||||
|
||||
```sql
|
||||
select t.furl, t.fusername, t.fpassword from t_mc_zookeeper t ;
|
||||
```
|
||||
|
||||
## 9.相关文档
|
||||
|
||||
1、苍穹开发者工具下载与安装
|
||||
https://developer.kingdee.com/article/418778103486608384
|
||||
|
||||
2、金蝶云·苍穹开发环境搭建
|
||||
https://developer.kingdee.com/article/418816210550117376
|
||||
|
||||
3、金蝶云·苍穹开发者助手插件安装
|
||||
https://developer.kingdee.com/article/476393455359492608
|
||||
|
||||
4、金蝶云·苍穹代码规范扫描介绍
|
||||
https://developer.kingdee.com/article/476783839013202176
|
||||
|
||||
5、新版苍穹开发助手如何导入本地已有的项目或工程模块
|
||||
https://developer.kingdee.com/article/517721581637036032
|
||||
|
||||
6、苍穹开发助手Debug工程启动报zookeeper认证错误-NoAuth
|
||||
https://developer.kingdee.com/article/517758258006900992
|
||||
|
||||
7、苍穹debug工程启动或编译报GC错误: Out fo Memory或GC overhead limit
|
||||
https://developer.kingdee.com/article/519826723685411072
|
||||
|
||||
8、启动苍穹本地debug服务的控制台日志卡在CuratorFrameworkImpl这一行
|
||||
https://developer.kingdee.com/article/519891614198842112
|
||||
|
||||
9、IDEA启动命令行过长解决办法
|
||||
https://vip.kingdee.com/article/357806944599232512
|
||||
|
||||
|
||||
## 🤝 联系我们
|
||||
|
||||
请使用云之家扫描以下二维码。
|
||||
|
||||
### 苍穹开发者工具交流反馈群
|
||||
![qrcode](docs/images/cosmic-studio-qrcode.png)
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
/**
|
||||
* This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
* If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
* Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
* Author: liebin.zheng
|
||||
* Generate Date: 2024-10-25 13:35:51
|
||||
*/
|
||||
rootProject.name = System.getProperty('artifactId')
|
||||
|
||||
include(
|
||||
'shkd-cosmic-debug',
|
||||
':shkd-base-common',
|
||||
':shkd-base-helper',
|
||||
|
||||
':shkd-sys-sys',
|
||||
)
|
||||
|
||||
// -------------- 引入苍穹调试工程模块 --------------
|
||||
//project(':shkd-cosmic-debug').projectDir = new File('shkd-cosmic-debug')
|
||||
|
||||
// -------------- 引入公共基础模块 --------------
|
||||
project(':shkd-base-common').projectDir = new File('base/shkd-base-common')
|
||||
project(':shkd-base-helper').projectDir = new File('base/shkd-base-helper')
|
||||
|
||||
// -------------- 引入sys云-sys应用模块 --------------
|
||||
project(':shkd-sys-sys').projectDir = new File('sys/shkd-sys-sys')
|
|
@ -0,0 +1,18 @@
|
|||
/*
|
||||
* This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
* If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
* Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
* Author: liebin.zheng
|
||||
* Generate Date: 2024-10-25 13:35:51
|
||||
*/
|
||||
|
||||
dependencies {
|
||||
|
||||
// 公共基础包
|
||||
implementation project(':shkd-base-common')
|
||||
implementation project(':shkd-base-helper')
|
||||
|
||||
// 引入sys云 - sys应用模块
|
||||
implementation project(':shkd-sys-sys')
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
|
@ -0,0 +1,463 @@
|
|||
/**
|
||||
* This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
* If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
* Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
* Author: liebin.zheng
|
||||
* Generate Date: 2024-10-25 13:35:51
|
||||
*/
|
||||
package kd.cosmic.debug.tools;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.ServerSocket;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import kd.bos.config.client.util.ConfigUtils;
|
||||
import kd.bos.service.bootstrap.Booter;
|
||||
|
||||
/**
|
||||
* cosmic服务启动器,含默认配置,如需更改请在DebugApplication中设置。
|
||||
* 注:本工具类由开发助手自动生成,请不用直接修改本工具类。
|
||||
*/
|
||||
public final class CosmicLauncher {
|
||||
|
||||
/**
|
||||
* 苍穹安装目录的环境变量名称(即苍穹依赖包和静态资源目录的上级目录)
|
||||
*/
|
||||
private static final String COSMIC_HOME = "COSMIC_HOME";
|
||||
|
||||
/**
|
||||
* Gradle变量-Cosmic Home
|
||||
*/
|
||||
private static final String GRADLE_PROPERTIES_COSMIC_HOME = "systemProp.cosmic_home";
|
||||
|
||||
/**
|
||||
* 苍穹Gradle模板默认变量 - 默认的苍穹资源目录
|
||||
*/
|
||||
private static final String DEFAULT_COSMIT_HOME_PATH = System.getProperty("user.home").replaceAll("\\\\", "/") + "/cosmic/home";
|
||||
|
||||
private static final String PROJECT_HOME = "E:/scict2";
|
||||
|
||||
private static final String LOCAL_IP = "127.0.0.1";
|
||||
|
||||
public static String localHostName;
|
||||
|
||||
private boolean setConfigUrl = false;
|
||||
|
||||
private int cosmicPort = 8881;
|
||||
|
||||
private String cosmicUrl = "http://127.0.0.1:" + cosmicPort + "/ierp";
|
||||
|
||||
/**
|
||||
* 是否优先使用MC服务端的配置替代本地调试模板工程的部分默认配置
|
||||
*/
|
||||
private boolean useMcServiceConfigFirst = false;
|
||||
|
||||
public CosmicLauncher() {
|
||||
setDefault();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param useMcServiceConfigFirst 是否优先使用MC服务端的配置替代本地调试模板工程的部分默认配置
|
||||
*/
|
||||
public CosmicLauncher(boolean useMcServiceConfigFirst) {
|
||||
this.useMcServiceConfigFirst = useMcServiceConfigFirst;
|
||||
setDefault();
|
||||
}
|
||||
|
||||
public void setDefault() {
|
||||
|
||||
set("configAppName", "mservice,web");
|
||||
set("webmserviceinone", "true");
|
||||
set("file.encoding", "utf-8");
|
||||
set("MONITOR_HTTP_PORT", "9998");
|
||||
set("JMX_HTTP_PORT", "9091");
|
||||
set("appSplit", "false");
|
||||
set("tenant.code.type", "config");
|
||||
|
||||
localHostName = getLocalHostName();
|
||||
setClusterNumber("cosmic");
|
||||
setTenantNumber("ierp");
|
||||
setAppName("kdcosmic-" + localHostName + "-" + cosmicPort);
|
||||
|
||||
setXdbEnable(false);
|
||||
setSqlOut(true, true);
|
||||
|
||||
setCosmicWepPort(cosmicPort);
|
||||
setWebResPath(getCosmicHome() + "/static-file-service");
|
||||
|
||||
//是否优先使用MC服务端的配置替代本地调试模板工程的部分默认配置
|
||||
if (!useMcServiceConfigFirst) {
|
||||
//当本地开发且连接轻量级环境时,可使用以下默认配置
|
||||
setConfigUrl("127.0.0.1:2181");
|
||||
setMcServerUrl("http://127.0.0.1:8090");
|
||||
setFsServerUrl("127.0.0.1", 8100);
|
||||
setImageServerUrl("127.0.0.1", 8100);
|
||||
|
||||
// setEnableLightWeightDeploy(true);
|
||||
setDubboHostConfig(LOCAL_IP, 28888, 30880);
|
||||
// set("login.type", "STANDALONE");
|
||||
setMqConsumerRegister(false, null);
|
||||
} else {
|
||||
//当需要连接项目开发环境(即非轻量级环境)时,应以MC服务器上面的配置优先
|
||||
// setEnableLightWeightDeploy(false);
|
||||
setMqConsumerRegister(true, localHostName);
|
||||
}
|
||||
|
||||
setStartWithQing(false);
|
||||
|
||||
//是否以轻量级环境启动苍穹服务
|
||||
setEnableLightWeightDeploy(true);
|
||||
|
||||
//本地日志配置
|
||||
setLogConfig(false);
|
||||
|
||||
//Dubbo服务注册配置
|
||||
setDubboConfig(false, true, true);
|
||||
|
||||
}
|
||||
|
||||
public void start() {
|
||||
// LOG.info("Cosmic Service starting! Please check url: {}", getCosmicUrl());
|
||||
Booter.main(null);
|
||||
}
|
||||
|
||||
public void set(String key, String value) {
|
||||
System.setProperty(key, value);
|
||||
}
|
||||
|
||||
public String get(String key) {
|
||||
return System.getProperty(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置苍穹服务器IP地址(包括MC、ZK、文件及图片服务)
|
||||
* 不推荐使用该方法,项目开发时应该分别配置这几个服务地址,或者优先使用MC服务器上的配置。
|
||||
*/
|
||||
@Deprecated
|
||||
public void setServerIp(String ip) {
|
||||
setMcServerUrl("http://" + ip + ":8090");
|
||||
if (!setConfigUrl) {
|
||||
setConfigUrl(ip + ":2181");
|
||||
}
|
||||
setFsServerUrl(ip, 8100);
|
||||
setImageServerUrl(ip, 8100);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置MC服务地址
|
||||
*
|
||||
* @param mcServerUrl
|
||||
*/
|
||||
public void setMcServerUrl(String mcServerUrl) {
|
||||
set("mc.server.url", mcServerUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param configUrl 配置服务地址
|
||||
*/
|
||||
public void setConfigUrl(String configUrl) {
|
||||
set(ConfigUtils.CONFIG_URL_KEY, configUrl);
|
||||
setConfigUrl = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置服务地址
|
||||
*
|
||||
* @param connectString zookeeper链接URL,如 127.0.0.1:2181
|
||||
* @param user 用户
|
||||
* @param password 密码
|
||||
*/
|
||||
public void setConfigUrl(String connectString, String user, String password) {
|
||||
if (user != null && password != null) {
|
||||
setConfigUrl(connectString + "?user=" + user + "&password=" + password);
|
||||
} else {
|
||||
setConfigUrl(connectString);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param clusterNumber 集群编码
|
||||
*/
|
||||
public void setClusterNumber(String clusterNumber) {
|
||||
set(ConfigUtils.CLUSTER_NAME_KEY, clusterNumber);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param appName 本节点服务名称
|
||||
*/
|
||||
public void setAppName(String appName) {
|
||||
setAppName(appName, true);
|
||||
}
|
||||
|
||||
public void setAppName(String appName, boolean alsoSetQueueTag) {
|
||||
set(ConfigUtils.APP_NAME_KEY, appName);
|
||||
if (alsoSetQueueTag) {
|
||||
setQueueTag(appName);
|
||||
}
|
||||
}
|
||||
|
||||
public void setStartWithQing(boolean b) {
|
||||
set("bos.app.special.deployalone.ids", b ? " " : "qing");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tenantNumber 租户编码
|
||||
*/
|
||||
public void setTenantNumber(String tenantNumber) {
|
||||
set("domain.tenantCode", tenantNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param enable 是否开启水平分表服务
|
||||
*/
|
||||
public void setXdbEnable(boolean enable) {
|
||||
set("xdb.enable", String.valueOf(enable));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param tag 队列标记
|
||||
*/
|
||||
public void setQueueTag(String tag) {
|
||||
set("mq.debug.queue.tag", tag);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param path web静态资源路径
|
||||
*/
|
||||
public void setWebResPath(String path) {
|
||||
set("JETTY_WEBRES_PATH", path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 控制台输出SQL开关
|
||||
*
|
||||
* @param outSql 是否输出SQL
|
||||
* @param withParameter 是否输出参数
|
||||
*/
|
||||
public void setSqlOut(boolean outSql, boolean withParameter) {
|
||||
set("db.sql.out", String.valueOf(outSql));
|
||||
set("db.sql.out.withParameter", String.valueOf(withParameter));
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置苍穹服务端口
|
||||
* @param port
|
||||
*/
|
||||
public void setCosmicWepPort(int port) {
|
||||
this.cosmicPort = port;
|
||||
this.cosmicUrl = "http://127.0.0.1:" + cosmicPort + "/ierp";
|
||||
set("JETTY_WEB_PORT", String.valueOf(cosmicPort));
|
||||
set("domain.contextUrl", cosmicUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否注册为MQ消费者
|
||||
* @param registerOnMq
|
||||
* @param debbugTopic
|
||||
*/
|
||||
public void setMqConsumerRegister(boolean registerOnMq, String debbugTopic) {
|
||||
set("mq.consumer.register", String.valueOf(registerOnMq));
|
||||
if(StringUtils.isNotBlank(debbugTopic)) {
|
||||
set("mq.debug.queue.tag", debbugTopic);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置文件服务地址
|
||||
* @param ip
|
||||
* @param port
|
||||
*/
|
||||
public void setFsServerUrl(String ip, int port) {
|
||||
set("fileserver", "http://" + ip + ":" + port + "/fileserver/");
|
||||
set("attachmentServer.url", "http://" + ip + ":" + port + "/fileserver/");
|
||||
set("attachmentServer.inner.url", "http://" + ip + ":" + port + "/fileserver/");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置图片服务地址
|
||||
* @param ip
|
||||
* @param port
|
||||
*/
|
||||
public void setImageServerUrl(String ip, int port) {
|
||||
set("imageServer.url", "http://" + ip + ":" + port + "/fileserver/");
|
||||
set("imageServer.inner.url", "http://" + ip + ":" + port + "/fileserver/");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取苍穹服务URL
|
||||
*/
|
||||
public String getCosmicUrl() {
|
||||
return cosmicUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置webapp配置所在的目录
|
||||
*/
|
||||
public void setWebAppPath(String path) {
|
||||
set("JETTY_WEBAPP_PATH", path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否以轻量级环境启动苍穹服务
|
||||
*/
|
||||
public void setEnableLightWeightDeploy(boolean enable) {
|
||||
set("lightweightdeploy", String.valueOf(enable));
|
||||
set("lightweightdeploy.services", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Redis配置
|
||||
*/
|
||||
public void setRedisConfig(String redisUrl) {
|
||||
set("redis.serversForCache", redisUrl);
|
||||
set("redis.serversForSession", redisUrl);
|
||||
set("algo.storage.redis.url", redisUrl);
|
||||
set("redismodelcache.enablelua", String.valueOf(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* MQ配置
|
||||
*/
|
||||
public void setMqHostConfig(String mqHost, String mqPort, String mqUser, String mqPassword, String mqVhost) {
|
||||
String line = System.lineSeparator();
|
||||
StringBuffer builder = new StringBuffer();
|
||||
builder.append("type=rabbitmq").append(line).append("host=").append(mqHost).append(line).append("port=")
|
||||
.append(mqPort).append(line).append("user=").append(mqUser).append(line).append("password=")
|
||||
.append(mqPassword).append(line).append("vhost=").append(mqVhost);
|
||||
set("mq.server", builder.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否启用监控中心日志配置(是否将日志通过kafka上传到日志中心)</br>
|
||||
* 注:如需要启用,请先确保elk、kafka等服务已可用
|
||||
*/
|
||||
public void setLogConfig(boolean useMonitorLog) {
|
||||
// String logConfigXmlContent = null;
|
||||
String path = null;
|
||||
if(useMonitorLog) {
|
||||
//日志通过kafka上传到日志中心
|
||||
path = "logback-kafka.xml";
|
||||
// logConfigXmlContent = FileUtil.readUtf8String("classpath:logback-kafka.xml");
|
||||
} else {
|
||||
//本地日志配置
|
||||
path = "logback.xml";
|
||||
// logConfigXmlContent = FileUtil.readUtf8String("classpath:logback.xml");
|
||||
}
|
||||
String logConfigXmlContent;
|
||||
try {
|
||||
logConfigXmlContent = IOUtils.toString(getClass().getClassLoader().getResourceAsStream(path), "utf-8");
|
||||
// logConfigXmlContent = new String(Files.readAllBytes(Paths.get(getClass().getClassLoader().getResource(path).toURI())), "UTF-8");
|
||||
set("log.config", logConfigXmlContent);
|
||||
set("dubbo.application.logger", "slf4j");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dubbo服务配置
|
||||
*
|
||||
* @param registerProvider 是否向此注册中心注册服务,如果设为false,将只订阅,不注册
|
||||
* @param registerComsumer 是否向此注册中心订阅服务,如果设为false,将只注册,不订阅
|
||||
* @param lookupLocal 是否使用本地服务查找
|
||||
*/
|
||||
public void setDubboConfig(boolean registerProvider, boolean registerComsumer, boolean lookupLocal) {
|
||||
// set("dubbo.registry.group", group);
|
||||
set("dubbo.registry.register", String.valueOf(registerProvider));
|
||||
set("dubbo.registry.subscribe", String.valueOf(registerComsumer));
|
||||
//dubbo官方资料上没有支持lookupLocal配置,可能是平台扩展的功能,也可能是无效的配置
|
||||
set("dubbo.service.lookup.local", String.valueOf(lookupLocal));
|
||||
// set("dubbo.registry.protocol", "zookeeper");
|
||||
// set("dubbo.registry.address", "");
|
||||
}
|
||||
|
||||
/**
|
||||
* Dubbo网络配置
|
||||
* @param ip 默认127.0.0.1
|
||||
* @param port 默认28888
|
||||
* @param qingPort 默认30880
|
||||
*/
|
||||
public void setDubboHostConfig(String ip, int port, int qingPort) {
|
||||
port = getAvailablePort(port);
|
||||
qingPort = getAvailablePort(qingPort);
|
||||
set("dubbo.protocol.port", String.valueOf(port));
|
||||
set("dubbo.consumer.url", "dubbo://" + ip + ":" + port);
|
||||
set("dubbo.consumer.url.qing", "dubbo://" + ip + ":" + qingPort);
|
||||
}
|
||||
|
||||
public int getAvailablePort(int port) {
|
||||
try (ServerSocket serverSocket = new ServerSocket(port)) {
|
||||
return port;
|
||||
} catch (IOException e) {
|
||||
return getAvailablePort(port+1);
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 设置苍穹服务的中间件类型
|
||||
// * @param serverType
|
||||
// */
|
||||
// public void setCosmicServerType(CosmicServerType serverType) {
|
||||
// if(serverType == CosmicServerType.springboot) {
|
||||
// set("mservice.booter.type", serverType.name());
|
||||
// } else {
|
||||
// set("webserver.type", serverType.name());
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// enum CosmicServerType{
|
||||
// jetty,tomcat,aas,springboot;
|
||||
// }
|
||||
|
||||
private static String getLocalHostName() {
|
||||
InetAddress localhost = null;
|
||||
try {
|
||||
localhost = InetAddress.getLocalHost();
|
||||
} catch (UnknownHostException e) {
|
||||
return "UnknownHost";
|
||||
}
|
||||
return localhost.getHostName();
|
||||
}
|
||||
|
||||
public static String getCosmicHome(){
|
||||
return getCosmicHome(PROJECT_HOME);
|
||||
}
|
||||
|
||||
public static String getCosmicHome(String projectPath){
|
||||
String cosmicHome = getCosmicGradleProp(projectPath, GRADLE_PROPERTIES_COSMIC_HOME);
|
||||
if(StringUtils.isBlank(cosmicHome)) {
|
||||
cosmicHome = System.getenv(COSMIC_HOME);
|
||||
}
|
||||
if(StringUtils.isBlank(cosmicHome)) {
|
||||
cosmicHome = DEFAULT_COSMIT_HOME_PATH;
|
||||
}
|
||||
return cosmicHome;
|
||||
}
|
||||
|
||||
private static String getCosmicGradleProp(String projectPath, String key) {
|
||||
String gradleConfigPath = projectPath + "/gradle.properties";
|
||||
Properties prop = new Properties();
|
||||
try {
|
||||
File configFile = new File(gradleConfigPath);
|
||||
if(configFile.exists()) {
|
||||
FileReader fr = new FileReader(configFile);
|
||||
prop.load(fr);
|
||||
fr.close();
|
||||
return prop.getProperty(key);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
* If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
* Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
* Author: liebin.zheng
|
||||
* Generate Date: 2024-10-25 13:35:51
|
||||
*/
|
||||
package shkd.cosmic.debug;
|
||||
|
||||
import kd.cosmic.debug.tools.CosmicLauncher;
|
||||
|
||||
/**
|
||||
* 启动本地应用程序(微服务节点)
|
||||
*/
|
||||
public class DebugApplication {
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
// Thread.currentThread().setContextClassLoader(new KDSecurityClassLoader(Thread.currentThread().getContextClassLoader()));
|
||||
|
||||
CosmicLauncher cosmic = new CosmicLauncher(false);
|
||||
|
||||
cosmic.setClusterNumber("cosmic");
|
||||
cosmic.setTenantNumber("ierp");
|
||||
|
||||
cosmic.setConfigUrl("10.1.7.85:2181?user=zookeeper&password=Cosmic@3292");
|
||||
// cosmic.setConfigUrl("10.1.7.85:2181");
|
||||
|
||||
// cosmic.setMcServerUrl("http://127.0.0.1:8090");
|
||||
cosmic.setMcServerUrl("http://10.1.7.85:8090/mc");
|
||||
|
||||
cosmic.setWebResPath("E:/scict_sever2/static-file-service");
|
||||
|
||||
// cosmic.setFsServerUrl("127.0.0.1", 8100);
|
||||
// cosmic.setImageServerUrl("127.0.0.1", 8100);
|
||||
|
||||
//自定义本地苍穹调试服务的端口
|
||||
cosmic.setCosmicWepPort(8881);
|
||||
// cosmic.setDubboConfig(false, true, true);
|
||||
cosmic.start();
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
Author: liebin.zheng
|
||||
Generate Date: 2024-10-25 13:35:51
|
||||
-->
|
||||
<configuration>
|
||||
|
||||
<property name="LOG_DIR" value="logs"/>
|
||||
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${PID:- } --- [%t] %-40.40logger{39} : %m%n"/>
|
||||
|
||||
<logger name="org.apache.catalina.startup.DigesterFactory" level="ERROR"/>
|
||||
<logger name="org.apache.catalina.util.LifecycleBase" level="ERROR"/>
|
||||
<logger name="org.apache.coyote.http11.Http11NioProtocol" level="WARN"/>
|
||||
<logger name="org.apache.sshd.common.util.SecurityUtils" level="WARN"/>
|
||||
<logger name="org.apache.tomcat.util.net.NioSelectorPool" level="WARN"/>
|
||||
<logger name="org.eclipse.jetty.util.component.AbstractLifeCycle" level="ERROR"/>
|
||||
<logger name="org.hibernate.validator.internal.util.Version" level="WARN"/>
|
||||
<logger name="org.springframework.boot.actuate.endpoint.jmx" level="WARN"/>
|
||||
|
||||
<logger name="kd.bos.dc.utils.AccountUtils" level="WARN"/>
|
||||
<logger name="kd.bos.license" level="WARN"/>
|
||||
<logger name="org.apache.zookeeper" level="WARN"/>
|
||||
<logger name="kd.bos.portal.pluginnew" level="WARN" />
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<!--
|
||||
<appender name="FILE"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<encoder>
|
||||
<pattern>${LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
<file>${LOG_DIR}/cosmic_out.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<cleanHistoryOnStart>false</cleanHistoryOnStart>
|
||||
<fileNamePattern>${LOG_DIR}/cosmic_out_%d{yyyyMMdd}_%i.log</fileNamePattern>
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
<maxHistory>7</maxHistory>
|
||||
<totalSizeCap>0</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
-->
|
||||
<appender name="kafka" class="kd.bos.logging.console.slf4j.logback.KafkaAppender">
|
||||
<topic>{{clusterName}}-log</topic>
|
||||
<brokerList>{{log.kafka.ip_port}}</brokerList>
|
||||
<compressionType>none</compressionType>
|
||||
<syncSend>false</syncSend>
|
||||
<keySerializerClass>org.apache.kafka.common.serialization.StringSerializer</keySerializerClass>
|
||||
<valueSerializerClass>org.apache.kafka.common.serialization.StringSerializer</valueSerializerClass>
|
||||
</appender>
|
||||
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="kafka" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
Author: liebin.zheng
|
||||
Generate Date: 2024-10-25 13:35:51
|
||||
-->
|
||||
<configuration>
|
||||
|
||||
<property name="LOG_DIR" value="logs"/>
|
||||
<property name="LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %5p ${PID:- } --- [%t] %-40.40logger{39} : %m%n"/>
|
||||
|
||||
<logger name="org.apache.catalina.startup.DigesterFactory" level="ERROR"/>
|
||||
<logger name="org.apache.catalina.util.LifecycleBase" level="ERROR"/>
|
||||
<logger name="org.apache.coyote.http11.Http11NioProtocol" level="WARN"/>
|
||||
<logger name="org.apache.sshd.common.util.SecurityUtils" level="WARN"/>
|
||||
<logger name="org.apache.tomcat.util.net.NioSelectorPool" level="WARN"/>
|
||||
<logger name="org.eclipse.jetty.util.component.AbstractLifeCycle" level="ERROR"/>
|
||||
<logger name="org.hibernate.validator.internal.util.Version" level="WARN"/>
|
||||
<logger name="org.springframework.boot.actuate.endpoint.jmx" level="WARN"/>
|
||||
|
||||
<logger name="kd.bos.dc.utils.AccountUtils" level="WARN"/>
|
||||
<logger name="kd.bos.license" level="WARN"/>
|
||||
<logger name="org.apache.zookeeper" level="INFO"/>
|
||||
<logger name="kd.bos.portal.pluginnew" level="WARN" />
|
||||
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>${LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<appender name="FILE"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<encoder>
|
||||
<pattern>${LOG_PATTERN}</pattern>
|
||||
</encoder>
|
||||
<file>${LOG_DIR}/cosmic_out.log</file>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<cleanHistoryOnStart>false</cleanHistoryOnStart>
|
||||
<fileNamePattern>${LOG_DIR}/cosmic_out_%d{yyyyMMdd}_%i.log</fileNamePattern>
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
<maxHistory>7</maxHistory>
|
||||
<totalSizeCap>0</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
<!--
|
||||
<appender name="kafka" class="kd.bos.logging.console.slf4j.logback.KafkaAppender">
|
||||
<topic>{{clusterName}}-log</topic>
|
||||
<brokerList>{{log.kafka.ip_port}}</brokerList>
|
||||
<compressionType>none</compressionType>
|
||||
<syncSend>false</syncSend>
|
||||
<keySerializerClass>org.apache.kafka.common.serialization.StringSerializer</keySerializerClass>
|
||||
<valueSerializerClass>org.apache.kafka.common.serialization.StringSerializer</valueSerializerClass>
|
||||
</appender>
|
||||
-->
|
||||
<root level="INFO">
|
||||
<appender-ref ref="CONSOLE" />
|
||||
<appender-ref ref="FILE" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
* If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
* Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
* Author: liebin.zheng
|
||||
* Generate Date: 2024-10-25 13:35:51
|
||||
*/
|
||||
|
||||
dependencies {
|
||||
api project(':shkd-base-common')
|
||||
api project(':shkd-base-helper')
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package shkd.sys.sys.business;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class test {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// List list = new ArrayList<>();
|
||||
// list.contains();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* This is a kingdee cosmic template project that is automatically generated by the Kingdee cosmic development assistant plugin.
|
||||
* If there are any issues during the use process, you can provide feedback to the kingdee developer community website.
|
||||
* Website: https://developer.kingdee.com/developer?productLineId=29
|
||||
* Author: liebin.zheng
|
||||
* Generate Date: 2024-10-25 13:35:51
|
||||
*/
|
||||
package shkd.sys.sys.common;
|
||||
|
||||
/**
|
||||
* sys云sys应用-通用常量类<br>
|
||||
* 代码中不能存在硬编码敏感信息,如账号、密码、http外链、ftp外链、邮箱等。<br>
|
||||
* 标识或缓存的常量,需以"KEY_"、"FID_"、"ENTRY_"或"SUBENTRY_"作为变量的前缀。<br>
|
||||
*
|
||||
* @author shkd
|
||||
* @date 2024-10-25 13:35:51
|
||||
*/
|
||||
public class AppflgConstant {
|
||||
|
||||
public static final String KEY_APP_NAME = "sys-sys";
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/shkd-sys-sys/src/main/java" isTestSource="false" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
Loading…
Reference in New Issue