org.springframework.boot
diff --git a/db-scheduler-ui/src/main/java/no/bekk/dbscheduler/ui/controller/SpaFallbackMvc.java b/db-scheduler-ui/src/main/java/no/bekk/dbscheduler/ui/controller/SpaFallbackMvc.java
new file mode 100644
index 00000000..e4e54976
--- /dev/null
+++ b/db-scheduler-ui/src/main/java/no/bekk/dbscheduler/ui/controller/SpaFallbackMvc.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) Bekk
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of the License at
+ *
+ *
http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *
Unless required by applicable law or agreed to in writing, software distributed under the
+ * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package no.bekk.dbscheduler.ui.controller;
+
+import java.io.IOException;
+import lombok.NonNull;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.Resource;
+import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+import org.springframework.web.servlet.resource.PathResourceResolver;
+
+public class SpaFallbackMvc implements WebMvcConfigurer {
+
+ public static final String DEFAULT_STARTING_PAGE = "static/db-scheduler/index.html";
+
+ @Override
+ public void addResourceHandlers(ResourceHandlerRegistry registry) {
+ registry
+ .addResourceHandler("/db-scheduler", "/db-scheduler/**")
+ .addResourceLocations("classpath:/static/db-scheduler/")
+ .resourceChain(true)
+ .addResolver(new SpaFallbackResolver());
+ }
+
+ static class SpaFallbackResolver extends PathResourceResolver {
+ @Override
+ protected Resource getResource(@NonNull String resourcePath, Resource location)
+ throws IOException {
+ var requestedResource = location.createRelative(resourcePath);
+
+ if (requestedResource.exists() && requestedResource.isReadable()) {
+ return requestedResource;
+ }
+
+ return new ClassPathResource(DEFAULT_STARTING_PAGE);
+ }
+ }
+}
diff --git a/db-scheduler-ui/src/main/java/no/bekk/dbscheduler/ui/controller/UIController.java b/db-scheduler-ui/src/main/java/no/bekk/dbscheduler/ui/controller/UIController.java
deleted file mode 100644
index 39657ed7..00000000
--- a/db-scheduler-ui/src/main/java/no/bekk/dbscheduler/ui/controller/UIController.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) Bekk
- *
- *
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of the License at
- *
- *
http://www.apache.org/licenses/LICENSE-2.0
- *
- *
Unless required by applicable law or agreed to in writing, software distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package no.bekk.dbscheduler.ui.controller;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.CrossOrigin;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-
-@Controller
-@CrossOrigin
-@RequestMapping("/db-scheduler")
-public class UIController {
-
- public UIController() {}
-
- @GetMapping("/**")
- public String index() {
- return "forward:/db-scheduler-ui/index.html";
- }
-}
diff --git a/example-app-webflux/pom.xml b/example-app-webflux/pom.xml
index ef70f7ee..1a7c27de 100644
--- a/example-app-webflux/pom.xml
+++ b/example-app-webflux/pom.xml
@@ -1,7 +1,5 @@
-
+
4.0.0
no.bekk.db-scheduler-ui
@@ -17,55 +15,65 @@
true
-
+
- org.springframework.boot
- spring-boot-starter-webflux
+ com.h2database
+ h2
+ 2.2.220
-
- org.springframework.boot
- spring-boot-starter-jdbc
+ io.rocketbase.extension
+ db-scheduler-log-spring-boot-starter
+ 0.7.0
+
+
+ no.bekk.db-scheduler-ui
+ db-scheduler-ui-starter
+ main-SNAPSHOT
+
+
+ org.flywaydb
+ flyway-core
org.springframework.boot
spring-boot-devtools
-
- com.h2database
- h2
- 2.2.220
+ org.springframework.boot
+ spring-boot-starter-actuator
+
- org.flywaydb
- flyway-core
+ org.springframework.boot
+ spring-boot-starter-jdbc
org.springframework.boot
- spring-boot-starter-actuator
+ spring-boot-starter-webflux
- io.rocketbase.extension
- db-scheduler-log-spring-boot-starter
- 0.7.0
+ org.assertj
+ assertj-core
+ test
- org.junit.jupiter
- junit-jupiter
+ org.hsqldb
+ hsqldb
test
+
org.junit.jupiter
- junit-jupiter-api
+ junit-jupiter
test
- org.springframework.boot
- spring-boot-test
+ org.junit.jupiter
+ junit-jupiter-api
test
@@ -74,21 +82,10 @@
test
- org.assertj
- assertj-core
- test
-
-
-
- org.hsqldb
- hsqldb
+ org.springframework.boot
+ spring-boot-test
test
-
- no.bekk.db-scheduler-ui
- db-scheduler-ui-starter
- main-SNAPSHOT
-
diff --git a/example-app-webflux/src/main/java/com/github/bekk/exampleapp/config/WebConfig.java b/example-app-webflux/src/main/java/com/github/bekk/exampleapp/config/WebConfig.java
deleted file mode 100644
index 021fbc12..00000000
--- a/example-app-webflux/src/main/java/com/github/bekk/exampleapp/config/WebConfig.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) Bekk
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of the License at
- *
- *
http://www.apache.org/licenses/LICENSE-2.0
- *
- *
Unless required by applicable law or agreed to in writing, software distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.github.bekk.exampleapp.config;
-
-import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
-import static org.springframework.web.reactive.function.server.RouterFunctions.route;
-import static org.springframework.web.reactive.function.server.ServerResponse.ok;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.io.Resource;
-import org.springframework.http.MediaType;
-import org.springframework.web.reactive.function.server.RouterFunction;
-import org.springframework.web.reactive.function.server.ServerResponse;
-
-@Configuration
-public class WebConfig {
- @Bean
- public RouterFunction dbSchedulerRouter(
- @Value("classpath:/static/db-scheduler-ui/index.html") final Resource indexHtml) {
- return route(
- GET("/db-scheduler/**"),
- request -> ok().contentType(MediaType.TEXT_HTML).bodyValue(indexHtml));
- }
-}
diff --git a/example-app-webflux/src/main/resources/application.properties b/example-app-webflux/src/main/resources/application.properties
index 9eb49d48..d543cdad 100644
--- a/example-app-webflux/src/main/resources/application.properties
+++ b/example-app-webflux/src/main/resources/application.properties
@@ -5,3 +5,4 @@ db-scheduler-log.enabled=true
db-scheduler-log.table-name=scheduled_execution_logs
db-scheduler-ui.history=true
db-scheduler-ui.task-data=true
+#logging.level.org.springframework=DEBUG
\ No newline at end of file
diff --git a/example-app/pom.xml b/example-app/pom.xml
index d98ed93e..b72e1df9 100644
--- a/example-app/pom.xml
+++ b/example-app/pom.xml
@@ -1,7 +1,5 @@
-
+
4.0.0
no.bekk.db-scheduler-ui
@@ -17,56 +15,43 @@
true
-
-
- org.springframework.boot
- spring-boot-starter-web
-
-
-
- org.springframework.boot
- spring-boot-starter-jdbc
-
com.h2database
h2
2.2.220
-
- org.flywaydb
- flyway-core
-
org.springframework.boot
- spring-boot-starter-actuator
+ spring-boot-devtools
io.rocketbase.extension
db-scheduler-log-spring-boot-starter
0.7.0
-
- org.junit.jupiter
- junit-jupiter
- test
+ no.bekk.db-scheduler-ui
+ db-scheduler-ui-starter
+ main-SNAPSHOT
- org.junit.jupiter
- junit-jupiter-api
- test
+ org.flywaydb
+ flyway-core
org.springframework.boot
- spring-boot-test
- test
+ spring-boot-starter-actuator
+
org.springframework.boot
- spring-boot-starter-test
- test
+ spring-boot-starter-jdbc
+
+
+ org.springframework.boot
+ spring-boot-starter-web
org.assertj
@@ -79,10 +64,26 @@
hsqldb
test
+
- no.bekk.db-scheduler-ui
- db-scheduler-ui-starter
- main-SNAPSHOT
+ org.junit.jupiter
+ junit-jupiter
+ test
+
+
+ org.junit.jupiter
+ junit-jupiter-api
+ test
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+ org.springframework.boot
+ spring-boot-test
+ test
diff --git a/pom.xml b/pom.xml
index 1baacc3d..82f6f821 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1,7 +1,5 @@
-
+
4.0.0
no.bekk.db-scheduler-ui
db-scheduler-ui-parent
@@ -13,14 +11,6 @@
https://github.com/bekk/db-scheduler-ui
2023
-
- 11
- 2.7.18
- 14.0.0
- UTF-8
-
-
-
The Apache Software License, Version 2.0
@@ -52,25 +42,46 @@
+
+ db-scheduler-ui
+ db-scheduler-ui-starter
+ example-app
+ example-app-webflux
+
+
scm:git:https://github.com/bekk/db-scheduler-ui.git
scm:git:https://github.com/bekk/db-scheduler-ui.git
- https://github.com/bekk/db-scheduler-ui.git
HEAD
+ https://github.com/bekk/db-scheduler-ui.git
+
+
+ ossrh
+ https://oss.sonatype.org/service/local/staging/deploy/maven2/
+
+
+ ossrh
+ https://oss.sonatype.org/content/repositories/snapshots
+
+
+
+
+ 11
+ 2.7.18
+ 14.0.0
+ UTF-8
+
- com.github.kagkarlsson
- db-scheduler
- ${db-scheduler.version}
-
-
- com.github.kagkarlsson
- db-scheduler-spring-boot-starter
- ${db-scheduler.version}
+ org.junit
+ junit-bom
+ 5.10.2
+ pom
+ import
@@ -81,15 +92,26 @@
import
- org.junit
- junit-bom
- 5.10.2
- pom
- import
+ com.github.kagkarlsson
+ db-scheduler
+ ${db-scheduler.version}
+
+
+ com.github.kagkarlsson
+ db-scheduler-spring-boot-starter
+ ${db-scheduler.version}
+
+
+ org.projectlombok
+ lombok
+ provided
+
+
+
@@ -149,8 +171,10 @@
- src/main/java/**/*.java
- src/test/java/**/*.java
+ src/test/java/**/*.java
+
@@ -165,9 +189,22 @@
-
+
+ com.github.ekryd.sortpom
+ sortpom-maven-plugin
+ 3.3.0
+
+ 4
+ false
+ scope,groupId,artifactId
+ false
+
+
maven-javadoc-plugin
+
+ none
+
attach-javadocs
@@ -176,9 +213,6 @@
-
- none
-
org.apache.maven.plugins
@@ -214,9 +248,7 @@
ALWAYS
https://oss.sonatype.org/service/local/
-
- https://oss.sonatype.org/content/repositories/snapshots
-
+ https://oss.sonatype.org/content/repositories/snapshots
true
true
target/staging-deploy
@@ -296,10 +328,10 @@
npm-build
- generate-resources
exec
+ generate-resources
npm
@@ -317,13 +349,13 @@
copy-files-to-backend
- process-classes
copy-resources
+ process-classes
UTF-8
- db-scheduler-ui/src/main/resources/static/db-scheduler-ui
+ db-scheduler-ui/src/main/resources/static/db-scheduler
db-scheduler-ui-frontend/dist
@@ -337,24 +369,6 @@
-
- db-scheduler-ui
- db-scheduler-ui-starter
- example-app
- example-app-webflux
-
-
-
-
- ossrh
- https://oss.sonatype.org/content/repositories/snapshots
-
-
- ossrh
- https://oss.sonatype.org/service/local/staging/deploy/maven2/
-
-
-
publication
@@ -398,4 +412,4 @@
-
\ No newline at end of file
+