From d4c34a5ed96838198a40b79b3b51c3a8e59785e4 Mon Sep 17 00:00:00 2001 From: shollid3 Date: Fri, 15 Dec 2023 15:24:14 -0500 Subject: [PATCH 1/3] Spring Boot 3.x uplift. springBootVersion = '3.2.0' hapiFhirVersion = '6.11.7-SNAPSHOT' slf4jSimpleVersion = '2.0.9' slf4jVersion = "2.0.9" SNAPSHOT (for Hapi Fhir) maven-repo added : "https://oss.sonatype.org/content/repositories/snapshots" --- .../build.gradle | 30 ++++++++++++++----- .../MyVeryPoorSecurityConfiguration.java | 18 ++++++----- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle b/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle index 93826f7..e11ffcd 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle @@ -1,22 +1,22 @@ buildscript { ext { - spring_plugin_version = '2.7.18' + spring_plugin_version = '3.2.0' sonarqube_plugin_version = '3.0' jacoco_tool_version = '0.8.6' - springBootVersion = '2.7.18' - // Note, there is a relationship between the spring-boot-version and the hapi-fhir-version as seen here (under 'Compile Dependencies'): https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-server/6.2.5 - hapiFhirVersion = '6.1.3' + springBootVersion = '3.2.0' + // Note, there is a relationship between the spring-boot-version and the hapi-fhir-version as seen here (under 'Compile Dependencies'): https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-server/6.1.1 + hapiFhirVersion = '6.11.7-SNAPSHOT' - slf4jSimpleVersion = '1.7.36' - slf4jVersion = "1.7.36" + slf4jSimpleVersion = '2.0.9' + slf4jVersion = "2.0.9" javaxInjectVersion = "1" junitVersion = "4.13.2" mockitoVersion = "4.8.0" - commonsLangVersion = '3.12.0' + commonsLangVersion = '3.14.0' versionBuildHolderVariable = '1.0-SNAPSHOT' @@ -76,6 +76,22 @@ subprojects { // ORDER MATTERS HERE. See : https://stackoverflow.com/questions/50726435/difference-among-mavencentral-jcenter-and-mavenlocal/50726436#50726436 + /* below is a TEMPORARY maven-source for Hapi Fhir SNAPSHOTS +* as seen here https://hapifhir.io/hapi-fhir/docs/getting_started/downloading_and_importing.html#using-snapshot-builds +* once a "jakarta" friendly hapi fhir RELEASE version is available, the below temp maven-source should be removed +* also see : https://groups.google.com/g/hapi-fhir/c/U6dXYsC7LCg/m/Ssxk6Fs3AgAJ +* +* SNAPSHOT version values can be seen here: +* https://oss.sonatype.org/#nexus-search;gav~ca.uhn.hapi.fhir~hapi-fhir-server~~~~kw,versionexpand +* +* +* */ + maven { + url "https://oss.sonatype.org/content/repositories/snapshots" + } + + + // As a general advice, you should avoid adding mavenLocal() as a repository. // https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:case-for-maven-local // diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/websecurity/MyVeryPoorSecurityConfiguration.java b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/websecurity/MyVeryPoorSecurityConfiguration.java index a0414e5..7ebc96f 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/websecurity/MyVeryPoorSecurityConfiguration.java +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/websecurity/MyVeryPoorSecurityConfiguration.java @@ -3,7 +3,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer; import org.springframework.security.web.SecurityFilterChain; @Configuration @@ -15,13 +14,18 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { /* The below is HORRIBLE "security" and is NOT production level correct */ - http.csrf().disable(); /* had to add this "Cross Site Request Forgery" disable for DELETE operations */ - http.authorizeRequests().anyRequest().permitAll(); + /* had to add this "Cross Site Request Forgery" disable for DELETE operations */ + http + .csrf(csrf -> csrf.disable()); + + http + .authorizeHttpRequests(authorize -> authorize + //.requestMatchers("/**", "/**/**").permitAll() + .anyRequest().permitAll() + ); + return http.build(); - } - @Bean - public WebSecurityCustomizer webSecurityCustomizer() { - return (web) -> web.ignoring().antMatchers("/images/**", "/js/**"); } + } From 3dde30a5fd9ca5b91dfbe107a5becee62bf6a3b1 Mon Sep 17 00:00:00 2001 From: shollid3 Date: Fri, 22 Dec 2023 16:02:53 -0500 Subject: [PATCH 2/3] Spring Boot 3.x uplift. Make a toned down custom version (no jpa) of FhirAutoConfiguration called MySuperCoolFhirAutoConfiguration --- .../build.gradle | 5 + .../settings.gradle | 1 + .../javalayers/hapifhirmimics/build.gradle | 20 ++ .../MySuperCoolFhirAutoConfiguration.java | 184 ++++++++++++++++++ .../quickexampleserver/build.gradle | 13 +- .../QuickExampleServerApplicationEntry.java | 11 +- .../MyVeryPoorSecurityConfiguration.java | 2 +- .../src/main/resources/application.yml | 6 + ...jectContext.ExampleNotForProduction.di.xml | 6 +- 9 files changed, 237 insertions(+), 11 deletions(-) create mode 100644 java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/build.gradle create mode 100644 java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/src/main/java/my/hapifhirmimics/MySuperCoolFhirAutoConfiguration.java diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle b/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle index e11ffcd..1fa2bf9 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle @@ -9,6 +9,9 @@ buildscript { // Note, there is a relationship between the spring-boot-version and the hapi-fhir-version as seen here (under 'Compile Dependencies'): https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-server/6.1.1 hapiFhirVersion = '6.11.7-SNAPSHOT' + jakartaServletApiVersion = '6.0.0' + + slf4jSimpleVersion = '2.0.9' slf4jVersion = "2.0.9" javaxInjectVersion = "1" @@ -18,6 +21,8 @@ buildscript { commonsLangVersion = '3.14.0' + h2databaseVersion = '2.2.220' + versionBuildHolderVariable = '1.0-SNAPSHOT' customJacocoExclude = ['**/*'] diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/settings.gradle b/java/hapi-fhirstarters-rest-server-gradle-multmodule/settings.gradle index 965ad5a..3c4b831 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/settings.gradle +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/settings.gradle @@ -6,6 +6,7 @@ rootProject.name = 'hapi-fhirstarters-rest-server-skeleton-gradlelayersandspring * https://www.petrikainulainen.net/programming/gradle/getting-started-with-gradle-creating-a-multi-project-build/ * https://docs.gradle.org/current/samples/sample_building_java_applications_multi_project.html */ +include ':source:javalayers:hapifhirmimics' include ':source:javalayers:businesslogiclayer' include ':source:javalayers:resourceproviderlayer' include ':source:javalayers:toplayers:springboottoplayers:quickexampleserver' diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/build.gradle b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/build.gradle new file mode 100644 index 0000000..24e88c6 --- /dev/null +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/build.gradle @@ -0,0 +1,20 @@ +plugins { + id 'java' +} + +dependencies { + implementation group: 'javax.inject', name: 'javax.inject', version: javaxInjectVersion +// https://mvnrepository.com/artifact/jakarta.servlet/jakarta.servlet-api + compileOnly group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: jakartaServletApiVersion + + + implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: springBootVersion + + + implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-base', version: hapiFhirVersion + implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-structures-r4', version: hapiFhirVersion + implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-server', version: hapiFhirVersion + /* below items allow hapi-fhir-server to be configured by application.yml entries */ + implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-spring-boot-autoconfigure', version: hapiFhirVersion + +} diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/src/main/java/my/hapifhirmimics/MySuperCoolFhirAutoConfiguration.java b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/src/main/java/my/hapifhirmimics/MySuperCoolFhirAutoConfiguration.java new file mode 100644 index 0000000..0aeca3d --- /dev/null +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/src/main/java/my/hapifhirmimics/MySuperCoolFhirAutoConfiguration.java @@ -0,0 +1,184 @@ +package my.hapifhirmimics; + +import ca.uhn.fhir.context.FhirContext; +import ca.uhn.fhir.rest.client.api.IClientInterceptor; +import ca.uhn.fhir.rest.client.api.IGenericClient; +import ca.uhn.fhir.rest.client.api.IRestfulClientFactory; +import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy; +import ca.uhn.fhir.rest.server.IPagingProvider; +import ca.uhn.fhir.rest.server.IResourceProvider; +import ca.uhn.fhir.rest.server.RestfulServer; +import ca.uhn.fhir.rest.server.interceptor.IServerInterceptor; +import ca.uhn.fhir.rest.server.interceptor.RequestValidatingInterceptor; +import ca.uhn.fhir.rest.server.interceptor.ResponseValidatingInterceptor; +import ca.uhn.fhir.spring.boot.autoconfigure.FhirProperties; +import ca.uhn.fhir.spring.boot.autoconfigure.FhirRestfulServerCustomizer; +import jakarta.servlet.ServletException; +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.autoconfigure.EnableAutoConfiguration; +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.autoconfigure.condition.ResourceCondition; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.web.servlet.ServletRegistrationBean; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Conditional; +import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.AnnotationAwareOrderComparator; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * {@link EnableAutoConfiguration Auto-configuration} for HAPI FHIR. + * + * @author Mathieu Ouellet + */ +@Configuration +//@AutoConfigureAfter({DataSourceAutoConfiguration.class, HibernateJpaAutoConfiguration.class}) +@EnableConfigurationProperties(FhirProperties.class) +public class MySuperCoolFhirAutoConfiguration { + + private final FhirProperties properties; + + public MySuperCoolFhirAutoConfiguration(FhirProperties properties) { + this.properties = properties; + } + + @Bean + @ConditionalOnMissingBean + public FhirContext fhirContext() { + FhirContext fhirContext = new FhirContext(properties.getVersion()); + return fhirContext; + } + + @Configuration + //@ConditionalOnClass(AbstractJaxRsProvider.class) + @EnableConfigurationProperties(FhirProperties.class) + @ConfigurationProperties("hapi.fhir.rest") + @SuppressWarnings("serial") + static class FhirRestfulServerConfiguration extends RestfulServer { + + private final FhirProperties properties; + + private final FhirContext fhirContext; + + private final List resourceProviders; + + private final IPagingProvider pagingProvider; + + private final List customizers; + + public FhirRestfulServerConfiguration( + FhirProperties properties, + FhirContext fhirContext, + ObjectProvider> resourceProviders, + ObjectProvider pagingProvider, + ObjectProvider> interceptors, + ObjectProvider> customizers) { + this.properties = properties; + this.fhirContext = fhirContext; + this.resourceProviders = resourceProviders.getIfAvailable(); + this.pagingProvider = pagingProvider.getIfAvailable(); + this.customizers = customizers.getIfAvailable(); + } + + private void customize() { + if (this.customizers != null) { + AnnotationAwareOrderComparator.sort(this.customizers); + for (FhirRestfulServerCustomizer customizer : this.customizers) { + customizer.customize(this); + } + } + } + + @Bean + public ServletRegistrationBean fhirServerRegistrationBean() { + ServletRegistrationBean registration = new ServletRegistrationBean( + this, this.properties.getServer().getPath()); + registration.setLoadOnStartup(1); + return registration; + } + + @Override + protected void initialize() throws ServletException { + super.initialize(); + + setFhirContext(this.fhirContext); + setResourceProviders(this.resourceProviders); + setPagingProvider(this.pagingProvider); + + setServerAddressStrategy(new HardcodedServerAddressStrategy( + this.properties.getServer().getPath())); + + customize(); + } + } + + + @Configuration + @Conditional(FhirValidationConfiguration.SchemaAvailableCondition.class) + @ConditionalOnProperty(name = "hapi.fhir.validation.enabled", matchIfMissing = true) + static class FhirValidationConfiguration { + + @Bean + @ConditionalOnMissingBean + public RequestValidatingInterceptor requestValidatingInterceptor() { + return new RequestValidatingInterceptor(); + } + + @Bean + @ConditionalOnMissingBean + @ConditionalOnProperty(name = "hapi.fhir.validation.request-only", havingValue = "false") + public ResponseValidatingInterceptor responseValidatingInterceptor() { + return new ResponseValidatingInterceptor(); + } + + static class SchemaAvailableCondition extends ResourceCondition { + + SchemaAvailableCondition() { + super( + "ValidationSchema", + "hapi.fhir.validation", + "schema-location", + "classpath:/org/hl7/fhir/instance/model/schema", + "classpath:/org/hl7/fhir/dstu2016may/model/schema", + "classpath:/org/hl7/fhir/dstu3/model/schema"); + } + } + } + + @Configuration + @ConditionalOnProperty("hapi.fhir.server.url") + @EnableConfigurationProperties(FhirProperties.class) + static class FhirRestfulClientConfiguration { + + private final FhirProperties properties; + + private final List clientInterceptors; + + public FhirRestfulClientConfiguration( + FhirProperties properties, ObjectProvider> clientInterceptors) { + this.properties = properties; + this.clientInterceptors = clientInterceptors.getIfAvailable(); + } + + @Bean + @ConditionalOnBean(IRestfulClientFactory.class) + public IGenericClient fhirClient(final IRestfulClientFactory clientFactory) { + IGenericClient fhirClient = + clientFactory.newGenericClient(this.properties.getServer().getUrl()); + if (!CollectionUtils.isEmpty(this.clientInterceptors)) { + for (IClientInterceptor interceptor : this.clientInterceptors) { + fhirClient.registerInterceptor(interceptor); + } + } + return fhirClient; + } + + + + } +} diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/build.gradle b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/build.gradle index a91ceb6..a1787e0 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/build.gradle +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/build.gradle @@ -13,6 +13,7 @@ dependencies { implementation project(':source:javalayers:resourceproviderlayer') implementation project(':source:javalayers:businesslogiclayer') + implementation project(':source:javalayers:hapifhirmimics') /* spring boot dependencies */ implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: springBootVersion @@ -25,9 +26,15 @@ dependencies { implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-structures-r4', version: hapiFhirVersion implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-server', version: hapiFhirVersion /* below items allow hapi-fhir-server to be configured by application.yml entries */ - implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-spring-boot-autoconfigure', version: hapiFhirVersion - implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-jaxrsserver-base', version: hapiFhirVersion - +// implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-spring-boot-autoconfigure', version: hapiFhirVersion +// implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-jaxrsserver-base', version: hapiFhirVersion +// +// /* ca.uhn.fhir.jpa.subscription.channel.config.SubscriptionChannelConfig */ +// implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-jpaserver-base', version: hapiFhirVersion +// implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-jpa', version: hapiFhirVersion + + /* H2 JPA */ + implementation group: 'com.h2database', name: 'h2', version: h2databaseVersion implementation group: 'org.apache.commons', name: 'commons-lang3', version: commonsLangVersion diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/QuickExampleServerApplicationEntry.java b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/QuickExampleServerApplicationEntry.java index 1c9a32e..bb0c7ed 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/QuickExampleServerApplicationEntry.java +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/QuickExampleServerApplicationEntry.java @@ -21,7 +21,10 @@ import java.util.List; import java.util.Objects; -@SpringBootApplication +@SpringBootApplication(scanBasePackages = {"ca.uhn.fhir.context", + "my.hapifhirmimics", + "ca.uhn.example.gradleandspringbootexample.toplayers.springboottoplayers.quickexampleserver.compositionroot", + "ca.uhn.example.gradleandspringbootexample.toplayers.springboottoplayers.quickexampleserver.websecurity"}) //@ServletComponentScan @Configuration @ImportResource({"classpath*:applicationContext.xml"}) @@ -50,18 +53,18 @@ public static void main(final String[] args) { if (logger.isDebugEnabled()) { Resource[] items = getXMLResources(); for (Resource item : items) { - logger.debug(LOG_MSG_XML_RESOURCE_FILENAME, item.getFilename()); + logger.info(LOG_MSG_XML_RESOURCE_FILENAME, item.getFilename()); } List list = getFiles(System.getProperty("java.class.path")); for (File file : list) { - logger.debug(LOG_MSG_JAVA_CLASS_PATH_FILE_PATH, file.getPath()); + logger.info(LOG_MSG_JAVA_CLASS_PATH_FILE_PATH, file.getPath()); } String[] beanNames = applicationContext.getBeanDefinitionNames(); Arrays.sort(beanNames); for (String beanName : beanNames) { - logger.debug(LOG_MSG_GET_BEAN_DEFINITION_NAME, beanName); + logger.info(LOG_MSG_GET_BEAN_DEFINITION_NAME, beanName); } } diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/websecurity/MyVeryPoorSecurityConfiguration.java b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/websecurity/MyVeryPoorSecurityConfiguration.java index 7ebc96f..06bf2a6 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/websecurity/MyVeryPoorSecurityConfiguration.java +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/java/ca/uhn/example/gradleandspringbootexample/toplayers/springboottoplayers/quickexampleserver/websecurity/MyVeryPoorSecurityConfiguration.java @@ -20,7 +20,7 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http .authorizeHttpRequests(authorize -> authorize - //.requestMatchers("/**", "/**/**").permitAll() + .requestMatchers("/**", "/**/**").permitAll() .anyRequest().permitAll() ); diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/resources/application.yml b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/resources/application.yml index 494b2ed..9b62b3a 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/resources/application.yml +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/resources/application.yml @@ -38,3 +38,9 @@ logging: core: JdbcTemplate: INFO StatementCreatorUtils: INFO + core: + io: + support: DEBUG + context: + annotation: DEBUG + diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/resources/projectContext.ExampleNotForProduction.di.xml b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/resources/projectContext.ExampleNotForProduction.di.xml index 7f9b748..4d4a0a4 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/resources/projectContext.ExampleNotForProduction.di.xml +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/toplayers/springboottoplayers/quickexampleserver/src/main/resources/projectContext.ExampleNotForProduction.di.xml @@ -20,9 +20,9 @@ - - + + + From a4ec4fccd28360219bac2b8b5eacb4f5c5d459d4 Mon Sep 17 00:00:00 2001 From: granadacoder Date: Mon, 29 Jun 2026 13:18:20 -0400 Subject: [PATCH 3/3] gradle-8.14.3 uplift sonarqube_plugin_version = '7.3.1.8318' jacoco_tool_version = '0.8.6' springBootVersion = '3.5.16' hapiFhirVersion = '8.8.1' deal with transitive dependency issue: implementation(group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-spring-boot-autoconfigure', version: hapiFhirVersion) { /*This keeps the needed HAPI autoconfigure classes for compile-time, while preventing it from pulling Spring Boot 3.5.x and related transitive jars that were overriding your intended 3.2.0 stack and causing NoClassDefFoundError: org/apache/hc/client5/http/ssl/TlsSocketStrategy. */ transitive = false } --- .../build.gradle | 29 +++++++++++++------ .../gradle/wrapper/gradle-wrapper.properties | 2 +- .../javalayers/hapifhirmimics/build.gradle | 6 +++- 3 files changed, 26 insertions(+), 11 deletions(-) diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle b/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle index 1fa2bf9..5e055fa 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/build.gradle @@ -1,19 +1,23 @@ buildscript { ext { - spring_plugin_version = '3.2.0' - sonarqube_plugin_version = '3.0' + spring_plugin_version = '3.5.16' + sonarqube_plugin_version = '7.3.1.8318' jacoco_tool_version = '0.8.6' - springBootVersion = '3.2.0' + springBootVersion = '3.5.16' // Note, there is a relationship between the spring-boot-version and the hapi-fhir-version as seen here (under 'Compile Dependencies'): https://mvnrepository.com/artifact/ca.uhn.hapi.fhir/hapi-fhir-server/6.1.1 - hapiFhirVersion = '6.11.7-SNAPSHOT' + hapiFhirVersion = '8.8.1' + + //below for granadacoder JT3 testing or any local SNAPSHOT testing + //hapiFhirVersion = '8.33.44-SNAPSHOT' + jakartaServletApiVersion = '6.0.0' - slf4jSimpleVersion = '2.0.9' - slf4jVersion = "2.0.9" + slf4jSimpleVersion = '2.0.17' + slf4jVersion = "2.0.17" javaxInjectVersion = "1" junitVersion = "4.13.2" @@ -103,6 +107,13 @@ subprojects { // However, it may be necessary when testing here with changes to a shared component library that have only // been published locally (vi "gradle publishToMavenLocal". // + + + //below for granadacoder JT3 testing or any local SNAPSHOT testing + //mavenLocal() + + + mavenCentral() } @@ -117,9 +128,9 @@ subprojects { group = "build" reports { - xml.enabled true - csv.enabled false - html.enabled false + xml.required = true + csv.required = false + html.required = false } afterEvaluate { diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/gradle/wrapper/gradle-wrapper.properties b/java/hapi-fhirstarters-rest-server-gradle-multmodule/gradle/wrapper/gradle-wrapper.properties index 8049c68..3ae1e2f 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/gradle/wrapper/gradle-wrapper.properties +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/build.gradle b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/build.gradle index 24e88c6..0dfb4ca 100644 --- a/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/build.gradle +++ b/java/hapi-fhirstarters-rest-server-gradle-multmodule/source/javalayers/hapifhirmimics/build.gradle @@ -15,6 +15,10 @@ dependencies { implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-structures-r4', version: hapiFhirVersion implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-server', version: hapiFhirVersion /* below items allow hapi-fhir-server to be configured by application.yml entries */ - implementation group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-spring-boot-autoconfigure', version: hapiFhirVersion + implementation(group: 'ca.uhn.hapi.fhir', name: 'hapi-fhir-spring-boot-autoconfigure', version: hapiFhirVersion) { + + /*This keeps the needed HAPI autoconfigure classes for compile-time, while preventing it from pulling Spring Boot 3.5.x and related transitive jars that were overriding your intended 3.2.0 stack and causing NoClassDefFoundError: org/apache/hc/client5/http/ssl/TlsSocketStrategy. */ + transitive = false + } }