You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fineract.apache.org by pt...@apache.org on 2022/01/06 04:49:19 UTC
[fineract] branch develop updated: FINERACT-1480: Fix Swagger UI broken by incremental build
This is an automated email from the ASF dual-hosted git repository.
ptuomola pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/fineract.git
The following commit(s) were added to refs/heads/develop by this push:
new 4d879ed FINERACT-1480: Fix Swagger UI broken by incremental build
4d879ed is described below
commit 4d879eddc469f3fdb8b1d0608525c89d0ec0de12
Author: Petri Tuomola <pe...@tuomola.org>
AuthorDate: Thu Jan 6 06:17:36 2022 +0800
FINERACT-1480: Fix Swagger UI broken by incremental build
---
fineract-provider/build.gradle | 10 ++++++++++
.../infrastructure/core/boot/WebFrontEndConfiguration.java | 3 ++-
fineract-war/build.gradle | 4 ----
.../org/apache/fineract/integrationtests/SwaggeruiTest.java | 1 +
4 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/fineract-provider/build.gradle b/fineract-provider/build.gradle
index bc7af4f..b72e862 100644
--- a/fineract-provider/build.gradle
+++ b/fineract-provider/build.gradle
@@ -247,6 +247,8 @@ bootRun {
dependencies {
implementation 'org.mariadb.jdbc:mariadb-java-client:2.7.3'
}
+
+ classpath += files("build/generated/swagger-ui")
}
springBoot {
@@ -266,6 +268,14 @@ bootJar {
}
}
+jar {
+ from('build/generated/swagger-ui') {
+ include '*'
+ }
+}
+
+jar.dependsOn resolve
+
jib {
from {
image = 'azul/zulu-openjdk-alpine:17'
diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java
index 05ee0cb..6bea470 100644
--- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java
+++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/core/boot/WebFrontEndConfiguration.java
@@ -46,7 +46,8 @@ public class WebFrontEndConfiguration implements WebMvcConfigurer {
LOG.info("Found Swagger UI at {}", fullPathToSwaggerUiJs);
String fullPathToSwaggerUi = fullPathToSwaggerUiJs.substring(0, fullPathToSwaggerUiJs.lastIndexOf("/") + 1);
- final String[] swaggerResourceLocations = { "classpath:/static/swagger-ui/", "classpath:" + fullPathToSwaggerUi };
+ final String[] swaggerResourceLocations = { "classpath:/static/swagger-ui/", "classpath:fineract.yaml",
+ "classpath:" + fullPathToSwaggerUi };
registry.addResourceHandler("/swagger-ui/**").addResourceLocations(swaggerResourceLocations);
}
diff --git a/fineract-war/build.gradle b/fineract-war/build.gradle
index 6fca309..e45cbb5 100644
--- a/fineract-war/build.gradle
+++ b/fineract-war/build.gradle
@@ -43,10 +43,6 @@ war {
}
enabled = true
classifier = ''
-
- from('$rootDir/fineract-provider/build/generated/swagger-ui') {
- into 'BOOT-INF/classes/static/swagger-ui'
- }
}
dependencies {
diff --git a/integration-tests/src/test/java/org/apache/fineract/integrationtests/SwaggeruiTest.java b/integration-tests/src/test/java/org/apache/fineract/integrationtests/SwaggeruiTest.java
index da606ad..51744ec 100644
--- a/integration-tests/src/test/java/org/apache/fineract/integrationtests/SwaggeruiTest.java
+++ b/integration-tests/src/test/java/org/apache/fineract/integrationtests/SwaggeruiTest.java
@@ -46,6 +46,7 @@ public class SwaggeruiTest {
public void testSwaggeruiAccess() {
Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/swagger-ui", null);
Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/swagger-ui/index.html", null);
+ Utils.performServerGet(requestSpec, responseSpec, "/fineract-provider/swagger-ui/fineract.yaml", null);
}
}