Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
# FORKED REPOSITORY

This fork was made to create a version compatible with Spring Boot 4 but using Jackson 2.
This is required because the mere presence of Jackson 3 on the classpath can trigger autoconfiguration or feature detection
in some parts of Spring/Spring Boot.
While we can decorrelate the upgrade to Spring Boot 4 from the upgrade to Jackson 3, to Apps are encouraged to migrate to Jackson 3 soon.

Deploy to our Maven repo with `mvn deploy -DaltDeploymentRepository=<repoId_from_settings.xml>::default::<repoUrl> (-DskipTests)`.

We won't maintain this fork for longer than necessary for internal use and support only our internal use cases.

# 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)
Expand Down
42 changes: 21 additions & 21 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<url>https://github.com/codecentric/spring-boot-admin/</url>

<properties>
<revision>4.1.0-SNAPSHOT</revision>
<revision>4.1.0-jackson2</revision>

<java.version>17</java.version>
<node.version>v22.12.0</node.version>
Expand Down Expand Up @@ -161,26 +161,26 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>src/checkstyle/checkstyle.xml</configLocation>
<headerLocation>src/checkstyle/checkstyle-header.txt</headerLocation>
<consoleOutput>true</consoleOutput>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<executions>
<execution>
<id>checkstyle-validation</id>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- <plugin>-->
<!-- <groupId>org.apache.maven.plugins</groupId>-->
<!-- <artifactId>maven-checkstyle-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <configLocation>src/checkstyle/checkstyle.xml</configLocation>-->
<!-- <headerLocation>src/checkstyle/checkstyle-header.txt</headerLocation>-->
<!-- <consoleOutput>true</consoleOutput>-->
<!-- <failOnViolation>true</failOnViolation>-->
<!-- <includeTestSourceDirectory>true</includeTestSourceDirectory>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>checkstyle-validation</id>-->
<!-- <phase>validate</phase>-->
<!-- <goals>-->
<!-- <goal>check</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
<plugin>
<!-- this fix is needed for the eclipse-plugin to get the right java-version -->
<groupId>org.apache.maven.plugins</groupId>
Expand Down
54 changes: 53 additions & 1 deletion spring-boot-admin-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-restclient</artifactId>
<artifactId>spring-boot-restclient</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -53,7 +53,19 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webmvc</artifactId>
<optional>true</optional>
<exclusions>
<exclusion>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-jackson2</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure-processor</artifactId>
Expand Down Expand Up @@ -85,4 +97,44 @@
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>${maven-enforcer-plugin.version}</version>
<executions>
<execution>
<id>enforce-maven</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireMavenVersion>
<version>3.2.5</version>
</requireMavenVersion>
</rules>
</configuration>
</execution>
<execution>
<id>ban-jackson3</id>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>tools.jackson.core:*</exclude>
</excludes>
</bannedDependencies>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@
import org.springframework.core.env.Environment;
import org.springframework.http.client.support.BasicAuthenticationInterceptor;
import org.springframework.http.converter.json.JacksonJsonHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestClient;
import tools.jackson.databind.json.JsonMapper;

import com.fasterxml.jackson.databind.ObjectMapper;

import de.codecentric.boot.admin.client.registration.ApplicationFactory;
import de.codecentric.boot.admin.client.registration.ApplicationRegistrator;
Expand Down Expand Up @@ -137,7 +139,7 @@ public static class RestClientRegistrationClientConfig {
@Bean
@ConditionalOnMissingBean
public RegistrationClient registrationClient(ClientProperties client, RestClient.Builder restClientBuilder,
ObjectProvider<JsonMapper> objectMapper) {
ObjectProvider<ObjectMapper> objectMapper) {
var factorySettings = HttpClientSettings.defaults()
.withConnectTimeout(client.getConnectTimeout())
.withReadTimeout(client.getReadTimeout());
Expand All @@ -148,7 +150,7 @@ public RegistrationClient registrationClient(ClientProperties client, RestClient

objectMapper.ifAvailable((mapper) -> restClientBuilder.messageConverters((configurer) -> {
configurer.removeIf(JacksonJsonHttpMessageConverter.class::isInstance);
configurer.add(new JacksonJsonHttpMessageConverter(mapper));
configurer.add(new MappingJackson2HttpMessageConverter(mapper));
}));

if (client.getUsername() != null && client.getPassword() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void test_context() throws InterruptedException, UnknownHostException {

@Test
public void test_context_with_snake_case() throws InterruptedException, UnknownHostException {
setUpApplicationContext("--spring.jackson.property-naming-strategy=SNAKE_CASE");
setUpApplicationContext("--spring.jackson2.property-naming-strategy=SNAKE_CASE");

String hostName = InetAddress.getLocalHost().getCanonicalHostName();
String serviceHost = "http://" + hostName + ":" + getServerPort();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-jackson2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-jackson2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-jackson2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Loading