diff --git a/pom.xml b/pom.xml index fe25b8fa..d01cd175 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.springframework.boot spring-boot-starter-parent - 2.7.13 + 3.2.0 @@ -45,13 +45,13 @@ yyyy-MM-dd HH:mm ${maven.build.timestamp} + 6.0.0 2.1.0 3.1.1 8.42 0.8.7 17 0.9.14 - 3.16.6 0.9.14 1.10.1 1.10.1 @@ -66,7 +66,7 @@ 2.10.6 1.0.2 2.3.3 - 0.11.1 + 0.12.2 ac.simons.biking2.Application @@ -79,39 +79,6 @@ sa - - - - - org.apache.zookeeper - zookeeper - 3.4.14 - - - - log4j - log4j - 1.2.17 - - - - org.linkedin - org.linkedin.util-core - 1.7.1 - - - org.jboss.logging - jboss-logging-annotations - 2.2.1.Final - - - org.jboss.logging - jboss-logging-processor - 2.2.1.Final - - - - org.projectlombok @@ -176,11 +143,6 @@ org.springframework.boot spring-boot-starter-jooq - - org.hibernate - hibernate-java8 - ${hibernate.version} - org.springframework.boot spring-boot-starter-actuator @@ -196,16 +158,17 @@ true - javax.xml.bind - jaxb-api + jakarta.xml.bind + jakarta.xml.bind-api - org.glassfish.jaxb - jaxb-runtime + com.sun.xml.bind + jaxb-impl + runtime com.fasterxml.jackson.module - jackson-module-jaxb-annotations + jackson-module-jakarta-xmlbind-annotations org.jooq @@ -612,7 +575,7 @@ analyze - MINOR + MAJOR diff --git a/src/jqassistant/concepts_spring-data.adoc b/src/jqassistant/concepts_spring-data.adoc index ac6b5d96..84115e22 100644 --- a/src/jqassistant/concepts_spring-data.adoc +++ b/src/jqassistant/concepts_spring-data.adoc @@ -1,5 +1,22 @@ ==== Concepts related to Spring-Data +Teaching old jQAssistant about Jakarta persistence + +[[concept:jakartaPersistence]] +[source,cypher,role="concept",requiresConcepts="dependency:Package"] +.Labels all types annotated with @jakarta.persistence.Entity with "Jpa" and "Entity". +---- +MATCH + (t:Type)-[:ANNOTATED_BY]->()-[:OF_TYPE]->(a:Type) +WHERE + a.fqn="jakarta.persistence.Entity" +SET + t:Jpa:Entity +RETURN + t AS JpaEntity +---- + + [[spring-data:Repository]] [source,cypher,role="concept",requiresConcepts="spring-data:ImplementedRepository"] .Returns all repositories. diff --git a/src/main/java/ac/simons/biking2/banner/BannerController.java b/src/main/java/ac/simons/biking2/banner/BannerController.java index fea3bb1f..7f6cb8d0 100644 --- a/src/main/java/ac/simons/biking2/banner/BannerController.java +++ b/src/main/java/ac/simons/biking2/banner/BannerController.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2018 michael-simons.eu. + * Copyright 2016-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import java.io.PrintStream; import java.nio.charset.StandardCharsets; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletResponse; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import org.springframework.boot.Banner; diff --git a/src/main/java/ac/simons/biking2/bikes/BikeCmd.java b/src/main/java/ac/simons/biking2/bikes/BikeCmd.java index e39a7e9f..a5deb26f 100644 --- a/src/main/java/ac/simons/biking2/bikes/BikeCmd.java +++ b/src/main/java/ac/simons/biking2/bikes/BikeCmd.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,9 +21,9 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.springframework.format.annotation.DateTimeFormat; /** diff --git a/src/main/java/ac/simons/biking2/bikes/BikeEntity.java b/src/main/java/ac/simons/biking2/bikes/BikeEntity.java index 3b0b8d3c..59610af2 100644 --- a/src/main/java/ac/simons/biking2/bikes/BikeEntity.java +++ b/src/main/java/ac/simons/biking2/bikes/BikeEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,20 +22,20 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Embeddable; -import javax.persistence.Embedded; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.OneToMany; -import javax.persistence.OrderBy; -import javax.persistence.Table; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Embeddable; +import jakarta.persistence.Embedded; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.OneToMany; +import jakarta.persistence.OrderBy; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import org.hibernate.annotations.Formula; import org.hibernate.validator.constraints.URL; diff --git a/src/main/java/ac/simons/biking2/bikes/BikesController.java b/src/main/java/ac/simons/biking2/bikes/BikesController.java index 3563efc8..10d1912d 100644 --- a/src/main/java/ac/simons/biking2/bikes/BikesController.java +++ b/src/main/java/ac/simons/biking2/bikes/BikesController.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import java.util.List; import java.util.Locale; -import javax.validation.Valid; +import jakarta.validation.Valid; import org.springframework.context.MessageSource; import org.springframework.context.support.MessageSourceAccessor; diff --git a/src/main/java/ac/simons/biking2/bikes/LentMilageEntity.java b/src/main/java/ac/simons/biking2/bikes/LentMilageEntity.java index 3d32f71a..5ae31839 100644 --- a/src/main/java/ac/simons/biking2/bikes/LentMilageEntity.java +++ b/src/main/java/ac/simons/biking2/bikes/LentMilageEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 michael-simons.eu. + * Copyright 2021-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,17 +20,17 @@ import java.time.LocalDate; import java.time.OffsetDateTime; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; -import javax.validation.constraints.NotNull; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; import lombok.EqualsAndHashCode; diff --git a/src/main/java/ac/simons/biking2/bikes/MilageEntity.java b/src/main/java/ac/simons/biking2/bikes/MilageEntity.java index d5ab2428..879df6bd 100644 --- a/src/main/java/ac/simons/biking2/bikes/MilageEntity.java +++ b/src/main/java/ac/simons/biking2/bikes/MilageEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,17 +19,17 @@ import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; -import javax.validation.constraints.NotNull; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/ac/simons/biking2/bikes/NewMilageCmd.java b/src/main/java/ac/simons/biking2/bikes/NewMilageCmd.java index edddef5e..6371499a 100644 --- a/src/main/java/ac/simons/biking2/bikes/NewMilageCmd.java +++ b/src/main/java/ac/simons/biking2/bikes/NewMilageCmd.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,8 +19,8 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import java.time.LocalDate; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Positive; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Positive; import org.springframework.format.annotation.DateTimeFormat; diff --git a/src/main/java/ac/simons/biking2/bikes/StoryCmd.java b/src/main/java/ac/simons/biking2/bikes/StoryCmd.java index 7d9e3693..93c0edad 100644 --- a/src/main/java/ac/simons/biking2/bikes/StoryCmd.java +++ b/src/main/java/ac/simons/biking2/bikes/StoryCmd.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2021 michael-simons.eu. + * Copyright 2015-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ */ package ac.simons.biking2.bikes; -import javax.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotBlank; import org.hibernate.validator.constraints.URL; /** diff --git a/src/main/java/ac/simons/biking2/bikingpictures/BikingPictureEntity.java b/src/main/java/ac/simons/biking2/bikingpictures/BikingPictureEntity.java index 1bb4941c..3e7632f9 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/BikingPictureEntity.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/BikingPictureEntity.java @@ -20,14 +20,14 @@ import java.time.ZonedDateTime; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/ac/simons/biking2/bikingpictures/BikingPicturesController.java b/src/main/java/ac/simons/biking2/bikingpictures/BikingPicturesController.java index 737c6ef0..cf162d08 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/BikingPicturesController.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/BikingPicturesController.java @@ -20,8 +20,8 @@ import java.io.File; import java.io.IOException; import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import org.springframework.data.domain.Sort; diff --git a/src/main/java/ac/simons/biking2/bikingpictures/FetchBikingPicturesJob.java b/src/main/java/ac/simons/biking2/bikingpictures/FetchBikingPicturesJob.java index 7e62eb5c..6b82fc66 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/FetchBikingPicturesJob.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/FetchBikingPicturesJob.java @@ -27,10 +27,10 @@ import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.List; -import javax.annotation.PostConstruct; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.annotation.PostConstruct; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.context.annotation.Profile; import org.springframework.scheduling.annotation.Scheduled; diff --git a/src/main/java/ac/simons/biking2/bikingpictures/rss/Channel.java b/src/main/java/ac/simons/biking2/bikingpictures/rss/Channel.java index 8cef31a3..c365a62b 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/rss/Channel.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/rss/Channel.java @@ -18,10 +18,10 @@ import java.time.ZonedDateTime; import java.util.ArrayList; import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import static java.util.Optional.ofNullable; diff --git a/src/main/java/ac/simons/biking2/bikingpictures/rss/Content.java b/src/main/java/ac/simons/biking2/bikingpictures/rss/Content.java index 77e9aee6..39ef6d0b 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/rss/Content.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/rss/Content.java @@ -15,9 +15,9 @@ */ package ac.simons.biking2.bikingpictures.rss; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; /** * @author Michael J. Simons, 2014-02-17 diff --git a/src/main/java/ac/simons/biking2/bikingpictures/rss/Guid.java b/src/main/java/ac/simons/biking2/bikingpictures/rss/Guid.java index 0a5e44c8..90cd81e5 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/rss/Guid.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/rss/Guid.java @@ -15,10 +15,10 @@ */ package ac.simons.biking2.bikingpictures.rss; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlValue; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlValue; /** * @author Michael J. Simons, 2014-02-17 diff --git a/src/main/java/ac/simons/biking2/bikingpictures/rss/Item.java b/src/main/java/ac/simons/biking2/bikingpictures/rss/Item.java index b8ff3ee9..376e2556 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/rss/Item.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/rss/Item.java @@ -17,10 +17,10 @@ import java.time.ZonedDateTime; import java.util.List; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter; /** * @author Michael J. Simons, 2014-02-17 diff --git a/src/main/java/ac/simons/biking2/bikingpictures/rss/Link.java b/src/main/java/ac/simons/biking2/bikingpictures/rss/Link.java index 6d0b98d8..810e452d 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/rss/Link.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/rss/Link.java @@ -15,9 +15,9 @@ */ package ac.simons.biking2.bikingpictures.rss; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; /** * @author Michael J. Simons, 2014-02-17 diff --git a/src/main/java/ac/simons/biking2/bikingpictures/rss/RSS.java b/src/main/java/ac/simons/biking2/bikingpictures/rss/RSS.java index 5890494d..ac8e882c 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/rss/RSS.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/rss/RSS.java @@ -15,10 +15,10 @@ */ package ac.simons.biking2.bikingpictures.rss; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlRootElement; /** * @author Michael J. Simons, 2014-02-17 diff --git a/src/main/java/ac/simons/biking2/bikingpictures/rss/RSSDateTimeAdapter.java b/src/main/java/ac/simons/biking2/bikingpictures/rss/RSSDateTimeAdapter.java index ab18dcf4..d4de9444 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/rss/RSSDateTimeAdapter.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/rss/RSSDateTimeAdapter.java @@ -18,7 +18,7 @@ import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.Locale; -import javax.xml.bind.annotation.adapters.XmlAdapter; +import jakarta.xml.bind.annotation.adapters.XmlAdapter; /** * @author Michael J. Simons, 2014-02-17 diff --git a/src/main/java/ac/simons/biking2/bikingpictures/rss/Thumbnail.java b/src/main/java/ac/simons/biking2/bikingpictures/rss/Thumbnail.java index dbe5249d..d87a5532 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/rss/Thumbnail.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/rss/Thumbnail.java @@ -15,9 +15,9 @@ */ package ac.simons.biking2.bikingpictures.rss; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; /** * @author Michael J. Simons, 2014-02-17 diff --git a/src/main/java/ac/simons/biking2/bikingpictures/rss/package-info.java b/src/main/java/ac/simons/biking2/bikingpictures/rss/package-info.java index 92fc5cf3..5bd2661e 100644 --- a/src/main/java/ac/simons/biking2/bikingpictures/rss/package-info.java +++ b/src/main/java/ac/simons/biking2/bikingpictures/rss/package-info.java @@ -20,5 +20,5 @@ ) package ac.simons.biking2.bikingpictures.rss; -import javax.xml.bind.annotation.XmlNs; -import javax.xml.bind.annotation.XmlSchema; +import jakarta.xml.bind.annotation.XmlNs; +import jakarta.xml.bind.annotation.XmlSchema; diff --git a/src/main/java/ac/simons/biking2/config/SecurityConfig.java b/src/main/java/ac/simons/biking2/config/SecurityConfig.java index 87aa2fff..7d62b407 100644 --- a/src/main/java/ac/simons/biking2/config/SecurityConfig.java +++ b/src/main/java/ac/simons/biking2/config/SecurityConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,11 @@ import org.springframework.boot.actuate.metrics.MetricsEndpoint; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.Customizer; +import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity; import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; +import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer.FrameOptionsConfig; import org.springframework.security.web.SecurityFilterChain; import static org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest.to; @@ -34,36 +37,30 @@ * @since 2014-02-19 */ @Configuration(proxyBeanMethods = false) -@EnableGlobalMethodSecurity(prePostEnabled = true) +@EnableMethodSecurity(prePostEnabled = true) @SuppressWarnings({"squid:S1118"}) // This is not a utility class. It cannot have a private constructor. public class SecurityConfig { @Bean SecurityFilterChain filterChain(@Value("${biking2.require-ssl:false}") final boolean requireSSL, final HttpSecurity http) throws Exception { // @formatter:off - HttpSecurity builder = http - .httpBasic() - .and() - .authorizeRequests() - .antMatchers("/api/system/env/java.runtime.version") + var builder = http + .httpBasic(Customizer.withDefaults()) + .authorizeHttpRequests(cfg -> { cfg + .requestMatchers("/api/system/env/java.runtime.version") .permitAll() .requestMatchers(to(HealthEndpoint.class, InfoEndpoint.class, MetricsEndpoint.class)) .permitAll() .requestMatchers(to(EnvironmentEndpoint.class)) .authenticated() - .antMatchers("/**").permitAll() - .and() - .sessionManagement() - .sessionCreationPolicy(STATELESS) - .and() - .csrf() - .disable() - .headers() - .frameOptions() // OEmbedController#embedTrack uses an iframe - .disable().and(); + .requestMatchers("/**").permitAll(); + }) + .sessionManagement(cfg -> cfg.sessionCreationPolicy(STATELESS)) + .csrf(AbstractHttpConfigurer::disable) + .headers(cfg -> cfg.frameOptions(FrameOptionsConfig::disable)); // @formatter:on if (requireSSL) { - builder = builder.requiresChannel().anyRequest().requiresSecure().and(); + builder = builder.requiresChannel(cfg -> cfg.anyRequest().requiresSecure()); } return builder.build(); } diff --git a/src/main/java/ac/simons/biking2/config/TrackerConfig.java b/src/main/java/ac/simons/biking2/config/TrackerConfig.java index 97d837b2..cb12494c 100644 --- a/src/main/java/ac/simons/biking2/config/TrackerConfig.java +++ b/src/main/java/ac/simons/biking2/config/TrackerConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ import java.util.Arrays; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import javax.jms.ConnectionFactory; +import jakarta.jms.ConnectionFactory; import org.apache.activemq.broker.BrokerFactory; import org.apache.activemq.broker.BrokerPlugin; import org.apache.activemq.broker.BrokerService; diff --git a/src/main/java/ac/simons/biking2/config/WebConfig.java b/src/main/java/ac/simons/biking2/config/WebConfig.java index 6a343e42..7c4476f3 100644 --- a/src/main/java/ac/simons/biking2/config/WebConfig.java +++ b/src/main/java/ac/simons/biking2/config/WebConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,6 @@ */ package ac.simons.biking2.config; -import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule; -import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule.Priority; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; @@ -28,6 +26,9 @@ import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationModule; +import com.fasterxml.jackson.module.jakarta.xmlbind.JakartaXmlBindAnnotationModule.Priority; + /** * @author Michael J. Simons * @since 2014-02-15 @@ -67,13 +68,13 @@ public String index() { /** * {@code OEmbedResponse} uses XmlElement annotations to be configured for - * JAXB as well as JSON so we need the {@link JaxbAnnotationModule} as well + * JAXB as well as JSON, so we need the {@link JakartaXmlBindAnnotationModule} as well * * @return */ @Bean public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() { - return builder -> builder.modulesToInstall(new JaxbAnnotationModule().setPriority(Priority.SECONDARY)); + return builder -> builder.modulesToInstall(new JakartaXmlBindAnnotationModule().setPriority(Priority.SECONDARY)); } @Bean diff --git a/src/main/java/ac/simons/biking2/gallerypictures/GalleryController.java b/src/main/java/ac/simons/biking2/gallerypictures/GalleryController.java index 195d274f..a92539f3 100644 --- a/src/main/java/ac/simons/biking2/gallerypictures/GalleryController.java +++ b/src/main/java/ac/simons/biking2/gallerypictures/GalleryController.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,8 +26,8 @@ import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.dao.DataIntegrityViolationException; import org.springframework.data.domain.Sort; import org.springframework.format.annotation.DateTimeFormat; diff --git a/src/main/java/ac/simons/biking2/gallerypictures/GalleryPictureEntity.java b/src/main/java/ac/simons/biking2/gallerypictures/GalleryPictureEntity.java index 8f1f2cf9..582c5772 100644 --- a/src/main/java/ac/simons/biking2/gallerypictures/GalleryPictureEntity.java +++ b/src/main/java/ac/simons/biking2/gallerypictures/GalleryPictureEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,15 +19,15 @@ import java.io.Serializable; import java.time.LocalDate; import java.time.OffsetDateTime; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/ac/simons/biking2/statistics/StatisticService.java b/src/main/java/ac/simons/biking2/statistics/StatisticService.java index a665e0b5..f45a019d 100644 --- a/src/main/java/ac/simons/biking2/statistics/StatisticService.java +++ b/src/main/java/ac/simons/biking2/statistics/StatisticService.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 michael-simons.eu. + * Copyright 2019-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import static org.jooq.impl.DSL.max; import static org.jooq.impl.DSL.min; import static org.jooq.impl.DSL.name; +import static org.jooq.impl.DSL.nvl; import static org.jooq.impl.DSL.partitionBy; import static org.jooq.impl.DSL.rank; import static org.jooq.impl.DSL.round; @@ -155,7 +156,7 @@ public Map computeHistory(final Optional yearSta // Select yearly values var yearlyValues = new HashMap(); - var aggregatedMonthlyValue = round(sum(MONTHLY_MILAGE_VALUE)); + var aggregatedMonthlyValue = nvl(round(sum(MONTHLY_MILAGE_VALUE)), BigDecimal.ZERO); this.database .with(MONTHLY_MILAGES) .select( diff --git a/src/main/java/ac/simons/biking2/statistics/highcharts/PlotOptions.java b/src/main/java/ac/simons/biking2/statistics/highcharts/PlotOptions.java index b29b26ac..3e22da35 100644 --- a/src/main/java/ac/simons/biking2/statistics/highcharts/PlotOptions.java +++ b/src/main/java/ac/simons/biking2/statistics/highcharts/PlotOptions.java @@ -70,8 +70,8 @@ public P build() { @JsonCreator PlotOptions( - @JsonProperty("categories") final Column column, - @JsonProperty("categories") final SeriesOptions series + @JsonProperty("column") final Column column, + @JsonProperty("series") final SeriesOptions series ) { this.column = column; this.series = series; diff --git a/src/main/java/ac/simons/biking2/support/FileBasedResource.java b/src/main/java/ac/simons/biking2/support/FileBasedResource.java index 26667578..82d56980 100644 --- a/src/main/java/ac/simons/biking2/support/FileBasedResource.java +++ b/src/main/java/ac/simons/biking2/support/FileBasedResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 michael-simons.eu. + * Copyright 2016-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,8 +24,8 @@ import java.time.ZoneId; import java.util.Locale; import java.util.concurrent.TimeUnit; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import lombok.RequiredArgsConstructor; /** diff --git a/src/main/java/ac/simons/biking2/support/JAXBContextFactory.java b/src/main/java/ac/simons/biking2/support/JAXBContextFactory.java index 97a81d2b..e36b0631 100644 --- a/src/main/java/ac/simons/biking2/support/JAXBContextFactory.java +++ b/src/main/java/ac/simons/biking2/support/JAXBContextFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,8 +15,8 @@ */ package ac.simons.biking2.support; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; diff --git a/src/main/java/ac/simons/biking2/tracker/LocationController.java b/src/main/java/ac/simons/biking2/tracker/LocationController.java index 8f5809eb..e92f467a 100644 --- a/src/main/java/ac/simons/biking2/tracker/LocationController.java +++ b/src/main/java/ac/simons/biking2/tracker/LocationController.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package ac.simons.biking2.tracker; import java.util.List; -import javax.validation.Valid; +import jakarta.validation.Valid; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/ac/simons/biking2/tracker/LocationEntity.java b/src/main/java/ac/simons/biking2/tracker/LocationEntity.java index e1655f3b..102a6633 100644 --- a/src/main/java/ac/simons/biking2/tracker/LocationEntity.java +++ b/src/main/java/ac/simons/biking2/tracker/LocationEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,13 +18,13 @@ import java.io.Serializable; import java.math.BigDecimal; import java.time.OffsetDateTime; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.validation.constraints.NotNull; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/ac/simons/biking2/tracker/NewLocationCmd.java b/src/main/java/ac/simons/biking2/tracker/NewLocationCmd.java index 43adab34..1a5de32c 100644 --- a/src/main/java/ac/simons/biking2/tracker/NewLocationCmd.java +++ b/src/main/java/ac/simons/biking2/tracker/NewLocationCmd.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,7 @@ import java.time.Instant; import java.time.OffsetDateTime; import java.time.ZoneId; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; /** * @author Michael J. Simons, diff --git a/src/main/java/ac/simons/biking2/tracker/NewLocationMessageListener.java b/src/main/java/ac/simons/biking2/tracker/NewLocationMessageListener.java index 9d26f757..609e92f0 100644 --- a/src/main/java/ac/simons/biking2/tracker/NewLocationMessageListener.java +++ b/src/main/java/ac/simons/biking2/tracker/NewLocationMessageListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2021 michael-simons.eu. + * Copyright 2016-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,11 +17,11 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; -import javax.jms.BytesMessage; -import javax.jms.JMSException; -import javax.jms.Message; -import javax.jms.MessageListener; -import javax.jms.TextMessage; +import jakarta.jms.BytesMessage; +import jakarta.jms.JMSException; +import jakarta.jms.Message; +import jakarta.jms.MessageListener; +import jakarta.jms.TextMessage; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/java/ac/simons/biking2/tracks/OEmbedController.java b/src/main/java/ac/simons/biking2/tracks/OEmbedController.java index 12d748e2..eeed9ad8 100644 --- a/src/main/java/ac/simons/biking2/tracks/OEmbedController.java +++ b/src/main/java/ac/simons/biking2/tracks/OEmbedController.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,8 @@ import java.util.Optional; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import org.hibernate.validator.constraints.URL; diff --git a/src/main/java/ac/simons/biking2/tracks/OEmbedResponse.java b/src/main/java/ac/simons/biking2/tracks/OEmbedResponse.java index 9979a1f2..415a4fdd 100644 --- a/src/main/java/ac/simons/biking2/tracks/OEmbedResponse.java +++ b/src/main/java/ac/simons/biking2/tracks/OEmbedResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,10 +20,10 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.Serializable; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; import lombok.Getter; import lombok.Setter; diff --git a/src/main/java/ac/simons/biking2/tracks/TrackEntity.java b/src/main/java/ac/simons/biking2/tracks/TrackEntity.java index d8321c35..c4892d34 100644 --- a/src/main/java/ac/simons/biking2/tracks/TrackEntity.java +++ b/src/main/java/ac/simons/biking2/tracks/TrackEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,18 +27,18 @@ import lombok.NoArgsConstructor; import lombok.Setter; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EnumType; -import javax.persistence.Enumerated; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Size; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EnumType; +import jakarta.persistence.Enumerated; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import java.io.File; import java.io.Serializable; import java.math.BigDecimal; diff --git a/src/main/java/ac/simons/biking2/tracks/TracksController.java b/src/main/java/ac/simons/biking2/tracks/TracksController.java index d725222f..fd89061b 100644 --- a/src/main/java/ac/simons/biking2/tracks/TracksController.java +++ b/src/main/java/ac/simons/biking2/tracks/TracksController.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,11 +37,11 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.server.ResponseStatusException; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; diff --git a/src/main/java/ac/simons/biking2/tracks/gpx/Bounds.java b/src/main/java/ac/simons/biking2/tracks/gpx/Bounds.java index 2366ed08..6d1a82dd 100644 --- a/src/main/java/ac/simons/biking2/tracks/gpx/Bounds.java +++ b/src/main/java/ac/simons/biking2/tracks/gpx/Bounds.java @@ -16,9 +16,9 @@ package ac.simons.biking2.tracks.gpx; import java.math.BigDecimal; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlAttribute; /** * @author Michael J. Simons, 2014-02-21 diff --git a/src/main/java/ac/simons/biking2/tracks/gpx/GPX.java b/src/main/java/ac/simons/biking2/tracks/gpx/GPX.java index 8d278e73..83150cc1 100644 --- a/src/main/java/ac/simons/biking2/tracks/gpx/GPX.java +++ b/src/main/java/ac/simons/biking2/tracks/gpx/GPX.java @@ -15,9 +15,9 @@ */ package ac.simons.biking2.tracks.gpx; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlAccessType; +import jakarta.xml.bind.annotation.XmlAccessorType; +import jakarta.xml.bind.annotation.XmlRootElement; /** * @author Michael J. Simons, 2014-02-21 diff --git a/src/main/java/ac/simons/biking2/tracks/gpx/package-info.java b/src/main/java/ac/simons/biking2/tracks/gpx/package-info.java index 3649686e..66e1a8b6 100644 --- a/src/main/java/ac/simons/biking2/tracks/gpx/package-info.java +++ b/src/main/java/ac/simons/biking2/tracks/gpx/package-info.java @@ -15,8 +15,8 @@ */ @XmlSchema( namespace = "http://www.topografix.com/GPX/1/0", - elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED + elementFormDefault = jakarta.xml.bind.annotation.XmlNsForm.QUALIFIED ) package ac.simons.biking2.tracks.gpx; -import javax.xml.bind.annotation.XmlSchema; +import jakarta.xml.bind.annotation.XmlSchema; diff --git a/src/main/java/ac/simons/biking2/trips/AssortedTripEntity.java b/src/main/java/ac/simons/biking2/trips/AssortedTripEntity.java index 776b33fe..1e51c770 100644 --- a/src/main/java/ac/simons/biking2/trips/AssortedTripEntity.java +++ b/src/main/java/ac/simons/biking2/trips/AssortedTripEntity.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,13 +18,13 @@ import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDate; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.validation.constraints.NotNull; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.Table; +import jakarta.validation.constraints.NotNull; import lombok.AccessLevel; import lombok.EqualsAndHashCode; import lombok.Getter; diff --git a/src/main/java/ac/simons/biking2/trips/NewTripCmd.java b/src/main/java/ac/simons/biking2/trips/NewTripCmd.java index 2f085c0e..43d0e4b4 100644 --- a/src/main/java/ac/simons/biking2/trips/NewTripCmd.java +++ b/src/main/java/ac/simons/biking2/trips/NewTripCmd.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2021 michael-simons.eu. + * Copyright 2015-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import java.time.LocalDate; -import javax.validation.constraints.NotNull; +import jakarta.validation.constraints.NotNull; /** * Command class for creating new assorted trips. diff --git a/src/main/java/ac/simons/biking2/trips/TripsController.java b/src/main/java/ac/simons/biking2/trips/TripsController.java index 134ff2e3..8934058b 100644 --- a/src/main/java/ac/simons/biking2/trips/TripsController.java +++ b/src/main/java/ac/simons/biking2/trips/TripsController.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2019 michael-simons.eu. + * Copyright 2015-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package ac.simons.biking2.trips; import java.math.BigDecimal; -import javax.validation.Valid; +import jakarta.validation.Valid; import lombok.AccessLevel; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index acff2ad5..85093e8d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,4 +1,4 @@ -# Copyright 2014-2021 Michael J. Simons. +# Copyright 2014-2023 Michael J. Simons. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ biking2.tracker.device = iPhone spring.activemq.user = ${spring.security.user.name} spring.activemq.password = ${spring.security.user.password} +spring.activemq.broker-url = vm://localhost spring.thymeleaf.cache = false spring.web.resources.cache.period = 7d @@ -59,6 +60,8 @@ management.endpoint.health.enabled = true management.endpoint.info.enabled = true management.endpoint.metrics.enabled = true +management.endpoint.env.show-values=ALWAYS + # Needed since 2.6.0 # https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.6-Release-Notes management.info.env.enabled = true diff --git a/src/test/java/ac/simons/biking2/bikes/BikesControllerTest.java b/src/test/java/ac/simons/biking2/bikes/BikesControllerTest.java index 6bc5fe78..a0f5af38 100644 --- a/src/test/java/ac/simons/biking2/bikes/BikesControllerTest.java +++ b/src/test/java/ac/simons/biking2/bikes/BikesControllerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2022 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,7 +57,7 @@ import static org.springframework.restdocs.payload.PayloadDocumentation.subsectionWithPath; import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName; import static org.springframework.restdocs.request.RequestDocumentation.pathParameters; -import static org.springframework.restdocs.request.RequestDocumentation.requestParameters; +import static org.springframework.restdocs.request.RequestDocumentation.queryParameters; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; @@ -142,7 +142,7 @@ void shouldGetBikes() throws Exception { .andDo(document("api/bikes/get", preprocessRequest(prettyPrint()), preprocessResponse(prettyPrint()), - requestParameters( + queryParameters( parameterWithName("all").description("Flag, if all bikes, including decommissioned bikes, should be returned.") ), responseFields( diff --git a/src/test/java/ac/simons/biking2/bikingpictures/rss/RSSTest.java b/src/test/java/ac/simons/biking2/bikingpictures/rss/RSSTest.java index 28607e51..ae8cbfea 100644 --- a/src/test/java/ac/simons/biking2/bikingpictures/rss/RSSTest.java +++ b/src/test/java/ac/simons/biking2/bikingpictures/rss/RSSTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,9 +20,9 @@ import ac.simons.biking2.support.JAXBContextFactory; import java.time.ZoneId; import java.time.ZonedDateTime; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import jakarta.xml.bind.JAXBContext; +import jakarta.xml.bind.JAXBException; +import jakarta.xml.bind.Unmarshaller; import org.junit.jupiter.api.Test; diff --git a/src/test/java/ac/simons/biking2/statistics/ChartsControllerTest.java b/src/test/java/ac/simons/biking2/statistics/ChartsControllerTest.java index 2402a895..3e4ff4a3 100644 --- a/src/test/java/ac/simons/biking2/statistics/ChartsControllerTest.java +++ b/src/test/java/ac/simons/biking2/statistics/ChartsControllerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/test/java/ac/simons/biking2/support/TestConfig.java b/src/test/java/ac/simons/biking2/support/TestConfig.java index 8cf90b04..54428c49 100644 --- a/src/test/java/ac/simons/biking2/support/TestConfig.java +++ b/src/test/java/ac/simons/biking2/support/TestConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2017 michael-simons.eu. + * Copyright 2014-2023 michael-simons.eu. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ import java.util.concurrent.Executor; import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.context.annotation.Bean; @@ -32,7 +34,6 @@ /** * @author Michael J. Simons, 2014-02-16 */ -@Configuration @ComponentScan("ac.simons.biking2.config") @EnableAutoConfiguration @EntityScan("ac.simons.biking2") @@ -42,7 +43,7 @@ public class TestConfig { @Bean(destroyMethod = "shutdown") - public Executor taskScheduler() { + public ScheduledExecutorService taskScheduler() { return Executors.newSingleThreadScheduledExecutor(); } } diff --git a/src/test/java/ac/simons/biking2/tracker/NewLocationMessageListenerTest.java b/src/test/java/ac/simons/biking2/tracker/NewLocationMessageListenerTest.java index 40469451..b3b8db56 100644 --- a/src/test/java/ac/simons/biking2/tracker/NewLocationMessageListenerTest.java +++ b/src/test/java/ac/simons/biking2/tracker/NewLocationMessageListenerTest.java @@ -25,10 +25,10 @@ import java.io.IOException; import java.math.BigDecimal; -import javax.jms.BytesMessage; -import javax.jms.JMSException; -import javax.jms.MapMessage; -import javax.jms.TextMessage; +import jakarta.jms.BytesMessage; +import jakarta.jms.JMSException; +import jakarta.jms.MapMessage; +import jakarta.jms.TextMessage; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/src/test/java/ac/simons/biking2/tracks/TracksControllerTest.java b/src/test/java/ac/simons/biking2/tracks/TracksControllerTest.java index 3e8c2b37..742be7eb 100644 --- a/src/test/java/ac/simons/biking2/tracks/TracksControllerTest.java +++ b/src/test/java/ac/simons/biking2/tracks/TracksControllerTest.java @@ -37,7 +37,7 @@ import org.springframework.test.context.support.TestPropertySourceUtils; import org.springframework.test.web.servlet.MockMvc; -import javax.annotation.PostConstruct; +import jakarta.annotation.PostConstruct; import java.io.ByteArrayInputStream; import java.io.File; import java.io.FileNotFoundException; diff --git a/src/test/resources/application-test.properties b/src/test/resources/application-test.properties index 969834f3..71e9a0c2 100644 --- a/src/test/resources/application-test.properties +++ b/src/test/resources/application-test.properties @@ -1,4 +1,4 @@ -# Copyright 2014-2021 Michael J. Simons. +# Copyright 2014-2023 Michael J. Simons. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,3 +19,4 @@ spring.datasource.password = biking2.datastore-base-directory = ${java.io.tmpdir} spring.main.banner-mode = off +spring.main.allow-bean-definition-overriding =true