Compare commits

...

3 Commits
0.2.6 ... 0.3.0

Author SHA1 Message Date
曾文豪
8854225934 publish 0.3.0 2023-02-08 19:22:17 +08:00
曾文豪
5ad35cefda publish 0.3.0 2023-02-08 19:20:45 +08:00
曾文豪
1921efa27b perf:移除插件代码 2023-02-08 19:19:00 +08:00
15 changed files with 57 additions and 271 deletions

View File

@@ -9,9 +9,6 @@ deploy-jar:
rules:
- if: $CI_COMMIT_TAG
script:
- cd springboot-launcher
- mvn clean install
- cd ..
- mvn clean deploy -Dmaven.test.skip -DaltDeploymentRepository=master::default::file:/usr/local/nginx/html/kepai-repo
- cd /usr/local/nginx/html/kepai-repo
- git checkout master

46
pom.xml
View File

@@ -4,9 +4,9 @@
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>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
<packaging>pom</packaging>
<name>springboot-parent</name>
<description>杭州铁晟科技有限公司基础依赖</description>
@@ -28,7 +28,6 @@
<module>springboot-message</module>
<module>springboot-encrypt</module>
<module>springboot-annotation</module>
<module>springboot-launcher</module>
</modules>
<properties>
@@ -56,57 +55,57 @@
<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-db-migration</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-encrypt</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-poi</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</dependency>
<dependency>
@@ -128,9 +127,6 @@
<pluginRepository>
<id>kepai-repo-plugin</id>
<url>http://git.kepai365.com/zeng_wenhao/kepai-repo/raw/master</url>
<releases>
<enabled>true</enabled>
</releases>
</pluginRepository>
</pluginRepositories>
@@ -138,7 +134,7 @@
<pluginManagement>
<plugins>
<plugin>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-plugin</groupId>
<artifactId>launcher-maven-plugin</artifactId>
<version>0.0.2</version>
<executions>

View File

@@ -4,9 +4,9 @@
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>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</parent>
<artifactId>springboot-ademo</artifactId>
@@ -20,7 +20,7 @@
<dependencies>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-web</artifactId>
</dependency>
</dependencies>
@@ -29,16 +29,13 @@
<repository>
<id>kepai-repo</id>
<url>http://git.kepai365.com/zeng_wenhao/kepai-repo/raw/master</url>
<releases>
<enabled>true</enabled>
</releases>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-plugin</groupId>
<artifactId>launcher-maven-plugin</artifactId>
</plugin>
<plugin>

View File

@@ -4,9 +4,9 @@
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>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</parent>
<artifactId>springboot-annotation</artifactId>

View File

@@ -4,9 +4,9 @@
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>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</parent>
<artifactId>springboot-db-migration</artifactId>
@@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
</dependency>

View File

@@ -4,9 +4,9 @@
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>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</parent>
<artifactId>springboot-encrypt</artifactId>
@@ -31,12 +31,12 @@
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId>
</dependency>

View File

@@ -1,32 +0,0 @@
<?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>
<groupId>com.tiesheng</groupId>
<artifactId>launcher-maven-plugin</artifactId>
<packaging>maven-plugin</packaging>
<version>0.0.2</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.5.2</version>
</dependency>
</dependencies>
</project>

View File

@@ -1,73 +0,0 @@
package com.tiesheng.launcher;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import java.io.*;
import java.nio.charset.StandardCharsets;
/**
* 指定调用本类execute()方法的目标
**/
@Mojo(name = "initScript", defaultPhase = LifecyclePhase.PREPARE_PACKAGE)
public class CopyLauncherScriptMojo extends AbstractMojo {
@Parameter(defaultValue = "${basedir}/target", required = true)
private File outputDirectory;
public void setOutputDirectory(File outputDirectory) {
this.outputDirectory = outputDirectory;
}
@Override
public void execute() throws MojoExecutionException {
try {
copy("launchScript");
System.out.println("initScript success.");
} catch (IOException e) {
throw new MojoExecutionException("copy launchScript error");
}
}
/**
* 复制脚本
*
* @param filename
* @throws IOException
*/
private void copy(String filename) throws IOException {
InputStream inputStream = getClass().getResourceAsStream("/" + filename);
BufferedWriter writer = null;
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
File target = new File(outputDirectory + "/" + filename);
target.setExecutable(true, false);
target.setWritable(true, false);
target.setReadable(true, false);
writer = new BufferedWriter(new FileWriter(target));
while (true) {
String line = reader.readLine();
if (line == null) {
break;
}
writer.write(line);
writer.newLine();
}
writer.flush();
} finally {
if (inputStream != null) {
inputStream.close();
}
if (writer != null) {
writer.close();
}
}
}
}

View File

@@ -1,99 +0,0 @@
#!/bin/bash
#
# . ____ _ __ _ _
# /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
# ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
# \\/ ___)| |_)| | | | | || (_| | ) ) ) )
# ' |____| .__|_| |_|_| |_\__, | / / / /
# =========|_|==============|___/=/_/_/_/
# :: Spring Boot Startup Script ::
#
### BEGIN INIT INFO
# Provides: {{initInfoProvides:spring-boot-application}}
# Required-Start: {{initInfoRequiredStart:$remote_fs $syslog $network}}
# Required-Stop: {{initInfoRequiredStop:$remote_fs $syslog $network}}
# Default-Start: {{initInfoDefaultStart:2 3 4 5}}
# Default-Stop: {{initInfoDefaultStop:0 1 6}}
# Short-Description: {{initInfoShortDescription:Spring Boot Application}}
# Description: {{initInfoDescription:Spring Boot Application}}
# chkconfig: {{initInfoChkconfig:2345 99 01}}
### END INIT INFO
[[ -n "$DEBUG" ]] && set -x
# Initialize variables that cannot be provided by a .conf file
WORKING_DIR="$(pwd)"
# shellcheck disable=SC2153
[[ -n "$JARFILE" ]] && jarfile="$JARFILE"
[[ -n "$APP_NAME" ]] && identity="$APP_NAME"
# Follow symlinks to find the real jar and detect init.d script
cd "$(dirname "$0")" || exit 1
[[ -z "$jarfile" ]] && jarfile=$(pwd)/$(basename "$0")
while [[ -L "$jarfile" ]]; do
[[ "$jarfile" =~ init\.d ]] && init_script=$(basename "$jarfile")
jarfile=$(readlink "$jarfile")
cd "$(dirname "$jarfile")" || exit 1
jarfile=$(pwd)/$(basename "$jarfile")
done
jarfolder="$( (cd "$(dirname "$jarfile")" && pwd -P) )"
cd "$WORKING_DIR" || exit 1
# ANSI Colors
echoRed() { echo $'\e[0;31m'"$1"$'\e[0m'; }
echoGreen() { echo $'\e[0;32m'"$1"$'\e[0m'; }
echoYellow() { echo $'\e[0;33m'"$1"$'\e[0m'; }
# Determine the user to run as if we are root
# shellcheck disable=SC2012
[[ $(id -u) == "0" ]] && run_user=$(ls -ld "$jarfile" | awk '{print $3}')
# Find Java
if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
javaexe="$JAVA_HOME/bin/java"
elif type -p java > /dev/null 2>&1; then
javaexe=$(type -p java)
elif [[ -x "/usr/bin/java" ]]; then
javaexe="/usr/bin/java"
else
echo "Unable to find Java"
exit 1
fi
## 配置service
service() {
tempCahr='$'
## 创建service文件
working_dir=$(dirname "$jarfile")
service_file="/etc/systemd/system/$1.service"
echo "[Unit]" > $service_file
echo "Description=$1" >> $service_file
echo "After=rc-local.service network.target remote-fs.target nss-lookup.target" >> $service_file
echo "" >> $service_file
echo "[Service]" >> $service_file
echo "Type=forking" >> $service_file
echo "WorkingDirectory=$working_dir" >> $service_file
echo "ExecStart=/bin/sh -c '$javaexe -Xms64m -Xmx128m -Dserver.port=$2 -Dspring.profiles.active=$3 -jar $jarfile > /dev/null 2>&1 &'" >> $service_file
echo "ExecReload=/bin/kill -s HUP ${tempCahr}MAINPID" >> $service_file
echo "ExecStop=/bin/kill -s QUIT ${tempCahr}MAINPID" >> $service_file
echo "" >> $service_file
echo "[Install]" >> $service_file
echo "WantedBy=multi-user.target" >> $service_file
systemctl daemon-reload
## 自启动
systemctl enable $1
## 配置成功
echoGreen "config success, use 'systemctl start $1 ' to start"
}
service "$@"
exit 0

View File

@@ -4,9 +4,9 @@
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>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</parent>
<artifactId>springboot-login</artifactId>
@@ -27,12 +27,12 @@
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId>
</dependency>

View File

@@ -4,9 +4,9 @@
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>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</parent>
<artifactId>springboot-message</artifactId>
@@ -20,7 +20,7 @@
<dependencies>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-platform</artifactId>
</dependency>

View File

@@ -4,9 +4,9 @@
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>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</parent>
<artifactId>springboot-platform</artifactId>
@@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
</dependency>
</dependencies>

View File

@@ -4,9 +4,9 @@
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>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</parent>
<artifactId>springboot-poi</artifactId>
@@ -25,7 +25,7 @@
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
</dependency>

View File

@@ -4,9 +4,9 @@
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>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</parent>
<artifactId>springboot-util</artifactId>

View File

@@ -4,9 +4,9 @@
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>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-parent</artifactId>
<version>0.2.6</version>
<version>0.3.0</version>
</parent>
<artifactId>springboot-web</artifactId>
@@ -58,32 +58,32 @@
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-util</artifactId>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-db-migration</artifactId>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-poi</artifactId>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-annotation</artifactId>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-login</artifactId>
</dependency>
<dependency>
<groupId>com.tiesheng</groupId>
<groupId>com.tiesheng.springboot-parent</groupId>
<artifactId>springboot-message</artifactId>
</dependency>