From 9c557e2c80e597b92b5fb855e611ec39e021bb14 Mon Sep 17 00:00:00 2001 From: Jens Kristian Villadsen Date: Tue, 5 Dec 2023 19:56:31 +0100 Subject: [PATCH] Cleaned up for running boot as default (#620) --- README.md | 4 +-- pom.xml | 3 +++ .../ca/uhn/fhir/jpa/starter/Application.java | 26 ------------------- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 6bc5789..94fee83 100644 --- a/README.md +++ b/README.md @@ -193,14 +193,14 @@ The easiest way to run this server entirely depends on your environment requirem ### Using jetty ```bash -mvn jetty:run +mvn -Pjetty jetty:run ``` If you need to run this server on a different port (using Maven), you can change the port in the run command as follows: ```bash -mvn -Djetty.port=8888 jetty:run +mvn -Pjetty -Djetty.port=8888 jetty:run ``` Server will then be accessible at http://localhost:8888/ and eg. http://localhost:8888/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to eg. diff --git a/pom.xml b/pom.xml index f750d54..1b8fee4 100644 --- a/pom.xml +++ b/pom.xml @@ -601,6 +601,9 @@ boot + + true + org.springframework.boot diff --git a/src/main/java/ca/uhn/fhir/jpa/starter/Application.java b/src/main/java/ca/uhn/fhir/jpa/starter/Application.java index 9131f8d..4f72c4a 100644 --- a/src/main/java/ca/uhn/fhir/jpa/starter/Application.java +++ b/src/main/java/ca/uhn/fhir/jpa/starter/Application.java @@ -53,10 +53,6 @@ public class Application extends SpringBootServletInitializer { // UI is now accessible at http://localhost:8080/ } - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { - return builder.sources(Application.class); - } @Autowired AutowireCapableBeanFactory beanFactory; @@ -73,26 +69,4 @@ public class Application extends SpringBootServletInitializer { return servletRegistrationBean; } - @Bean - public ServletRegistrationBean overlayRegistrationBean() { - - AnnotationConfigWebApplicationContext annotationConfigWebApplicationContext = - new AnnotationConfigWebApplicationContext(); - annotationConfigWebApplicationContext.register(FhirTesterConfig.class); - - DispatcherServlet dispatcherServlet = new DispatcherServlet(annotationConfigWebApplicationContext); - dispatcherServlet.setContextClass(AnnotationConfigWebApplicationContext.class); - dispatcherServlet.setContextConfigLocation(FhirTesterConfig.class.getName()); - - ServletRegistrationBean registrationBean = new ServletRegistrationBean(); - registrationBean.setServlet(dispatcherServlet); - registrationBean.addUrlMappings("/*"); - registrationBean.setLoadOnStartup(1); - return registrationBean; - } - - // @Bean - // IRepositoryFactory repositoryFactory(DaoRegistry theDaoRegistry, RestfulServer theRestfulServer) { - // return rd -> new HapiFhirRepository(theDaoRegistry, rd, theRestfulServer); - // } }