diff --git a/README.md b/README.md
index 427c650..eb30ca6 100644
--- a/README.md
+++ b/README.md
@@ -36,9 +36,10 @@ It also served as a key to activate the switch that opens the Bifrost Bridge.
## Compatibility
-| Version | SpringBoot Version |
-|:---------:|:---------------------------------------:|
-| **0.X.0** | from **2.2.0** (including 3.0.0 and up) |
+| Version | SpringBoot Version | Java Version |
+|:----------------------:|:---------------------------:|:------------------:|
+| **2.X.X** | from **3.3.0** | 17 (hofund-core 8) |
+| **1.0.X (deprecated)** | from **2.2.0** to **3.2.X** | 8 |
## Requirements
diff --git a/changelog/unreleased/000001-sping-boot-3_3.yml b/changelog/unreleased/000001-sping-boot-3_3.yml
new file mode 100644
index 0000000..996e5b4
--- /dev/null
+++ b/changelog/unreleased/000001-sping-boot-3_3.yml
@@ -0,0 +1,8 @@
+title: Adjust project for Spring Boot 3.3 and Java 17. Hofund-Core still is based on Java 8.
+authors:
+ - name: Peter Zmilczak
+ nick: marwin1991
+ url: https://github.com/marwin1991
+type: changed #[added/changed/deprecated/removed/fixed/security/other]
+merge_requests:
+ - 33
\ No newline at end of file
diff --git a/hofund-core/pom.xml b/hofund-core/pom.xml
index 34dda32..f20c293 100644
--- a/hofund-core/pom.xml
+++ b/hofund-core/pom.xml
@@ -5,28 +5,30 @@
dev.logchange.hofund
hofund
- 1.1.0-SNAPSHOT
+ 2.0.0-SNAPSHOT
hofund-core
jar
- TODO
+ Core hofund classes allowing to publish prometheus metrics
+
+ 1.8
+ 1.8
+
+
io.micrometer
micrometer-core
- ${micrometer-io.version}
- provided
org.slf4j
slf4j-api
- ${slf4j.version}
diff --git a/hofund-core/src/main/java/dev/logchange/hofund/connection/AbstractHofundBasicHttpConnection.java b/hofund-core/src/main/java/dev/logchange/hofund/connection/AbstractHofundBasicHttpConnection.java
index 4a2af83..ed78989 100644
--- a/hofund-core/src/main/java/dev/logchange/hofund/connection/AbstractHofundBasicHttpConnection.java
+++ b/hofund-core/src/main/java/dev/logchange/hofund/connection/AbstractHofundBasicHttpConnection.java
@@ -75,10 +75,10 @@ public HofundConnection toHofundConnection() {
private StatusFunction testConnection() {
return () -> {
try {
- log.debug("Testing http connection to: " + getTarget() + " url: " + getUrl());
+ log.debug("Testing http connection to: {} url: {}", getTarget(), getUrl());
if (getCheckingStatus() == CheckingStatus.INACTIVE) {
- log.debug("Skipping checking connection to: " + getTarget() + " due to inactive status checking");
+ log.debug("Skipping checking connection to: {} due to inactive status checking", getTarget());
return Status.INACTIVE;
}
@@ -88,16 +88,16 @@ private StatusFunction testConnection() {
urlConn.connect();
int responseCode = urlConn.getResponseCode();
- log.debug("Connection to url: " + getUrl() + " status code: " + responseCode);
+ log.debug("Connection to url: {} status code: {}", getUrl(), responseCode);
if (responseCode >= 100 && responseCode < 400) {
return Status.UP;
} else {
- log.warn("Error testing connection to: " + getUrl() + " finished with status code: " + responseCode);
+ log.warn("Error testing connection to: {} finished with status code: {}", getUrl(), responseCode);
return Status.DOWN;
}
} catch (IOException e) {
- log.warn("Error testing connection to: " + getUrl() + " msg: " + e.getMessage());
+ log.warn("Error testing connection to: {} msg: {}", getUrl(), e.getMessage());
log.debug("Exception: ", e);
return Status.DOWN;
}
diff --git a/hofund-core/src/main/java/dev/logchange/hofund/connection/HofundConnectionMeter.java b/hofund-core/src/main/java/dev/logchange/hofund/connection/HofundConnectionMeter.java
index 0a8c158..fb26cc2 100644
--- a/hofund-core/src/main/java/dev/logchange/hofund/connection/HofundConnectionMeter.java
+++ b/hofund-core/src/main/java/dev/logchange/hofund/connection/HofundConnectionMeter.java
@@ -13,7 +13,7 @@
public class HofundConnectionMeter implements MeterBinder {
- private static final String NAME = "hofund_connection";
+ private static final String NAME = "hofund.connection";
private static final String DESCRIPTION = "Current status of given connection";
private final HofundInfoProvider infoProvider;
diff --git a/hofund-core/src/main/java/dev/logchange/hofund/git/HofundGitInfoMeter.java b/hofund-core/src/main/java/dev/logchange/hofund/git/HofundGitInfoMeter.java
index 75d26fc..7fa1f8e 100644
--- a/hofund-core/src/main/java/dev/logchange/hofund/git/HofundGitInfoMeter.java
+++ b/hofund-core/src/main/java/dev/logchange/hofund/git/HofundGitInfoMeter.java
@@ -11,7 +11,7 @@
public class HofundGitInfoMeter implements MeterBinder {
- private static final String NAME = "hofund_git_info";
+ private static final String NAME = "hofund.git.info";
private static final String DESCRIPTION = "Basic information about application based on git";
private final HofundGitInfoProvider provider;
diff --git a/hofund-core/src/main/java/dev/logchange/hofund/graph/edge/HofundEdgeMeter.java b/hofund-core/src/main/java/dev/logchange/hofund/graph/edge/HofundEdgeMeter.java
index b95c676..8860b92 100644
--- a/hofund-core/src/main/java/dev/logchange/hofund/graph/edge/HofundEdgeMeter.java
+++ b/hofund-core/src/main/java/dev/logchange/hofund/graph/edge/HofundEdgeMeter.java
@@ -18,7 +18,7 @@
*/
public class HofundEdgeMeter implements MeterBinder {
- private static final String NAME = "hofund_edge";
+ private static final String NAME = "hofund.edge";
private static final String DESCRIPTION = "Information about hofund edge, value is always 1.0, to check status use hofund_connection";
private final HofundInfoProvider infoProvider;
diff --git a/hofund-core/src/main/java/dev/logchange/hofund/graph/node/HofundNodeMeter.java b/hofund-core/src/main/java/dev/logchange/hofund/graph/node/HofundNodeMeter.java
index 8d61362..3188440 100644
--- a/hofund-core/src/main/java/dev/logchange/hofund/graph/node/HofundNodeMeter.java
+++ b/hofund-core/src/main/java/dev/logchange/hofund/graph/node/HofundNodeMeter.java
@@ -20,7 +20,7 @@
*/
public class HofundNodeMeter implements MeterBinder {
- private static final String NAME = "hofund_node";
+ private static final String NAME = "hofund.node";
private static final String DESCRIPTION = "Information about hofund nodes, value is always 1.0, to check status use hofund_info";
private final HofundInfoProvider infoProvider;
diff --git a/hofund-core/src/main/java/dev/logchange/hofund/info/HofundInfoMeter.java b/hofund-core/src/main/java/dev/logchange/hofund/info/HofundInfoMeter.java
index 7616235..bfd9c9e 100644
--- a/hofund-core/src/main/java/dev/logchange/hofund/info/HofundInfoMeter.java
+++ b/hofund-core/src/main/java/dev/logchange/hofund/info/HofundInfoMeter.java
@@ -11,7 +11,7 @@
public class HofundInfoMeter implements MeterBinder {
- private static final String NAME = "hofund_info";
+ private static final String NAME = "hofund.info";
private static final String DESCRIPTION = "Basic information about application";
private final HofundInfoProvider provider;
diff --git a/hofund-core/src/main/java/dev/logchange/hofund/java/HofundJavaInfoMeter.java b/hofund-core/src/main/java/dev/logchange/hofund/java/HofundJavaInfoMeter.java
index 95d11bc..91c46e1 100644
--- a/hofund-core/src/main/java/dev/logchange/hofund/java/HofundJavaInfoMeter.java
+++ b/hofund-core/src/main/java/dev/logchange/hofund/java/HofundJavaInfoMeter.java
@@ -14,7 +14,7 @@
public class HofundJavaInfoMeter implements MeterBinder {
- private static final String NAME = "hofund_java_info";
+ private static final String NAME = "hofund.java.info";
private static final String DESCRIPTION = "Basic information about java that is running this application";
private final HofundJavaInfo info;
diff --git a/hofund-core/src/main/java/dev/logchange/hofund/os/HofundOsInfoMeter.java b/hofund-core/src/main/java/dev/logchange/hofund/os/HofundOsInfoMeter.java
index ec76ee4..ef6b8ff 100644
--- a/hofund-core/src/main/java/dev/logchange/hofund/os/HofundOsInfoMeter.java
+++ b/hofund-core/src/main/java/dev/logchange/hofund/os/HofundOsInfoMeter.java
@@ -1,6 +1,5 @@
package dev.logchange.hofund.os;
-import dev.logchange.hofund.git.HofundGitInfoProvider;
import io.micrometer.core.instrument.Gauge;
import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;
@@ -12,7 +11,7 @@
public class HofundOsInfoMeter implements MeterBinder {
- private static final String NAME = "hofund_os_info";
+ private static final String NAME = "hofund.os.info";
private static final String DESCRIPTION = "Basic information about operating system that is running this application";
private final HofundOsInfo info;
diff --git a/hofund-core/src/main/java/dev/logchange/hofund/web/HofundWebServerInfo.java b/hofund-core/src/main/java/dev/logchange/hofund/web/HofundWebServerInfo.java
index 5a525de..22b9038 100644
--- a/hofund-core/src/main/java/dev/logchange/hofund/web/HofundWebServerInfo.java
+++ b/hofund-core/src/main/java/dev/logchange/hofund/web/HofundWebServerInfo.java
@@ -17,7 +17,7 @@ public class HofundWebServerInfo {
private final String version;
public static HofundWebServerInfo create(String name, String version) {
- log.info("Server name: " + name + " version: " + version);
+ log.info("Server name: {} version: {}", name, version);
return HofundWebServerInfo.builder()
.name(name)
diff --git a/hofund-core/src/main/java/dev/logchange/hofund/web/HofundWebServerInfoMeter.java b/hofund-core/src/main/java/dev/logchange/hofund/web/HofundWebServerInfoMeter.java
index 36306af..d96f420 100644
--- a/hofund-core/src/main/java/dev/logchange/hofund/web/HofundWebServerInfoMeter.java
+++ b/hofund-core/src/main/java/dev/logchange/hofund/web/HofundWebServerInfoMeter.java
@@ -11,7 +11,7 @@
public class HofundWebServerInfoMeter implements MeterBinder {
- private static final String NAME = "hofund_web_server_info";
+ private static final String NAME = "hofund.webserver.info";
private static final String DESCRIPTION = "Basic information about web server that is running this application";
private final HofundWebServerInfo info;
diff --git a/hofund-spring-boot-autoconfigure/pom.xml b/hofund-spring-boot-autoconfigure/pom.xml
index cf684ef..69b27b4 100644
--- a/hofund-spring-boot-autoconfigure/pom.xml
+++ b/hofund-spring-boot-autoconfigure/pom.xml
@@ -5,7 +5,7 @@
dev.logchange.hofund
hofund
- 1.1.0-SNAPSHOT
+ 2.0.0-SNAPSHOT
hofund-spring-boot-autoconfigure
@@ -19,50 +19,40 @@
org.springframework.boot
spring-boot-autoconfigure
- ${spring-boot.version}
- provided
+ true
dev.logchange.hofund
hofund-spring
${project.version}
- true
+ true
-
-
org.apache.tomcat.embed
tomcat-embed-core
- ${tomcat-embed-core.version}
- true
+ true
org.springframework.boot
spring-boot-configuration-processor
- ${spring-boot.version}
true
- io.micrometer
- micrometer-registry-prometheus
- ${micrometer-registry-prometheus.version}
+ org.springframework.boot
+ spring-boot-actuator-autoconfigure
true
io.micrometer
-
-
-
-
- micrometer-registry-prometheus-simpleclient
- ${micrometer-registry-prometheus.version}
+ micrometer-registry-prometheus
true
+
diff --git a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/connection/springboot/autoconfigure/HofundConnectionAutoConfiguration.java b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/connection/springboot/autoconfigure/HofundConnectionAutoConfiguration.java
index 80b0f4f..b032bdf 100644
--- a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/connection/springboot/autoconfigure/HofundConnectionAutoConfiguration.java
+++ b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/connection/springboot/autoconfigure/HofundConnectionAutoConfiguration.java
@@ -7,8 +7,8 @@
import dev.logchange.hofund.connection.spring.http.HofundBasicHttpConnectionProvider;
import dev.logchange.hofund.info.HofundInfoProvider;
import dev.logchange.hofund.info.springboot.autoconfigure.HofundInfoAutoConfiguration;
-import io.micrometer.prometheus.PrometheusMeterRegistry;
import lombok.RequiredArgsConstructor;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.ConditionalOnEnabledMetricsExport;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@@ -21,9 +21,7 @@
@RequiredArgsConstructor
@Configuration(proxyBeanMethods = false)
-//available since spring boot 2.4.0
-//@ConditionalOnEnabledMetricsExport(value="prometheus")
-@ConditionalOnClass(PrometheusMeterRegistry.class)
+@ConditionalOnEnabledMetricsExport(value="prometheus")
@AutoConfigureAfter(HofundInfoAutoConfiguration.class)
public class HofundConnectionAutoConfiguration {
diff --git a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/git/springboot/autoconfigure/HofundGitInfoAutoConfiguration.java b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/git/springboot/autoconfigure/HofundGitInfoAutoConfiguration.java
index be17623..19c0189 100644
--- a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/git/springboot/autoconfigure/HofundGitInfoAutoConfiguration.java
+++ b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/git/springboot/autoconfigure/HofundGitInfoAutoConfiguration.java
@@ -2,9 +2,8 @@
import dev.logchange.hofund.git.HofundGitInfoMeter;
import dev.logchange.hofund.git.HofundGitInfoProvider;
-import io.micrometer.prometheus.PrometheusMeterRegistry;
import lombok.RequiredArgsConstructor;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.ConditionalOnEnabledMetricsExport;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
@@ -12,9 +11,7 @@
@RequiredArgsConstructor
@Configuration(proxyBeanMethods = false)
-//available since spring boot 2.4.0
-//@ConditionalOnEnabledMetricsExport(value="prometheus")
-@ConditionalOnClass(PrometheusMeterRegistry.class)
+@ConditionalOnEnabledMetricsExport(value="prometheus")
@EnableConfigurationProperties(HofundGitInfoProperties.class)
public class HofundGitInfoAutoConfiguration {
diff --git a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/graph/springboot/autoconfigure/HofundGraphAutoConfiguration.java b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/graph/springboot/autoconfigure/HofundGraphAutoConfiguration.java
index 8472d56..b181cd7 100644
--- a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/graph/springboot/autoconfigure/HofundGraphAutoConfiguration.java
+++ b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/graph/springboot/autoconfigure/HofundGraphAutoConfiguration.java
@@ -6,11 +6,10 @@
import dev.logchange.hofund.graph.node.HofundNodeMeter;
import dev.logchange.hofund.info.HofundInfoProvider;
import dev.logchange.hofund.info.springboot.autoconfigure.HofundInfoAutoConfiguration;
-import io.micrometer.prometheus.PrometheusMeterRegistry;
import lombok.RequiredArgsConstructor;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.ConditionalOnEnabledMetricsExport;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -19,9 +18,7 @@
@RequiredArgsConstructor
@Configuration(proxyBeanMethods = false)
-//available since spring boot 2.4.0
-//@ConditionalOnEnabledMetricsExport(value="prometheus")
-@ConditionalOnClass(PrometheusMeterRegistry.class)
+@ConditionalOnEnabledMetricsExport(value="prometheus")
@AutoConfigureAfter({HofundInfoAutoConfiguration.class, HofundConnectionAutoConfiguration.class})
public class HofundGraphAutoConfiguration {
diff --git a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/info/springboot/autoconfigure/HofundInfoAutoConfiguration.java b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/info/springboot/autoconfigure/HofundInfoAutoConfiguration.java
index 5b6f815..98d9dc2 100644
--- a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/info/springboot/autoconfigure/HofundInfoAutoConfiguration.java
+++ b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/info/springboot/autoconfigure/HofundInfoAutoConfiguration.java
@@ -2,9 +2,8 @@
import dev.logchange.hofund.info.HofundInfoMeter;
import dev.logchange.hofund.info.HofundInfoProvider;
-import io.micrometer.prometheus.PrometheusMeterRegistry;
import lombok.RequiredArgsConstructor;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.ConditionalOnEnabledMetricsExport;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
@@ -12,9 +11,7 @@
@RequiredArgsConstructor
@Configuration(proxyBeanMethods = false)
-//available since spring boot 2.4.0
-//@ConditionalOnEnabledMetricsExport(value="prometheus")
-@ConditionalOnClass(PrometheusMeterRegistry.class)
+@ConditionalOnEnabledMetricsExport(value="prometheus")
@EnableConfigurationProperties(HofundInfoProperties.class)
public class HofundInfoAutoConfiguration {
diff --git a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/java/springboot/autoconfigure/HofundJavaInfoAutoConfiguration.java b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/java/springboot/autoconfigure/HofundJavaInfoAutoConfiguration.java
index 6bd9c72..6f59720 100644
--- a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/java/springboot/autoconfigure/HofundJavaInfoAutoConfiguration.java
+++ b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/java/springboot/autoconfigure/HofundJavaInfoAutoConfiguration.java
@@ -1,19 +1,15 @@
package dev.logchange.hofund.java.springboot.autoconfigure;
import dev.logchange.hofund.java.HofundJavaInfoMeter;
-import dev.logchange.hofund.os.HofundOsInfoMeter;
-import io.micrometer.prometheus.PrometheusMeterRegistry;
import lombok.RequiredArgsConstructor;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.ConditionalOnEnabledMetricsExport;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@RequiredArgsConstructor
@Configuration(proxyBeanMethods = false)
-//available since spring boot 2.4.0
-//@ConditionalOnEnabledMetricsExport(value="prometheus")
-@ConditionalOnClass(PrometheusMeterRegistry.class)
+@ConditionalOnEnabledMetricsExport(value="prometheus")
public class HofundJavaInfoAutoConfiguration {
@Bean
diff --git a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/os/springboot/autoconfigure/HofundOsInfoAutoConfiguration.java b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/os/springboot/autoconfigure/HofundOsInfoAutoConfiguration.java
index f6a6afe..c561d38 100644
--- a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/os/springboot/autoconfigure/HofundOsInfoAutoConfiguration.java
+++ b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/os/springboot/autoconfigure/HofundOsInfoAutoConfiguration.java
@@ -1,22 +1,15 @@
package dev.logchange.hofund.os.springboot.autoconfigure;
-import dev.logchange.hofund.info.HofundInfoMeter;
-import dev.logchange.hofund.info.HofundInfoProvider;
-import dev.logchange.hofund.info.springboot.autoconfigure.HofundInfoProperties;
import dev.logchange.hofund.os.HofundOsInfoMeter;
-import io.micrometer.prometheus.PrometheusMeterRegistry;
import lombok.RequiredArgsConstructor;
-import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.ConditionalOnEnabledMetricsExport;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@RequiredArgsConstructor
@Configuration(proxyBeanMethods = false)
-//available since spring boot 2.4.0
-//@ConditionalOnEnabledMetricsExport(value="prometheus")
-@ConditionalOnClass(PrometheusMeterRegistry.class)
+@ConditionalOnEnabledMetricsExport(value="prometheus")
public class HofundOsInfoAutoConfiguration {
@Bean
diff --git a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/web/springboot/autoconfigure/HofundWebServerInfoAutoConfiguration.java b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/web/springboot/autoconfigure/HofundWebServerInfoAutoConfiguration.java
index 4806573..2d48107 100644
--- a/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/web/springboot/autoconfigure/HofundWebServerInfoAutoConfiguration.java
+++ b/hofund-spring-boot-autoconfigure/src/main/java/dev/logchange/hofund/web/springboot/autoconfigure/HofundWebServerInfoAutoConfiguration.java
@@ -3,9 +3,9 @@
import dev.logchange.hofund.web.HofundWebServerInfo;
import dev.logchange.hofund.web.HofundWebServerInfoMeter;
import dev.logchange.hofund.web.HofundWebServerInfoProvider;
-import io.micrometer.prometheus.PrometheusMeterRegistry;
import lombok.RequiredArgsConstructor;
import org.apache.catalina.util.ServerInfo;
+import org.springframework.boot.actuate.autoconfigure.metrics.export.ConditionalOnEnabledMetricsExport;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
@@ -13,9 +13,7 @@
@RequiredArgsConstructor
@Configuration(proxyBeanMethods = false)
-//available since spring boot 2.4.0
-//@ConditionalOnEnabledMetricsExport(value="prometheus")
-@ConditionalOnClass(PrometheusMeterRegistry.class)
+@ConditionalOnEnabledMetricsExport(value="prometheus")
public class HofundWebServerInfoAutoConfiguration {
@Bean
diff --git a/hofund-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories b/hofund-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index 74fc011..0000000
--- a/hofund-spring-boot-autoconfigure/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1,9 +0,0 @@
-org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
-dev.logchange.hofund.info.springboot.autoconfigure.HofundInfoAutoConfiguration,\
-dev.logchange.hofund.git.springboot.autoconfigure.HofundGitInfoAutoConfiguration,\
-dev.logchange.hofund.git.springboot.autoconfigure.HofundDefaultGitInfoProperties,\
-dev.logchange.hofund.connection.springboot.autoconfigure.HofundConnectionAutoConfiguration,\
-dev.logchange.hofund.graph.springboot.autoconfigure.HofundGraphAutoConfiguration,\
-dev.logchange.hofund.java.springboot.autoconfigure.HofundJavaInfoAutoConfiguration,\
-dev.logchange.hofund.os.springboot.autoconfigure.HofundOsInfoAutoConfiguration,\
-dev.logchange.hofund.web.springboot.autoconfigure.HofundWebServerInfoAutoConfiguration
\ No newline at end of file
diff --git a/hofund-spring-boot-e2e/pom.xml b/hofund-spring-boot-e2e/pom.xml
index 3590edf..1a1c39e 100644
--- a/hofund-spring-boot-e2e/pom.xml
+++ b/hofund-spring-boot-e2e/pom.xml
@@ -1,11 +1,12 @@
+ 4.0.0
+
hofund
dev.logchange.hofund
- 1.1.0-SNAPSHOT
+ 2.0.0-SNAPSHOT
- 4.0.0
hofund-spring-boot-e2e
@@ -13,57 +14,28 @@
21
21
dev.logchange.hofund.HofundE2E
-
- 3.2.2
- 7.0.0
-
-
-
-
- org.springframework.boot
- spring-boot-dependencies
- ${spring-boot-for-e2e.version}
- pom
- import
-
-
-
-
+
+ dev.logchange.hofund
+ hofund-spring-boot-starter
+ ${project.version}
+
+
org.springframework.boot
spring-boot-starter-web
-
-
-
-
-
-
-
-
-
-
-
org.springframework.boot
spring-boot-starter-actuator
-
io.micrometer
micrometer-registry-prometheus
-
- dev.logchange.hofund
- hofund-spring-boot-starter
- ${project.version}
-
-
-
org.springframework.boot
@@ -77,8 +49,6 @@
org.springframework.boot
spring-boot-maven-plugin
- ${spring-boot-for-e2e.version}
-
@@ -90,7 +60,6 @@
io.github.git-commit-id
git-commit-id-maven-plugin
- ${git-commit-id-maven-plugin.version}
get-the-git-infos
diff --git a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/git/HofundDefaultGitInfoE2ETest.java b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/git/HofundDefaultGitInfoE2ETest.java
index e2b4ad0..6a12020 100644
--- a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/git/HofundDefaultGitInfoE2ETest.java
+++ b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/git/HofundDefaultGitInfoE2ETest.java
@@ -38,7 +38,7 @@ void shouldContainsHofundDefaultGitInfoWithValuesFromGitProperties() {
String expected = "# HELP hofund_git_info Basic information about application based on git\n" +
"# TYPE hofund_git_info gauge\n" +
- "hofund_git_info{branch=\"alaMaKota\",build_host=\"someHostName\",build_time=\"11:12:33T17-02-2023\",commit_id=\"abcdef\",dirty=\"false\",} 1.0";
+ "hofund_git_info{branch=\"alaMaKota\",build_host=\"someHostName\",build_time=\"11:12:33T17-02-2023\",commit_id=\"abcdef\",dirty=\"false\"} 1";
//when:
String response = template.getForObject(path, String.class);
diff --git a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/git/HofundGitInfoE2ETest.java b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/git/HofundGitInfoE2ETest.java
index 58c796d..1b51c85 100644
--- a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/git/HofundGitInfoE2ETest.java
+++ b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/git/HofundGitInfoE2ETest.java
@@ -34,7 +34,7 @@ void shouldContainsHofundDefaultGitInfoWithValuesFromGitProperties() {
String expected =
"# HELP hofund_git_info Basic information about application based on git\n" +
"# TYPE hofund_git_info gauge\n" +
- "hofund_git_info{branch=\"feature-1-for-test-e2e\",build_host=\"someHostForTest\",build_time=\"14:12:13T11-11-2023\",commit_id=\"someAbbrevIdForE2eTest\",dirty=\"true\",} 1.0";
+ "hofund_git_info{branch=\"feature-1-for-test-e2e\",build_host=\"someHostForTest\",build_time=\"14:12:13T11-11-2023\",commit_id=\"someAbbrevIdForE2eTest\",dirty=\"true\"} 1";
//when:
String response = template.getForObject(path, String.class);
diff --git a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/info/HofundInfoE2ETest.java b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/info/HofundInfoE2ETest.java
index 3e85841..2299325 100644
--- a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/info/HofundInfoE2ETest.java
+++ b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/info/HofundInfoE2ETest.java
@@ -31,7 +31,7 @@ void shouldContainsHofundInfoWithValuesFromProperties() {
String expected = "# HELP hofund_info Basic information about application\n" +
"# TYPE hofund_info gauge\n" +
- "hofund_info{application_name=\"testapp\",application_version=\"1.2.3\",id=\"testapp\",} 1.0";
+ "hofund_info{application_name=\"testapp\",application_version=\"1.2.3\",id=\"testapp\"} 1";
//when:
String response = template.getForObject(path, String.class);
diff --git a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/java/HofundJavaInfoE2ETest.java b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/java/HofundJavaInfoE2ETest.java
index 650d01a..dfdd853 100644
--- a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/java/HofundJavaInfoE2ETest.java
+++ b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/java/HofundJavaInfoE2ETest.java
@@ -41,7 +41,7 @@ void shouldContainsHofundJavaInfo() {
String expected =
"# HELP hofund_java_info Basic information about java that is running this application\n" +
"# TYPE hofund_java_info gauge\n" +
- "hofund_java_info{jvm_name=\"{jvmName}\",jvm_vendor=\"{jvmVendor}\",jvm_version=\"{jvmVersion}\",runtime_name=\"{runtimeName}\",runtime_version=\"{runtimeVersion}\",vendor_name=\"{vendor}\",vendor_version=\"{vendorVersion}\",version=\"{javaVersion}\",} 1.0"
+ "hofund_java_info{jvm_name=\"{jvmName}\",jvm_vendor=\"{jvmVendor}\",jvm_version=\"{jvmVersion}\",runtime_name=\"{runtimeName}\",runtime_version=\"{runtimeVersion}\",vendor_name=\"{vendor}\",vendor_version=\"{vendorVersion}\",version=\"{javaVersion}\"} 1"
.replace("{jvmName}", jvmName)
.replace("{jvmVendor}", jvmVendor)
.replace("{jvmVersion}", jvmVersion)
diff --git a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/os/HofundOsInfoE2ETest.java b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/os/HofundOsInfoE2ETest.java
index 8f131ef..74453b2 100644
--- a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/os/HofundOsInfoE2ETest.java
+++ b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/os/HofundOsInfoE2ETest.java
@@ -31,7 +31,7 @@ void shouldContainsHofundOsInfo() {
String expected =
"# HELP hofund_os_info Basic information about operating system that is running this application\n" +
"# TYPE hofund_os_info gauge\n" +
- "hofund_os_info{arch=\"{arch}\",name=\"{name}\",version=\"{version}\",} 1.0"
+ "hofund_os_info{arch=\"{arch}\",name=\"{name}\",version=\"{version}\"} 1"
.replace("{arch}", arch)
.replace("{name}", name)
.replace("{version}", version);
diff --git a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/web/HofundWebServerInfoE2ETest.java b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/web/HofundWebServerInfoE2ETest.java
index 291dc53..347defb 100644
--- a/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/web/HofundWebServerInfoE2ETest.java
+++ b/hofund-spring-boot-e2e/src/test/java/dev/logchange/hofund/web/HofundWebServerInfoE2ETest.java
@@ -28,9 +28,9 @@ void shouldContainsHofundOsInfo() {
String version = ServerInfo.getServerNumber();
String expected =
- "# HELP hofund_web_server_info Basic information about web server that is running this application\n" +
- "# TYPE hofund_web_server_info gauge\n" +
- "hofund_web_server_info{name=\"Apache Tomcat\",version=\"{version}\",} 1.0"
+ "# HELP hofund_webserver_info Basic information about web server that is running this application\n" +
+ "# TYPE hofund_webserver_info gauge\n" +
+ "hofund_webserver_info{name=\"Apache Tomcat\",version=\"{version}\"} 1"
.replace("{version}", version);
//when:
diff --git a/hofund-spring-boot-starter/pom.xml b/hofund-spring-boot-starter/pom.xml
index 06ca559..568e245 100644
--- a/hofund-spring-boot-starter/pom.xml
+++ b/hofund-spring-boot-starter/pom.xml
@@ -1,11 +1,12 @@
+ 4.0.0
+
hofund
dev.logchange.hofund
- 1.1.0-SNAPSHOT
+ 2.0.0-SNAPSHOT
- 4.0.0
hofund-spring-boot-starter
@@ -20,6 +21,19 @@
hofund-spring
${project.version}
+
+
+ org.springframework.boot
+ spring-boot-starter
+
+
+ org.springframework.boot
+ spring-boot-starter-actuator
+
+
+ io.micrometer
+ micrometer-registry-prometheus
+
\ No newline at end of file
diff --git a/hofund-spring/pom.xml b/hofund-spring/pom.xml
index 4c03d0c..41a6785 100644
--- a/hofund-spring/pom.xml
+++ b/hofund-spring/pom.xml
@@ -5,7 +5,7 @@
dev.logchange.hofund
hofund
- 1.1.0-SNAPSHOT
+ 2.0.0-SNAPSHOT
hofund-spring
@@ -25,8 +25,6 @@
org.springframework
spring-core
- ${spring-framework.version}
- provided
diff --git a/pom.xml b/pom.xml
index a0c4c3c..c824dbf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,7 +4,7 @@
dev.logchange.hofund
hofund
- 1.1.0-SNAPSHOT
+ 2.0.0-SNAPSHOT
pom
hofund
@@ -56,77 +56,52 @@
- 1.8
- 1.8
+ 17
+ 17
UTF-8
- 1.18.30
-
-
-
- [2.2.0.RELEASE,)
- [1.3.0,)
- [5.2.12.RELEASE,)
- [9.0.27,)
- [1.3.16,)
- [1.7.28,)
-
-
- 2.22.2
- 5.8.2
- 4.6.1
- 3.23.1
+ 3.3.1
+
+
+
+ org.springframework.boot
+ spring-boot-dependencies
+ ${spring-boot.version}
+ pom
+ import
+
+
+
+
org.projectlombok
lombok
- ${lombok.version}
- provided
org.junit.jupiter
junit-jupiter
- ${junit-jupiter.version}
test
-
org.mockito
mockito-junit-jupiter
- ${mockito-junit-jupiter.version}
test
-
org.assertj
assertj-core
- ${assertj.version}
test
-
-
-
- org.apache.maven.plugins
- maven-surefire-plugin
- 3.2.5
-
-
-
-
- dev.logchange
- logchange-maven-plugin
- 0.6.1
- false
-
maven-release-plugin
@@ -137,7 +112,6 @@
org.apache.maven.plugins
maven-source-plugin
- 3.2.1
attach-sources
@@ -158,7 +132,6 @@
org.apache.maven.plugins
maven-gpg-plugin
- 3.0.1
sign-artifacts
@@ -180,7 +153,6 @@
org.apache.maven.plugins
maven-javadoc-plugin
- 3.4.0
attach-javadocs