Commit 68b4835c by chenzy

【新增】第一次初始化

parents
<?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>
<artifactId>login</artifactId>
<groupId>com.keymobile.syncdata</groupId>
<version>product-v2-rc1</version>
<packaging>jar</packaging>
<parent>
<groupId>com.keymobile</groupId>
<artifactId>parent</artifactId>
<version>product-v1-1.0.4-rc1</version>
</parent>
<dependencies>
</dependencies>
<build>
<finalName>syncdata</finalName>
<resources>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>bootstrap.yml</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/assembly/server-dist.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>create-assemblies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
#!/bin/bash
BASE_LOC="$(dirname "${ABS_SCRIPT_PATH}")"
APP_NAME="syncdata"
TEMP_DIR="-Djava.io.tmpdir=/tmp"
PROFILE="default"
CONFIG_URL="http://c0:8082"
JVM_OPTS="-Xmx64M -Xms64M"
JAVA_OPTS="-server $JVM_OPTS -XX:+UseCompressedOops -XX:+UseG1GC"
SPRING_OPTS="--spring.cloud.config.uri=$CONFIG_URL --spring.profiles.active=$PROFILE --logging.config=$BASE_LOC/config/logback-custom.xml"
JAR_NAME="$APP_NAME.jar"
nohup java $JAVA_OPTS $TEMP_DIR -jar $BASE_LOC/lib/$JAR_NAME $SPRING_OPTS 2>&1 > $BASE_LOC/console.log &
echo "$JAR_NAME started."
<assembly>
<id>dist</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}/src/assembly/bin</directory>
<outputDirectory>bin</outputDirectory>
<includes>
<include>**/*.sh</include>
</includes>
<fileMode>755</fileMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/src/main/resources</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>**/*.xml</include>
</includes>
<fileMode>755</fileMode>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>lib</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
<fileMode>755</fileMode>
</fileSet>
</fileSets>
</assembly>
\ No newline at end of file
package com.keymobile.syncdata;
import com.keymobile.authservice.component.SecurityConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.context.annotation.PropertySource;
@SpringBootApplication
@EnableDiscoveryClient
@ComponentScan(basePackages = {"com.keymobile.syncdata"}, excludeFilters = {
@ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value= SecurityConfig.class)
})
@PropertySource(value = "classpath:/application.yml")
public class SyncDataApplication {
public static void main(String[] args) {
SpringApplication.run(SyncDataApplication.class, args);
}
}
spring:
session:
redis:
namespace: default
data:
redis:
host: redis0
port: 6379
password: password0
datasource:
hikari:
maximum-pool-size: 5
url: jdbc:mysql://mysql0:3306/d0?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useSsl=false
username: user0
password: password0
eureka:
client:
registryFetchIntervalSeconds: 5
region: default
serviceUrl:
defaultZone: http://e0:8081/eureka/
enabled: true
\ No newline at end of file
server:
port: 8765
spring:
application:
name: syncData
cloud:
openfeign:
httpclient:
connection-timeout: 1000
ok-http:
read-timeout: 5000
profiles:
active: local
management:
metrics:
tags:
application: ${spring.application.name}
endpoints:
health:
show-details: always
web:
exposure:
include: prometheus
logging:
level:
root: info
config: classpath:logback-custom.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<springProperty name="redis.host" source="spring.data.redis.host"/>
<springProperty name="redis.port" source="spring.data.redis.port"/>
<springProperty name="redis.password" source="spring.data.redis.password"/>
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %X{user} %X{session} %-5level %logger{5} - %msg%n</pattern>
</encoder>
</appender>
<appender name="logstash" class="com.keymobile.config.logging.RedisAppender">
<host>${redis.host}</host>
<port>${redis.port}</port>
<password>${redis.password}</password>
<key>logstash</key>
<additionalField>
<key>user</key>
<value>@{user}</value>
</additionalField>
<additionalField>
<key>session</key>
<value>@{session}</value>
</additionalField>
</appender>
<root level="INFO">
<appender-ref ref="stdout" />
</root>
</configuration>
\ 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