Commit abd75aa8 by wangguangchao

修改打包方式

parent 137ac685
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
\ No newline at end of file
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
<sourceRoots>
<root url="file://$MODULE_DIR$/src/main/java" />
<root url="file://$MODULE_DIR$/src/main/resources" />
</sourceRoots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_5">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/profiles/local" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/profiles/dev" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:3.0.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter:3.0.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-context:3.0.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-crypto:5.4.9" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-commons:3.0.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.security:spring-security-rsa:1.0.10.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.68" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.68" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-eureka-server:3.0.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.4.13" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.4.13" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.4.13" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.55" level="project" />
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.55" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.3.13" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.3.13" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.3.13" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.3.13" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.3.13" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-actuator:2.4.13" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator-autoconfigure:2.4.13" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-actuator:2.4.13" level="project" />
<orderEntry type="library" name="Maven: io.micrometer:micrometer-core:1.6.13" level="project" />
<orderEntry type="library" name="Maven: org.hdrhistogram:HdrHistogram:2.1.12" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.latencyutils:LatencyUtils:2.0.3" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-freemarker:2.4.13" level="project" />
<orderEntry type="library" name="Maven: org.freemarker:freemarker:2.3.31" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.3.13" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-netflix-eureka-client:3.0.5" level="project" />
<orderEntry type="library" name="Maven: com.netflix.eureka:eureka-client:1.10.17" level="project" />
<orderEntry type="library" name="Maven: com.netflix.netflix-commons:netflix-eventbus:0.3.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.netflix.netflix-commons:netflix-infix:0.3.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: commons-jxpath:commons-jxpath:1.3" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.antlr:antlr-runtime:3.4" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.antlr:stringtemplate:3.2.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: antlr:antlr:2.7.7" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.apache.commons:commons-math:2.2" level="project" />
<orderEntry type="library" name="Maven: com.thoughtworks.xstream:xstream:1.4.18" level="project" />
<orderEntry type="library" name="Maven: io.github.x-stream:mxparser:1.2.2" level="project" />
<orderEntry type="library" name="Maven: xmlpull:xmlpull:1.1.3.1" level="project" />
<orderEntry type="library" name="Maven: javax.ws.rs:jsr311-api:1.1.1" level="project" />
<orderEntry type="library" name="Maven: com.netflix.servo:servo-core:0.12.21" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:19.0" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-core:1.19.1" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey.contribs:jersey-apache-client4:1.19.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.6" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
<orderEntry type="library" name="Maven: commons-configuration:commons-configuration:1.10" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: com.google.inject:guice:4.1.0" level="project" />
<orderEntry type="library" name="Maven: aopalliance:aopalliance:1.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.10.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.10.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.10.5.1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.codehaus.jettison:jettison:1.4.0" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-servlet:1.19.4" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-server:1.19.4" level="project" />
<orderEntry type="library" name="Maven: com.sun.jersey:jersey-client:1.19.4" level="project" />
<orderEntry type="library" name="Maven: com.netflix.eureka:eureka-core:1.10.17" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-core:1.11.277" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.3" level="project" />
<orderEntry type="library" name="Maven: software.amazon.ion:ion-java:1.0.2" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.7" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.8.1" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-ec2:1.11.277" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:jmespath-java:1.11.277" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-autoscaling:1.11.277" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-sts:1.11.277" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-route53:1.11.277" level="project" />
<orderEntry type="library" name="Maven: javax.servlet:servlet-api:2.5" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.woodstox:woodstox-core:6.2.1" level="project" />
<orderEntry type="library" name="Maven: javax.inject:javax.inject:1" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.11.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.11.4" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:4.2.1" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-starter-loadbalancer:3.0.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.cloud:spring-cloud-loadbalancer:3.0.5" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor:reactor-core:3.4.12" level="project" />
<orderEntry type="library" name="Maven: org.reactivestreams:reactive-streams:1.0.3" level="project" />
<orderEntry type="library" name="Maven: io.projectreactor.addons:reactor-extra:3.4.5" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.4.13" level="project" />
<orderEntry type="library" name="Maven: com.stoyanr:evictor:1.0.0" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jaxb:jaxb-runtime:2.3.5" level="project" />
<orderEntry type="library" name="Maven: org.glassfish.jaxb:txw2:2.3.5" level="project" />
<orderEntry type="library" name="Maven: com.sun.istack:istack-commons-runtime:3.0.12" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.activation:jakarta.activation:1.2.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.5.12" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.5.12" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.5.12" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.3.18" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.5.12" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.5.12" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.11" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.17.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.17.2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.36" level="project" />
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.28" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.5.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.5.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" />
<orderEntry type="library" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" />
<orderEntry type="library" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.19.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.9.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.20" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.20" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:3.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.9.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.3.18" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.3.18" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.3.18" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.8.4" level="project" />
</component>
</module>
\ No newline at end of file
......@@ -17,8 +17,9 @@ spec:
version: v1
spec:
containers:
- image: 192.168.0.110:8062/rdwh/eurekaserver:latest
- image: rdwh/eurekaserver:latest
name: eureka-server
command: ['sh','-c','sh ./bin/startup.sh && sleep 3600']
ports:
- containerPort: 8769
---
......
......@@ -35,6 +35,40 @@
</dependency>
</dependencies>
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<package.environment>local</package.environment>
<jar.version>-SNAPSHOT</jar.version>
</properties>
</profile>
<profile>
<id>dev</id>
<properties>
<package.environment>dev</package.environment>
<jar.version>-SNAPSHOT</jar.version>
</properties>
</profile>
<profile>
<id>test</id>
<properties>
<package.environment>test</package.environment>
<jar.version>-TEST</jar.version>
</properties>
</profile>
<profile>
<id>prd</id>
<properties>
<package.environment>prd</package.environment>
<jar.version>-RELEASE</jar.version>
</properties>
</profile>
</profiles>
<repositories>
<repository>
<id>brilliance-virtual</id>
......@@ -48,17 +82,77 @@
<build>
<plugins>
<!-- <plugin>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-maven-plugin</artifactId>-->
<!-- <version>2.3.12.RELEASE</version>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <goals>-->
<!-- <goal>repackage</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.3.12.RELEASE</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib/</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<excludes>
<exclude>*.**</exclude>
<exclude>*/*.xml</exclude>
<exclude>config/**</exclude>
</excludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<useUniqueVersions>false</useUniqueVersions>
<mainClass>com.brilliance.hk.EurekaServerApplication</mainClass>
</manifest>
</archive>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>repackage</goal>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<attach>true</attach>
<appendAssemblyId>false</appendAssemblyId>
<tarLongFileMode>gnu</tarLongFileMode>
<descriptors>
<descriptor>src/main/assembly/assembly.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
......
<assembly xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/assembly-1.0.0.xsd">
<id>package</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!-- 程序本身的jar -->
<fileSet>
<directory>target</directory>
<outputDirectory>.</outputDirectory>
<includes>
<include>${project.artifactId}*.jar</include>
</includes>
</fileSet>
<!-- 将第三方依赖打包到lib目录中 -->
<fileSet>
<directory>${basedir}/target/lib</directory>
<outputDirectory>lib</outputDirectory>
</fileSet>
<!-- 内置boot模块配置文件的外置 -->
<fileSet>
<directory>src/main/resources</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>**</include>
</includes>
</fileSet>
<!-- 程序的启动脚本 -->
<fileSet>
<directory>src/main/scripts</directory>
<includes>
<include>*.sh</include>
<include>*.bat</include>
</includes>
<outputDirectory>bin</outputDirectory>
<lineEnding>unix</lineEnding>
<fileMode>0755</fileMode>
</fileSet>
<!-- 多环境配置文件 -->
<fileSet>
<directory>src/main/profiles/${package.environment}</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>**</include>
</includes>
</fileSet>
</fileSets>
</assembly>
eureka:
client:
fetch-registry: false
register-with-eureka: false
logging:
config: config/logback.xml
server:
port: 8769
spring:
application:
name: eureka
eureka:
client:
fetch-registry: false
register-with-eureka: false
logging:
config: classpath:logback.xml
server:
port: 8769
spring:
application:
name: eureka
#!/bin/sh
PRG="$0"
APP_WRK_HOME=`dirname "$PRG"`/..
APP_WRK_HOME=`cd "$APP_WRK_HOME" && pwd`
sh $APP_WRK_HOME/bin/shutdown.sh
#!/bin/bash
# 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'; }
#启动脚本的主目录
PRG="$0"
APP_WRK_HOME=`dirname "$PRG"`/..
APP_WRK_HOME=`cd "$APP_WRK_HOME" && pwd`
#应用名
export APP_NAME=EUREKA-SERVER
psid=0
#检查进程ID
checkpid() {
if [[ -f $APP_WRK_HOME/bin/$APP_NAME.pid ]]; then
psid=$(cat $APP_WRK_HOME/bin/$APP_NAME.pid)
if [[ 0 -eq $(ps -ef |grep $psid |grep -v "grep" |wc -l) ]]; then
psid=0
fi
fi
}
#停止进程
dostop() {
checkpid
if [[ $psid -eq 0 ]]; then
echoYellow "warn: $APP_NAME pid was not found, can not be stopped!"
else
kill -9 $psid
rm -rf $APP_WRK_HOME/bin/$APP_NAME.pid
echoGreen "$APP_NAME stopped successfully! (pid=$psid)"
fi
}
dostop
exit 0
\ No newline at end of file
@echo off
@setlocal
REM set JUP SERVICE HOME
set "APP_WRK_HOME=%~dp0"
set "APP_WRK_HOME=%APP_WRK_HOME:~0,-4%"
set "APP_NAME=EUREKA-SERVER"
REM find boot jar file path
for %%i in (%APP_WRK_HOME%/*.jar) do set BOOT_JAR=%%i
set "JAVACMD=%JAVA_HOME%/bin/java.exe"
REM set "JAVA_OPTS=%JAVA_OPTS% -Xms512m -Xmx512m"
set "JAVA_OPTS=%JAVA_OPTS% -Dlogging.path=%APP_WRK_HOME%"
set "JAVA_OPTS=%JAVA_OPTS% -Dlogging.file=%APP_WRK_HOME%/logs/application.log"
rem the file skywalking-agent.jar is used at the link to track.
rem When deploying, please follow the actural situation to modify the path or version and modify the agent.config configuration file in agent/config.
rem Please refer to the configuration document to modify the contents of the configuration item collector.backend_service in agent.config
rem set "JAVA_OPTS=%JAVA_OPTS% -javaagent:d:/jup/services/JavaUnifiedPlatform_APM_Center_0.4-RELEASE/agent/skywalking-agent.jar"
rem set "JAVA_OPTS=%JAVA_OPTS% -DSW_AGENT_NAME=HK-BUSINESS"
set "JAVA_OPTS=%JAVA_OPTS% -server -Djava.net.preferIPv4Stack=true -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=GBK -Dfile.encoding=GBK"
set "JAVA_OPTS=%JAVA_OPTS% -XX:+HeapDumpOnOutOfMemoryError"
REM execute
start "%APP_NAME%" "%JAVACMD%" %JAVA_OPTS% -jar %BOOT_JAR%
\ No newline at end of file
#!/bin/bash
# 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'; }
#启动脚本的主目录
PRG="$0"
ENV="$1"
APP_WRK_HOME=`dirname "$PRG"`/..
APP_WRK_HOME=`cd "$APP_WRK_HOME" && pwd`
#应用名
export APP_NAME=EUREKA-SERVER
psid=0
#检查进程ID
checkpid() {
if [[ -f $APP_WRK_HOME/bin/$APP_NAME.pid ]]; then
psid=$(cat $APP_WRK_HOME/bin/$APP_NAME.pid)
if [[ -n $psid ]] && [[ 0 -eq $(ps -ef |grep $psid |grep -v "grep" |wc -l) ]]; then
psid=0
fi
fi
}
#启动进程
dostart() {
checkpid
if [[ $psid -ne 0 ]]; then
echoYellow "warn: $APP_NAME already started! (pid=$psid)"
else
export JAVA_OPTS="$JAVA_OPTS -Dlogging.path=$APP_WRK_HOME"
export JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=$ENV"
export JAVA_OPTS="$JAVA_OPTS -server -Djava.net.preferIPv4Stack=true -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom"
export JAVA_OPTS="$JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError"
export JAVA_OPTS="$JAVA_OPTS -Xms512m -Xmx2048m"
export JAVA_OPTS="$JAVA_OPTS -Dlogging.file=$APP_WRK_HOME/logs/application.log"
BOOT_JAR=`echo $APP_WRK_HOME/*.jar`
nohup java $JAVA_OPTS -jar $BOOT_JAR > /dev/null 2>&1 &
echo "$!" > $APP_WRK_HOME/bin/$APP_NAME.pid
sleep 2
checkpid
if [[ $psid -ne 0 ]]; then
echoGreen "$APP_NAME successful started! (pid=$psid)"
else
echoRed "$APP_NAME started failed!"
fi
fi
}
dostart
exit 0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment