Skip to content

Commit

Permalink
spring boot 3 migration (#2190)
Browse files Browse the repository at this point in the history
* Changed maven compiler to Java 17

Removed findbugs jsr305 dependency in favor of jetbrains annotations to prevent errors in javadoc creation

* Fix UnitTest

* Fix admin-server tests, formatting etc.

* Fix Nullable imports

* Set up JDK 17

* Introduce Spring Boot 3

* Introduce Spring Boot 3

* fix wiremock setup

* Add explicit eureka-client version
New Spring Cloud version for Spring Boot 3

* moved from node-sass to sass

* Change java version to 17 in github actions

* cleanup versions

* set java-version to 17 in release-to-maven-central.yml

* use nexus-staging-maven-plugin 1.6.12

* spring-boot-admin-sample-zookeeper deactivated (nexus-staging-maven-plugin fails)

* reactivated spring-boot-admin-sample-zookeeper

* replace developers in pom by codecentric generic part

* chore: update pipeline to use windows-latest

* updated nexus-staging-maven-plugin to 1.6.13

* fix: publish package step

* feat: merge new UI

* chore: update spring boot and spring cloud

* chore: fix errors in IDE

* chore: update Hazelcast and add shutdown to tests

* chore: ceckstyle

* chore: fix windows build

* chore: update spring boot to 3.0.0-M3

* chore: padding to the panel

* fix: base path of build may not start with leading slash for ressources

* fix: buttons do not show current selected logging level

* fix: toggle button for scope in caches view is shown, even when there is just one instance only

* chore: remove logging

* feat(AuditEvents): migrate to new UI

* chore: nicer panel

* fix: show user name in user menu when opened

* fix: visibility of services that are down, offline or oos

* fix: metadaten overflow

* fix: audit events error

* fix: debug email address

* fix: wallboard display glitch in Safari

* fix: application list version jumping

* fix: show error message on top of health details

* chore: run npm tests in test phase (allows to skip tests)

* fetchHealth: validateStatus: null

* chore(deps): update spring-cloud version

* feat: update spring boot to 3.0.0-M4

* chore: merge changes from master

* chore: merge origin/master

* fix: remove test data

* feat: add toasts and replace some modals

* chore: refactoring

* chore: remove sba-modal-conform dialog and refactoring

* fix: notification-filter-settings.vue

* fix: trailing slash in path is not allowed in spring boot 3 anymore

* chore: better UX for application actions

* feat: adds notification center which allows to manage existing notification settings

* chore: refactoring of navigation

* chore: toast theming

* chore: toast theming

* refactoring: composition api

* refactoring: notification filters

* chore: fix tests

* chore: mobile view

* refactoring: use composition API

* chore: split spring profiles into dedicated files as required by Spring Boot 3

* chore(#2122): check for ApiVersion.V3

* chore: separate buttons in application list item actions

* chore(#2122): check for ApiVersion.V3

* chore: set SNAPSHOT versions

* chore: add more informative error message to login screen

* chore: remove windows build to save resources

* chore: fix test

* chore: update workflow files

* chore: update to Spring Boot 3.0.0-RC1

* chore: fix checkstyle

* feat: implement different toast notification center

* chore: small adjustments on UI for better browser compatability

* feat: nicer docs :)

* chore: prettier & linter

* chore: adapt docs to Spring Boot 3

* chore: restructure readme and contribution guidlines

* chore: fix tests by adding some more

* * Path Matcher
* Security Config

* Added .DS_STORE to gitignore

* feat: WebSocketRegistrator

* chore: adapt RC2 changes

* Fixed import order

* Remove "Fixe" :D

* WIP - Partially Fixed NavbarLink spec.

* chore: update to Spring Boot 3.0.0 GA

* do not authorize requests that get dispatched async

With spring-projects/spring-security#11107
the default to filter all dispatcher types was changed to true.

* Removed deprecated passwordEncoder

* formatting for security config

* chore: fix user menu

* chore: work on login page

* feat: improve notifiers

* Refactored redundant loading of login settings

* formatter fix

* chore: do not wrap tags to achieve a nicer ui result

* chore: log error when configuring view

* chore: zwischenstand

* chore: useApplicationStore should not reset refs

* pin old version of versions plugin as new version does not work in release

* fix group id for plugin

* add issue as reference

* update spring cloud version

* chore: set release version of spring cloud

* chore: add tests for useApplicationStore

* chore: porting config for toasts

* chore: fix test in store.spec.js

* chore: show error in wallboard, too, when server connection is lost

* normalize homepage url

with spring framework 6 the pattern matching does not match trailing
slashes by default, so forwarding did not work when running with context
path and reloading the page

fixes #2175

* do not normalize path to empty string

* #2175: Normalized homepage url for serlvet variant

* #2175: Generalized normalizing of homepage url + unittest

* #2175: Generalized normalizing of homepage url + unittest

* #2175: Generalized normalizing of homepage url + unittest

* #2183: Fixed urls on about page

* #2185: Added new view for Spring Boot 3 Actuator HttpExchanges (#2186)

* #2185: Added new view for Spring Boot 3 Actuator HttpExchanges

* #2185: Removed view for httptrace since it has been replaced by httpexchange in spring boot 3 actuator

* Revert "#2185: Removed view for httptrace since it has been replaced by httpexchange in spring boot 3 actuator"

This reverts commit 1dd95c8.

* #2185: Revoked deletion of httptrace mock-data since it might still be used in 2.x appplications with sba 3.x

* chore: update spring boot to 3.0.1

* support comma-separated tag values (#2179)

(cherry picked from commit b9dc801)

* add javadoc

* fix formatting

* clean up pom

* remove Jolokia actuator, is not supported by Spring Boot 3

* do not set junit version manually

Co-authored-by: ulrichschulte <ulrich.schulte@codecentric.de>
Co-authored-by: Andreas Fritz <mail@andreasfritz.de>
Co-authored-by: Stephan Köninger <stephan.koeninger@codecentric.de>
Co-authored-by: Stephan Köninger <github@stekoe.de>
Co-authored-by: Fedor Bobin <fuudtorrentsru@gmail.com>
  • Loading branch information
6 people committed Jan 6, 2023
1 parent b9dc801 commit 0705d47
Show file tree
Hide file tree
Showing 670 changed files with 59,656 additions and 74,797 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ij_java_blank_lines_after_class_header = 0
ij_java_doc_enable_formatting = false
ij_java_class_count_to_use_import_on_demand = 100
ij_java_names_count_to_use_import_on_demand = 100
ij_java_imports_layout = |,java.**,|,javax.**,|,*,|,de.codecentric.boot.admin.**,|,$*
ij_java_imports_layout = |,java.**,|,jakarta.**,|,*,|,de.codecentric.boot.admin.**,|,$*
ij_java_layout_static_imports_separately = true

[*.xml]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:

- uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
distribution: 'adopt'
java-version: '17'

- name: Cache local Maven repository
uses: actions/cache@v3.0.11
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:

- uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
distribution: 'adopt'
java-version: '17'

- name: Cache local Maven repository
uses: actions/cache@v3.0.11
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:

- uses: actions/checkout@v3

- name: Set up JDK 8
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
distribution: 'adopt'
java-version: '17'

- name: Cache local Maven repository
uses: actions/cache@v3.0.11
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/release-to-maven-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
- name: Set up settings.xml for Maven Central Repository
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
distribution: 'adopt'
java-version: '17'
server-id: oss.sonatype.org
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
Expand Down Expand Up @@ -55,6 +55,8 @@ jobs:
- name: Publish package
run: mvn --batch-mode clean deploy --no-transfer-progress -P central-deploy -DskipTests=true
env:
#TODO: This is a workaround for NEXUS-27902 which uses XStream that fails on JVM >16
JDK_JAVA_OPTIONS: "--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED"
MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ node/

#flattened POMs
.flattened-pom.xml

.DS_Store
33 changes: 11 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Contributing to Spring Boot Admin

Contributions are highly welcome. Feel free to submit Pull Requests. Maybe watch out for tickets tagged with `ideal-for-contribution`, these tickets should always be a good starting point for contributing.

You can find some hints for starting development in the [README](spring-boot-admin-server-ui/README.md) of `spring-boot-admin-server-ui`.
Expand All @@ -10,43 +9,33 @@ We try to satisfy the [Code Style of Spring Framework](https://github.com/spring

The [Spring Java Format Plugin](https://github.com/spring-io/spring-javaformat) is added to the build. Checkstyle will enforce the consistency of the code. Nevertheless there are some disabled rules, due to backward compatibility. You can find these disabled rules in a comment in `src/checkstyle/checkstyle.xml`.

Otherwise you can always run `mvn spring-javaformat:apply` to fix some basic errors, like indentation.
However, you can always run `mvn spring-javaformat:apply` to fix some basic errors, like indentation.

### JavaScript / Client
tbd
The Vue frontend implements basic prettier rules as well as Vue3 recommended rules.
To check if there are any violations run `npm run lint` and `npm run format`.
Append `:fix` to let eslint or prettier auto-solve most issues.

## Working with the code

### Importing into IntelliJ

### IntelliJ
The IntelliJ settings are based on the IntelliJ-IDEA-Editor-Settings from spring, but have been adapted slightly, you can find the original settings [here](https://github.com/spring-projects/spring-framework/wiki/IntelliJ-IDEA-Editor-Settings).

The custom settings are stored in `.editorconfig` and are imported automatically by IntelliJ.

If you are using IntelliJ, there is also a [formatter-plugin provided by Spring](https://github.com/spring-io/spring-javaformat#intellij-idea).

(i) Plugin version x didn't not work in IntelliJ IDEA Ultimate 2020.3.


#### Checkstyle Plugin

This plugin scans Java files with the project's custom CheckStyle rules from within IDEA.

Install and configure the Checkstyle Plugin, and enable the configuration file.

##### Configuration
Before the configuration file is configured, add the `spring-javaformat-checkstyle` JAR to the Third-Party Checks.
Before configuration, add the `spring-javaformat-checkstyle` JAR to the Third-Party checks.
1. Preferences > Tools > Checkstyle > Third-Party Checks
2. Add `~/.m2/repository/io/spring/javaformat/spring-javaformat-checkstyle/0.0.26/spring-javaformat-checkstyle-0.0.26.jar`
1. Add `~/.m2/repository/io/spring/javaformat/spring-javaformat-checkstyle/0.0.26/spring-javaformat-checkstyle-0.0.26.jar`

##### Configuration File
Add the configuration file and enabled it:
1. Preferences > Tools > Checkstyle > Configuration File > +
2. Add a Name, ex. Spring Boot Admin
3. Use a local Checkstyle File, Browse to `src/checkstyle/checkstyle.xml` and click Next
4. Enter the full path to the checkstyle header file: `<git repo>/src/checkstyle/checkstyle-header.txt`, click Finish
5. Select the new configuration file to enable it

### Importing into Eclipse

TODO
1. Add a Name, ex. Spring Boot Admin
1. Use a local Checkstyle File, Browse to `src/checkstyle/checkstyle.xml` and click Next
1. Enter the full path to the checkstyle header file: `<git repo>/src/checkstyle/checkstyle-header.txt`, click Finish
1. Select the new configuration file to enable it
106 changes: 14 additions & 92 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,25 @@
codecentric's Spring Boot Admin
===============================
# Spring Boot Admin by [codecentric](https://codecentric.de)
[![Apache License 2](https://img.shields.io/badge/license-ASF2-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt)
![Build Status](https://github.com/codecentric/spring-boot-admin/actions/workflows/build-main.yml/badge.svg?branch=master)
[![codecov](https://codecov.io/gh/codecentric/spring-boot-admin/branch/master/graph/badge.svg?token=u5SWsZpj5S)](https://codecov.io/gh/codecentric/spring-boot-admin)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.codecentric/spring-boot-admin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.codecentric/spring-boot-admin/)
[![Gitter](https://badges.gitter.im/codecentric/spring-boot-admin.svg)](https://gitter.im/codecentric/spring-boot-admin?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

![](./images/logo-spring-boot-admin.png)

This community project provides an admin interface for [Spring Boot <sup>®</sup>](http://projects.spring.io/spring-boot/ "Official Spring-Boot website") applications.
This community project provides an admin interface for [Spring Boot <sup>®</sup>](http://projects.spring.io/spring-boot/ "Official Spring-Boot website") web applications that expose actuator endpoints.

Monitoring Python applications is available using [Pyctuator](https://github.com/SolarEdgeTech/pyctuator).

Spring Boot Admin provides the following features for registered applications:

* Show health status
* Show details, like
* JVM & memory metrics
* micrometer.io metrics
* Datasource metrics
* Cache metrics
* Show build-info number
* Follow and download logfile
* View jvm system- & environment-properties
* View Spring Boot Configuration Properties
* Support for Spring Cloud's postable /env- &/refresh-endpoint
* Easy loglevel management
* Interact with JMX-beans
* View thread dump
* View http-traces
* View auditevents
* View http-endpoints
* View scheduled tasks
* View and delete active sessions (using spring-session)
* View Flyway / Liquibase database migrations
* Download heapdump
* Notification on status change (via e-mail, Slack, Hipchat, ...)
* Event journal of status changes (non persistent)
## Compatibility Matrix
Spring Boot Admin's version matches the major and minor versions of Spring Boot.

| Spring Boot Service | Spring Boot Admin |
|---------------------|--------------------|
| 2.6 | 2.6.Y |
| 2.7 | 2.7.Y |
| 3.0 | 3.0.Y |

Nevertheless, it is possible to monitor any version of a Spring Boot service independently of the underlying Spring Boot version in the service.
Hence, it is possible to run Spring Boot Admin Server version 2.6 and monitor a service that is running on Spring Boot 2.3 using Spring Boot Admin Client version 2.3.

## Getting Started

Expand All @@ -56,18 +39,6 @@ alt="Monitoring Spring Boot® Applications with Spring Boot Admin @ Spring I/O 2
alt="Spring Boot® Admin - Monitoring and Configuring Spring Boot Applications at Runtime" width="240" height="135" border="10" /></a><br>
**Spring Boot® Admin - Monitoring and Configuring Spring Boot Applications at Runtime**

## Compatibility Matrix
Spring Boot Admin's version matches the major and minor versions of Spring Boot:

* SBA 2.0.X -> Spring Boot 2.0.Y
* SBA 2.1.X -> Spring Boot 2.1.Y
* SBA 2.2.X -> Spring Boot 2.2.Y

etc. pp.

Nevertheless, it is possible to monitor any version of a Spring Boot service independently of the underlying Spring Boot version in the service.
Hence, it is possible to run Spring Boot Admin Server version 2.6 and monitor a service that is running on Spring Boot 2.3 using Spring Boot Admin Client version 2.3.

## Getting Help

Having trouble with codecentric's Spring Boot Admin? We’d like to help!
Expand All @@ -81,13 +52,7 @@ Having trouble with codecentric's Spring Boot Admin? We’d like to help!
* Report bugs at http://github.com/codecentric/spring-boot-admin/issues.

## Reference Guide
[Version 2.6.6](http://codecentric.github.io/spring-boot-admin/2.6.6/)

[Version 2.5.6](http://codecentric.github.io/spring-boot-admin/2.5.6/)

[Version 1.5.7](http://codecentric.github.io/spring-boot-admin/1.5.7/)

**Translated version**
### Translated versions
The following reference guides have been translated by users of Spring Boot Admin and are not part of the official bundle.
The maintainers of Spring Boot Admin will not update and maintain the guides mentioned below.

Expand All @@ -114,48 +79,5 @@ You can access snapshot builds from the sonatype snapshot repository by adding t
</repository>
```

## Screenshots

![Screenshot application list](/images/screenshot.png)
*Dashboard with desktop notifications*

![Screenshot details](/images/screenshot-details.png)
*View application health, info and details*

![Screenshot metrics](/images/screenshot-metrics.png)
*View metric counters and gauges*

![Screenshot logfile](/images/screenshot-logfile.png)
*View logfile (with follow)*

![Screenshot environment](/images/screenshot-environment.png)
*View and change Spring environment (via Spring Cloud)*

![Screenshot logging](/images/screenshot-logging.png)
*Manage Logback logger levels*

![Screenshot jmx](/images/screenshot-jmx.png)
*View and use JMX beans via jolokia*

![Screenshot threads](/images/screenshot-threads.png)
*View thread dump*

![Screenshot traces](/images/screenshot-trace.png)
*View http request traces*

![Screenshot journal](/images/screenshot-journal.png)
*View history of registered applications*

## Build
**Requirements:**

* JDK >= 1.8

Please make sure you set `$JAVA_HOME` points to the correct JDK.

```shell
./mvnw clean package
```

## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) file.
43 changes: 25 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
<description>Spring Boot Admin</description>
<url>https://github.com/codecentric/spring-boot-admin/</url>
<properties>
<revision>2.7.7-SNAPSHOT</revision>
<java.version>1.8</java.version>
<revision>3.0.0-SNAPSHOT</revision>
<java.version>17</java.version>

<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
Expand All @@ -36,19 +36,22 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<!-- used dependencies versions -->
<spring-boot.version>2.7.5</spring-boot.version>
<spring-cloud.version>2021.0.4</spring-cloud.version>
<spring-boot.version>3.0.1</spring-boot.version>
<spring-cloud.version>2022.0.0</spring-cloud.version>
<wiremock.version>2.34.0</wiremock.version>
<hazelcast-tests.version>5.1.3</hazelcast-tests.version>
<findbugs-jsr305.version>3.0.2</findbugs-jsr305.version>
<awaitility.version>4.2.0</awaitility.version>
<testcontainers.version>1.17.5</testcontainers.version>
<eureka-client.version>3.1.1</eureka-client.version>
<!-- Wiremock does not yet support jetty 11 (see also https://github.com/wiremock/wiremock/issues/1760). -->
<!--<jetty.version>11.0.6</jetty.version>-->
<jetty.version>9.4.49.v20220914</jetty.version>


<!-- plugin versions -->
<build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version>
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
<versions-maven-plugin.version>2.13.0</versions-maven-plugin.version> <!-- because of https://github.com/mojohaus/versions/issues/855 -->
<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
<maven-site-plugin.version>3.12.1</maven-site-plugin.version>
<maven-dependency-plugin.version>3.3.0</maven-dependency-plugin.version>
Expand Down Expand Up @@ -103,19 +106,9 @@
</scm>
<developers>
<developer>
<name>Johannes Edmeier</name>
<email>johannes.edmeier@codecentric.de</email>
<organization>codecentric AG</organization>
</developer>
<developer>
<name>Thomas Bosch</name>
<email>thomas.bosch@codecentric.de</email>
<organization>codecentric AG</organization>
</developer>
<developer>
<name>Dennis Schulte</name>
<email>dennis.schulte@codecentric.de</email>
<organization>codecentric AG</organization>
<name>codecentric AG</name>
<email>spring-boot-admin@codecentric.de</email>
<url>https://www.codecentric.de/</url>
</developer>
</developers>
<build>
Expand Down Expand Up @@ -245,6 +238,11 @@
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down Expand Up @@ -518,6 +516,15 @@
</snapshots>
<url>https://repo.spring.io/snapshot</url>
</repository>
<!-- Required for Eureka RC -->
<repository>
<id>netflix-candidates</id>
<name>Netflix Candidates</name>
<url>https://artifactory-oss.prod.netflix.net/artifactory/maven-oss-candidates</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
Expand Down
5 changes: 0 additions & 5 deletions spring-boot-admin-build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
<artifactId>wiremock-jre8-standalone</artifactId>
<version>${wiremock.version}</version>
</dependency>
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8</artifactId>
<version>${wiremock.version}</version>
</dependency>
<dependency>
<groupId>com.hazelcast</groupId>
<artifactId>hazelcast</artifactId>
Expand Down
5 changes: 1 addition & 4 deletions spring-boot-admin-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
Expand All @@ -82,6 +78,7 @@
<dependency>
<groupId>com.github.tomakehurst</groupId>
<artifactId>wiremock-jre8-standalone</artifactId>
<version>${wiremock.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down

0 comments on commit 0705d47

Please sign in to comment.