From 306f5d286940c4e3614471d419ef6685bf2dc85b Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Thu, 3 Dec 2020 15:43:08 +0100 Subject: [PATCH] Enable spring boot actuator and spring admin registration --- pluto-server/pom.xml | 29 +++++++++++++++++-- .../src/main/resources/application-local.yml | 11 +++++++ .../src/main/resources/application-oc.yml | 10 ++++--- .../src/main/resources/application.yml | 10 +++++++ pluto-server/src/main/resources/banner.txt | 5 ++++ 5 files changed, 58 insertions(+), 7 deletions(-) create mode 100644 pluto-server/src/main/resources/banner.txt diff --git a/pluto-server/pom.xml b/pluto-server/pom.xml index e6b53aedb..7bc69203b 100644 --- a/pluto-server/pom.xml +++ b/pluto-server/pom.xml @@ -3,14 +3,14 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - + <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.4.0</version> <relativePath /> <!-- lookup parent from repository --> </parent> - + <groupId>de.itvsh.ozg.pluto</groupId> <artifactId>pluto-server</artifactId> <version>0.0.1-SNAPSHOT</version> @@ -26,6 +26,7 @@ <mapstruct.version>1.4.1.Final</mapstruct.version> <lorem.version>2.1</lorem.version> <faker.version>1.0.2</faker.version> + <spring-admin.version>2.3.1</spring-admin.version> </properties> <dependencies> @@ -39,6 +40,20 @@ <artifactId>grpc-server-spring-boot-starter</artifactId> <version>${grpc.spring-boot-starter.version}</version> </dependency> + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-web</artifactId> + </dependency> + + <dependency> + <groupId>org.springframework.boot</groupId> + <artifactId>spring-boot-starter-actuator</artifactId> + </dependency> + <dependency> + <groupId>de.codecentric</groupId> + <artifactId>spring-boot-admin-starter-client</artifactId> + <version>${spring-admin.version}</version> + </dependency> <!-- own projects --> <dependency> @@ -117,8 +132,16 @@ <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> + <executions> + <execution> + <id>build info</id> + <goals> + <goal>build-info</goal> + </goals> + </execution> + </executions> </plugin> - + <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> diff --git a/pluto-server/src/main/resources/application-local.yml b/pluto-server/src/main/resources/application-local.yml index e69de29bb..d4988f25f 100644 --- a/pluto-server/src/main/resources/application-local.yml +++ b/pluto-server/src/main/resources/application-local.yml @@ -0,0 +1,11 @@ +server: + port: 8085 + +spring: + boot: + admin: + client: + instance: + prefer-ip: true + url: http://localhost:8090 + \ No newline at end of file diff --git a/pluto-server/src/main/resources/application-oc.yml b/pluto-server/src/main/resources/application-oc.yml index 21b95724c..026db0b9e 100644 --- a/pluto-server/src/main/resources/application-oc.yml +++ b/pluto-server/src/main/resources/application-oc.yml @@ -1,7 +1,9 @@ spring: + boot: + admin: + client: + instance: + prefer-ip: true data: mongodb: - host: 172.30.190.222 - authentication-database: admin - username: root - password: ldsjfa0avjklz \ No newline at end of file + host: 172.30.190.222 \ No newline at end of file diff --git a/pluto-server/src/main/resources/application.yml b/pluto-server/src/main/resources/application.yml index 8b1378917..7a03126c6 100644 --- a/pluto-server/src/main/resources/application.yml +++ b/pluto-server/src/main/resources/application.yml @@ -1 +1,11 @@ +logging: + level: + ROOT: WARN + de.itvsh: INFO +spring: + application: + name: Pluto + data: + mongodb: + authentication-database: admin diff --git a/pluto-server/src/main/resources/banner.txt b/pluto-server/src/main/resources/banner.txt new file mode 100644 index 000000000..1df2e8adf --- /dev/null +++ b/pluto-server/src/main/resources/banner.txt @@ -0,0 +1,5 @@ + ___ _ _ _ _____ ___ +| _ \| | | | | ||_ _| / _ \ +| _/| |__ | |_| | | | | (_) | +|_| |____| \___/ |_| \___/ +${spring-boot.version} ${application.version} \ No newline at end of file -- GitLab