Repository: jhipster/jhipster-lite
Pull request #11141 (2024-10-17 16:21:34)

Align JHLite properties
- fix https://github.com/jhipster/jhipster-lite/issues/11104


Patch:
diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactory.java
index 1e95ea981..37d764594 100644
--- a/src/main/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactory.java
@@ -54,7 +54,7 @@ public class CustomJHLiteModuleFactory {
   private static final PropertyKey SERVER_PORT_KEY = propertyKey("server.port");
   private static final PropertyKey JACKSON_INCLUSION_KEY = propertyKey("spring.jackson.default-property-inclusion");
 
-  private static final PropertyKey HIDDEN_SLUGS_PROPERTY_KEY = propertyKey("jhlite-hidden-resources.slugs");
+  private static final PropertyKey HIDDEN_SLUGS_PROPERTY_KEY = propertyKey("jhlite.hidden-resources.slugs");
   private static final PropertyKey BEAN_DEFINITION_OVERRIDING_PROPERTY_KEY = propertyKey("spring.main.allow-bean-definition-overriding");
   private static final String PACKAGE_INFO_JAVA = "package-info.java";
 
diff --git a/src/main/java/tech/jhipster/lite/module/infrastructure/secondary/FileSystemJHipsterPresetRepository.java b/src/main/java/tech/jhipster/lite/module/infrastructure/secondary/FileSystemJHipsterPresetRepository.java
index 859237871..cd7cd7907 100644
--- a/src/main/java/tech/jhipster/lite/module/infrastructure/secondary/FileSystemJHipsterPresetRepository.java
+++ b/src/main/java/tech/jhipster/lite/module/infrastructure/secondary/FileSystemJHipsterPresetRepository.java
@@ -23,7 +23,7 @@ class FileSystemJHipsterPresetRepository implements JHipsterPresetRepository {
   public FileSystemJHipsterPresetRepository(
     ObjectMapper json,
     ProjectFiles projectFiles,
-    @Value("${jhlite-preset-file.name:preset.json}") String presetFileName
+    @Value("${jhlite.preset-file.name:preset.json}") String presetFileName
   ) {
     this.json = json;
     this.projectFiles = projectFiles;
diff --git a/src/main/java/tech/jhipster/lite/module/infrastructure/secondary/JHipsterHiddenResourcesProperties.java b/src/main/java/tech/jhipster/lite/module/infrastructure/secondary/JHipsterHiddenResourcesProperties.java
index e7357a695..0c0ef31c7 100644
--- a/src/main/java/tech/jhipster/lite/module/infrastructure/secondary/JHipsterHiddenResourcesProperties.java
+++ b/src/main/java/tech/jhipster/lite/module/infrastructure/secondary/JHipsterHiddenResourcesProperties.java
@@ -3,7 +3,7 @@ package tech.jhipster.lite.module.infrastructure.secondary;
 import java.util.Collection;
 import org.springframework.boot.context.properties.ConfigurationProperties;
 
-@ConfigurationProperties("jhlite-hidden-resources")
+@ConfigurationProperties("jhlite.hidden-resources")
 class JHipsterHiddenResourcesProperties {
 
   private Collection<String> slugs;
diff --git a/src/main/java/tech/jhipster/lite/shared/projectfolder/infrastructure/primary/ProjectFolderConfiguration.java b/src/main/java/tech/jhipster/lite/shared/projectfolder/infrastructure/primary/ProjectFolderConfiguration.java
index 303dd9330..4aa0c17bc 100644
--- a/src/main/java/tech/jhipster/lite/shared/projectfolder/infrastructure/primary/ProjectFolderConfiguration.java
+++ b/src/main/java/tech/jhipster/lite/shared/projectfolder/infrastructure/primary/ProjectFolderConfiguration.java
@@ -12,13 +12,13 @@ import tech.jhipster.lite.shared.projectfolder.domain.ProjectFolder;
 class ProjectFolderConfiguration {
 
   @Bean
-  @ConditionalOnProperty(value = "application.forced-project-folder")
-  ProjectFolder forcedProjectFolder(@Value("${application.forced-project-folder}") String forcedProjectFolder) {
+  @ConditionalOnProperty(value = "jhlite.forced-project-folder")
+  ProjectFolder forcedProjectFolder(@Value("${jhlite.forced-project-folder}") String forcedProjectFolder) {
     return new ForcedProjectFolder(forcedProjectFolder);
   }
 
   @Bean
-  @ConditionalOnProperty(value = "application.forced-project-folder", matchIfMissing = true, havingValue = "dummy")
+  @ConditionalOnProperty(value = "jhlite.forced-project-folder", matchIfMissing = true, havingValue = "dummy")
   ProjectFolder freeProjectFolder() {
     return new FreeProjectFolder();
   }
diff --git a/src/main/resources/config/application-angular.yml b/src/main/resources/config/application-angular.yml
index dc988756c..6f02dba13 100644
--- a/src/main/resources/config/application-angular.yml
+++ b/src/main/resources/config/application-angular.yml
@@ -1,5 +1,7 @@
-jhlite-hidden-resources.slugs:
-  - spring-boot-kafka-sample-producer-consumer
-  - react-core
-  - svelte-core
-  - vue-core
+jhlite:
+  hidden-resources:
+    slugs:
+      - spring-boot-kafka-sample-producer-consumer
+      - react-core
+      - svelte-core
+      - vue-core
diff --git a/src/main/resources/config/application-cloud.yml b/src/main/resources/config/application-cloud.yml
index 273aa8e5b..75e85cd35 100644
--- a/src/main/resources/config/application-cloud.yml
+++ b/src/main/resources/config/application-cloud.yml
@@ -8,6 +8,8 @@ application:
     exposed-headers: 'Authorization,Link,X-Total-Count'
     allow-credentials: true
     max-age: 1800
+
+jhlite:
   forced-project-folder: /tmp/jhlite
 
 server:
diff --git a/src/main/resources/config/application-react.yml b/src/main/resources/config/application-react.yml
index e2c73a92b..d4d1331c4 100644
--- a/src/main/resources/config/application-react.yml
+++ b/src/main/resources/config/application-react.yml
@@ -1,5 +1,7 @@
-jhlite-hidden-resources.slugs:
-  - spring-boot-kafka-sample-producer-consumer
-  - angular-core
-  - svelte-core
-  - vue-core
+jhlite:
+  hidden-resources:
+    slugs:
+      - spring-boot-kafka-sample-producer-consumer
+      - angular-core
+      - svelte-core
+      - vue-core
diff --git a/src/main/resources/config/application-vue.yml b/src/main/resources/config/application-vue.yml
index 3019da9ad..435b1e0d9 100644
--- a/src/main/resources/config/application-vue.yml
+++ b/src/main/resources/config/application-vue.yml
@@ -1,5 +1,7 @@
-jhlite-hidden-resources.slugs:
-  - spring-boot-kafka-sample-producer-consumer
-  - angular-core
-  - react-core
-  - svelte-core
+jhlite:
+  hidden-resources:
+    slugs:
+      - spring-boot-kafka-sample-producer-consumer
+      - angular-core
+      - react-core
+      - svelte-core
diff --git a/src/main/resources/config/application.yml b/src/main/resources/config/application.yml
index eac327a21..61bdf5b05 100644
--- a/src/main/resources/config/application.yml
+++ b/src/main/resources/config/application.yml
@@ -63,14 +63,14 @@ application:
   version: '@project.version@'
   cmd:
     timeout: 120
-#  forced-project-folder: /tmp/jhlite
 
-jhlite-hidden-resources:
-  slugs:
-    - svelte-core
-
-jhlite-preset-file:
-  name: preset.json
+jhlite:
+  #  forced-project-folder: /tmp/jhlite
+  hidden-resources:
+    slugs:
+      - svelte-core
+  preset-file:
+    name: preset.json
 
 server:
   port: 7471
diff --git a/src/main/resources/generator/server/springboot/custom-jhlite/module-creation.md.mustache b/src/main/resources/generator/server/springboot/custom-jhlite/module-creation.md.mustache
index 40197abb5..d01596a95 100644
--- a/src/main/resources/generator/server/springboot/custom-jhlite/module-creation.md.mustache
+++ b/src/main/resources/generator/server/springboot/custom-jhlite/module-creation.md.mustache
@@ -209,8 +209,8 @@ In your `JHipsterModuleResource` you can define additional properties and an org
 
 You can hide modules from your custom instance in project configuration with:
 
-- `jhlite-hidden-resources.slugs`: To disable including its dependencies by slugs
-- `jhlite-hidden-resources.tags`: To disable by tags
+- `jhlite.hidden-resources.slugs`: To disable including its dependencies by slugs
+- `jhlite.hidden-resources.tags`: To disable by tags
 
 ## Docker versions
 


Test patch:
diff --git a/src/test/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactoryTest.java
index ac542bb29..4d7fffb64 100644
--- a/src/test/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/server/springboot/customjhlite/domain/CustomJHLiteModuleFactoryTest.java
@@ -78,9 +78,10 @@ class CustomJHLiteModuleFactoryTest {
       .hasFile("src/main/resources/config/application.yml")
         .containing(
           """
-          jhlite-hidden-resources:
-            # Disable the modules and its dependencies by slugs
-            slugs: custom-jhlite
+          jhlite:
+            hidden-resources:
+              # Disable the modules and its dependencies by slugs
+              slugs: custom-jhlite
           server:
             port: 9000
           spring:
diff --git a/src/test/java/tech/jhipster/lite/shared/projectfolder/infrastructure/primary/ForcedProjectFolderPrefixIT.java b/src/test/java/tech/jhipster/lite/shared/projectfolder/infrastructure/primary/ForcedProjectFolderPrefixIT.java
index 721a76119..3f4139c21 100644
--- a/src/test/java/tech/jhipster/lite/shared/projectfolder/infrastructure/primary/ForcedProjectFolderPrefixIT.java
+++ b/src/test/java/tech/jhipster/lite/shared/projectfolder/infrastructure/primary/ForcedProjectFolderPrefixIT.java
@@ -13,7 +13,7 @@ import org.springframework.test.web.servlet.MockMvc;
 import tech.jhipster.lite.IntegrationTest;
 
 @AutoConfigureMockMvc
-@IntegrationTest(properties = "application.forced-project-folder=/tmp/forced")
+@IntegrationTest(properties = "jhlite.forced-project-folder=/tmp/forced")
 class ForcedProjectFolderPrefixIT {
 
   private static final String SEPARATOR = FileSystems.getDefault().getSeparator();
diff --git a/src/test/resources/config/application-test.yml b/src/test/resources/config/application-test.yml
index 6968fb62e..fd89aa34b 100644
--- a/src/test/resources/config/application-test.yml
+++ b/src/test/resources/config/application-test.yml
@@ -10,12 +10,12 @@ application:
       - http://localhost:8100
       - http://localhost:9000
 
-jhlite-hidden-resources:
-  tags:
-  slugs:
-
-jhlite-preset-file:
-  name: preset.json
+jhlite:
+  hidden-resources:
+    slugs:
+    tags:
+  preset-file:
+    name: preset.json
 
 server:
   port: 0