diff --git a/documentation/module-creation.md b/documentation/module-creation.md index bf6b5ee9a09..2121dcef3e2 100644 --- a/documentation/module-creation.md +++ b/documentation/module-creation.md @@ -118,7 +118,7 @@ class MyModuleModuleConfiguration { ) { return JHipsterModuleResource .builder() - .slug("my-module") + .slug(JHLiteModuleSlug.MY_MODULE) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().build()) .apiDoc("Group", "This is my module") .standalone() diff --git a/src/main/java/tech/jhipster/lite/generator/JHLiteFeatureSlug.java b/src/main/java/tech/jhipster/lite/generator/JHLiteFeatureSlug.java new file mode 100644 index 00000000000..fa12c9042cc --- /dev/null +++ b/src/main/java/tech/jhipster/lite/generator/JHLiteFeatureSlug.java @@ -0,0 +1,33 @@ +package tech.jhipster.lite.generator; + +import tech.jhipster.lite.module.domain.resource.JHipsterFeatureSlugFactory; + +public enum JHLiteFeatureSlug implements JHipsterFeatureSlugFactory { + ANGULAR_AUTHENTICATION("angular-authentication"), + AUTHENTICATION("authentication"), + BANNER("banner"), + CACHE("cache"), + CLIENT_CORE("client-core"), + CUCUMBER_AUTHENTICATION("cucumber-authentication"), + DATABASE_MIGRATION("database-migration"), + DUMMY_PERSISTENCE("dummy-persistence"), + DUMMY_SCHEMA("dummy-schema"), + FRONT_BROWSER_TEST("front-browser-test"), + JAVA_BUILD_TOOL("java-build-tool"), + JPA_PERSISTENCE("jpa-persistence"), + SERVICE_DISCOVERY("service-discovery"), + SPRING_SERVER("spring-server"), + SPRINGDOC("springdoc"), + WEB_ERROR_MANAGEMENT("web-error-management"); + + private final String slug; + + JHLiteFeatureSlug(String slug) { + this.slug = slug; + } + + @Override + public String get() { + return slug; + } +} diff --git a/src/main/java/tech/jhipster/lite/generator/JHLiteModuleSlug.java b/src/main/java/tech/jhipster/lite/generator/JHLiteModuleSlug.java new file mode 100644 index 00000000000..cde5cba346a --- /dev/null +++ b/src/main/java/tech/jhipster/lite/generator/JHLiteModuleSlug.java @@ -0,0 +1,108 @@ +package tech.jhipster.lite.generator; + +import tech.jhipster.lite.module.domain.resource.JHipsterModuleSlugFactory; + +public enum JHLiteModuleSlug implements JHipsterModuleSlugFactory { + ANGULAR_CORE("angular-core"), + ANGULAR_HEALTH("angular-health"), + ANGULAR_JWT("angular-jwt"), + ANGULAR_OAUTH_2("angular-oauth2"), + APPLICATION_SERVICE_HEXAGONAL_ARCHITECTURE_DOCUMENTATION("application-service-hexagonal-architecture-documentation"), + BANNER_JHIPSTER_V2("banner-jhipster-v2"), + BANNER_JHIPSTER_V3("banner-jhipster-v3"), + BANNER_JHIPSTER_V7("banner-jhipster-v7"), + BANNER_JHIPSTER_V7_REACT("banner-jhipster-v7-react"), + BANNER_JHIPSTER_V7_VUE("banner-jhipster-v7-vue"), + CONSUL("consul"), + CUSTOM_JHLITE("custom-jhlite"), + CYPRESS("cypress"), + DOCKERFILE("dockerfile"), + DUMMY_FEATURE("dummy-feature"), + DUMMY_JPA_PERSISTENCE("dummy-jpa-persistence"), + DUMMY_LIQUIBASE_CHANGELOG("dummy-liquibase-changelog"), + DUMMY_MONGODB_PERSITENCE("dummy-mongodb-persistence"), + DUMMY_NOT_POSTGRESQL_FLYWAY_CHANGELOG("dummy-not-postgresql-flyway-changelog"), + DUMMY_POSTGRESQL_FLYWAY_CHANGELOG("dummy-postgresql-flyway-changelog"), + EHCACHE_JAVA_CONFIG("ehcache-java-config"), + EHCACHE_XML_CONFIG("ehcache-xml-config"), + EUREKA_CLIENT("eureka-client"), + FLYWAY("flyway"), + FLYWAY_MYSQL("flyway-mysql"), + FRONTEND_MAVEN_PLUGIN("frontend-maven-plugin"), + GATEWAY("gateway"), + GITHUB_ACTIONS("github-actions"), + GITHUB_CODESPACES("github-codespaces"), + GITLAB_CI("gitlab-ci"), + GITPOD("gitpod"), + INFINITEST_FILTERS("infinitest-filters"), + INIT("init"), + JACOCO_CHECK_MIN_COVERAGE("jacoco-check-min-coverage"), + JAVA_ARCHUNIT("java-archunit"), + JAVA_BASE("java-base"), + JAVA_MEMOIZERS("java-memoizers"), + JIB("jib"), + JPA_PAGINATION("jpa-pagination"), + LIQUIBASE("liquibase"), + LOGSTASH("logstash"), + MARIADB("mariadb"), + MAVEN_JAVA("maven-java"), + MAVEN_WRAPPER("maven-wrapper"), + MONGOCK("mongock"), + MONGODB("mongodb"), + MSSQL("mssql"), + MYSQL("mysql"), + PAGINATION_DOMAIN("pagination-domain"), + PLAYWRIGHT("playwright"), + POSTGRESQL("postgresql"), + PRETTIER("prettier"), + REACT_CORE("react-core"), + REACT_JWT("react-jwt"), + REST_PAGINATION("rest-pagination"), + SONAR_JAVA_BACKEND("sonar-java-backend"), + SONAR_JAVA_BACKEND_AND_FRONTEND("sonar-java-backend-and-frontend"), + SPRING_BOOT("spring-boot"), + SPRING_BOOT_ACTUATOR("spring-boot-actuator"), + SPRING_BOOT_ASYNC("spring-boot-async"), + SPRING_BOOT_CACHE("spring-boot-cache"), + SPRING_BOOT_CUCUMBER("spring-boot-cucumber"), + SPRING_BOOT_CUCUMBER_JPA_RESET("spring-boot-cucumber-jpa-reset"), + SPRING_BOOT_CUCUMBER_JWT_AUTHENTICATION("spring-boot-cucumber-jwt-authentication"), + SPRING_BOOT_CUCUMBER_OAUTH_2_AUTHENTICATION("spring-boot-cucumber-oauth2-authentication"), + SPRING_BOOT_DEVTOOLS("spring-boot-devtools"), + SPRING_BOOT_JWT("spring-boot-jwt"), + SPRING_BOOT_JWT_BASIC_AUTH("spring-boot-jwt-basic-auth"), + SPRING_BOOT_KAFKA("spring-boot-kafka"), + SPRING_BOOT_KAFKA_AKHQ("spring-boot-kafka-akhq"), + SPRING_BOOT_KAFKA_DUMMY_PRODUCER_CONSUMER("spring-boot-kafka-dummy-producer-consumer"), + SPRING_BOOT_OAUTH_2("spring-boot-oauth2"), + SPRING_BOOT_OAUTH_2_ACCOUNT("spring-boot-oauth2-account"), + SPRING_BOOT_OAUTH_2_AUTH_0("spring-boot-oauth2-auth0"), + SPRING_BOOT_OAUTH_2_OKTA("spring-boot-oauth2-okta"), + SPRING_BOOT_PULSAR("spring-boot-pulsar"), + SPRING_BOOT_TOMCAT("spring-boot-tomcat"), + SPRING_BOOT_UNDERTOW("spring-boot-undertow"), + SPRING_BOOT_WEBFLUX_NETTY("spring-boot-webflux-netty"), + SPRING_CLOUD("spring-cloud"), + SPRINGDOC_JWT("springdoc-jwt"), + SPRINGDOC_MVC_OPENAPI("springdoc-mvc-openapi"), + SPRINGDOC_OAUTH_2("springdoc-oauth2"), + SPRINGDOC_OAUTH_2_AUTH_0("springdoc-oauth2-auth0"), + SPRINGDOC_OAUTH_2_OKTA("springdoc-oauth2-okta"), + SPRINGDOC_WEBFLUX_OPENAPI("springdoc-webflux-openapi"), + SVELTE("svelte"), + TYPESCRIPT("typescript"), + VUE_CORE("vue-core"), + VUE_PINIA("vue-pinia"), + ZALANDO_PROBLEMS("zalando-problems"); + + private final String slug; + + JHLiteModuleSlug(String slug) { + this.slug = slug; + } + + @Override + public String get() { + return slug; + } +} diff --git a/src/main/java/tech/jhipster/lite/generator/buildtool/maven/infrastructure/primary/MavenModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/buildtool/maven/infrastructure/primary/MavenModuleConfiguration.java index cb421db5063..8a8bfccda32 100644 --- a/src/main/java/tech/jhipster/lite/generator/buildtool/maven/infrastructure/primary/MavenModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/buildtool/maven/infrastructure/primary/MavenModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.buildtool.maven.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.buildtool.maven.application.MavenApplicationService; @@ -14,10 +17,10 @@ class MavenModuleConfiguration { JHipsterModuleResource mavenModule(MavenApplicationService maven) { return JHipsterModuleResource .builder() - .slug("maven-java") + .slug(MAVEN_JAVA) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addProjectName().build()) .apiDoc("Build Tool", "Init Maven project with pom.xml and wrapper") - .organization(JHipsterModuleOrganization.builder().feature("java-build-tool").addModuleDependency("init").build()) + .organization(JHipsterModuleOrganization.builder().feature(JAVA_BUILD_TOOL).addDependency(INIT).build()) .tags("buildtool", "test") .factory(maven::buildMavenModule); } @@ -26,7 +29,7 @@ JHipsterModuleResource mavenModule(MavenApplicationService maven) { JHipsterModuleResource mavenWrapperModule(MavenApplicationService maven) { return JHipsterModuleResource .builder() - .slug("maven-wrapper") + .slug(MAVEN_WRAPPER) .withoutProperties() .apiDoc("Build Tool", "Add maven wrapper") .standalone() diff --git a/src/main/java/tech/jhipster/lite/generator/ci/github/actions/infrastructure/primary/GitHubActionsModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/ci/github/actions/infrastructure/primary/GitHubActionsModuleConfiguration.java index 6a79bf3794b..4e9ba14a5a0 100644 --- a/src/main/java/tech/jhipster/lite/generator/ci/github/actions/infrastructure/primary/GitHubActionsModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/ci/github/actions/infrastructure/primary/GitHubActionsModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.ci.github.actions.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.ci.github.actions.application.GitHubActionsApplicationService; @@ -13,10 +15,10 @@ class GitHubActionsModuleConfiguration { JHipsterModuleResource gutHubActionsModule(GitHubActionsApplicationService gitHubActions) { return JHipsterModuleResource .builder() - .slug("github-actions") + .slug(GITHUB_ACTIONS) .withoutProperties() .apiDoc("Continuous Integration", "Add GitHub Actions for Maven Build") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("maven-java").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(MAVEN_JAVA).build()) .tags("ci", "github") .factory(gitHubActions::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/ci/gitlab/infrastructure/primary/GitLabCiModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/ci/gitlab/infrastructure/primary/GitLabCiModuleConfiguration.java index 4363e24ce62..aabd7960065 100644 --- a/src/main/java/tech/jhipster/lite/generator/ci/gitlab/infrastructure/primary/GitLabCiModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/ci/gitlab/infrastructure/primary/GitLabCiModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.ci.gitlab.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.ci.gitlab.application.GitLabCiApplicationService; @@ -13,10 +15,10 @@ class GitLabCiModuleConfiguration { JHipsterModuleResource gitlabCiModule(GitLabCiApplicationService gitlabCi) { return JHipsterModuleResource .builder() - .slug("gitlab-ci") + .slug(GITLAB_CI) .withoutProperties() .apiDoc("Continuous Integration", "Add GitLab CI for Maven Build") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("maven-java").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(MAVEN_JAVA).build()) .tags("ci", "gitlab") .factory(gitlabCi::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/client/angular/admin/health/infrastructure/primary/AngularhealthModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/angular/admin/health/infrastructure/primary/AngularhealthModuleConfiguration.java index 1791a9bcadd..76b3b0315ba 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/angular/admin/health/infrastructure/primary/AngularhealthModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/angular/admin/health/infrastructure/primary/AngularhealthModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.client.angular.admin.health.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.client.angular.admin.health.application.AngularHealthApplicationService; @@ -13,10 +15,10 @@ class AngularhealthModuleConfiguration { JHipsterModuleResource angularHealthModule(AngularHealthApplicationService angularHealth) { return JHipsterModuleResource .builder() - .slug("angular-health") + .slug(ANGULAR_HEALTH) .withoutProperties() .apiDoc("Angular", "Angular Health") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("angular-core").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(ANGULAR_CORE).build()) .tags("client", "angular", "health") .factory(angularHealth::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/client/angular/core/infrastructure/primary/AngularCoreModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/angular/core/infrastructure/primary/AngularCoreModuleConfiguration.java index 06d80db4914..f6b80f7f3c6 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/angular/core/infrastructure/primary/AngularCoreModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/angular/core/infrastructure/primary/AngularCoreModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.client.angular.core.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.client.angular.core.application.AngularApplicationService; @@ -14,12 +17,10 @@ class AngularCoreModuleConfiguration { JHipsterModuleResource angularModule(AngularApplicationService angular) { return JHipsterModuleResource .builder() - .slug("angular-core") + .slug(ANGULAR_CORE) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addProjectName().build()) .apiDoc("Angular", "Add Angular + Angular CLI") - .organization( - JHipsterModuleOrganization.builder().feature("client-core").addModuleDependency("init").addModuleDependency("prettier").build() - ) + .organization(JHipsterModuleOrganization.builder().feature(CLIENT_CORE).addDependency(INIT).addDependency(PRETTIER).build()) .tags("client", "angular") .factory(angular::buildInitModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/client/angular/security/jwt/infrastructure/primary/AngularJwtModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/angular/security/jwt/infrastructure/primary/AngularJwtModuleConfiguration.java index cbbd45cc213..f9780aa050c 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/angular/security/jwt/infrastructure/primary/AngularJwtModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/angular/security/jwt/infrastructure/primary/AngularJwtModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.client.angular.security.jwt.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.client.angular.security.jwt.application.AngularJwtApplicationService; @@ -14,10 +17,10 @@ class AngularJwtModuleConfiguration { JHipsterModuleResource angularJwtModule(AngularJwtApplicationService angularJwt) { return JHipsterModuleResource .builder() - .slug("angular-jwt") + .slug(ANGULAR_JWT) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addProjectBaseName().addIndentation().build()) .apiDoc("Angular", "Add Angular with authentication JWT") - .organization(JHipsterModuleOrganization.builder().feature("angular-authentication").addModuleDependency("angular-core").build()) + .organization(JHipsterModuleOrganization.builder().feature(ANGULAR_AUTHENTICATION).addDependency(ANGULAR_CORE).build()) .tags("client", "angular") .factory(angularJwt::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/client/angular/security/oauth2/infrastructure/primary/AngularOAuth2ModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/angular/security/oauth2/infrastructure/primary/AngularOAuth2ModuleConfiguration.java index eadf05995d7..e17a86b8162 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/angular/security/oauth2/infrastructure/primary/AngularOAuth2ModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/angular/security/oauth2/infrastructure/primary/AngularOAuth2ModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.client.angular.security.oauth2.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.client.angular.security.oauth2.application.AngularOauth2ApplicationService; @@ -14,10 +17,10 @@ class AngularOAuth2ModuleConfiguration { JHipsterModuleResource angularOAuth2Module(AngularOauth2ApplicationService angularOAuth2) { return JHipsterModuleResource .builder() - .slug("angular-oauth2") + .slug(ANGULAR_OAUTH_2) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addIndentation().build()) .apiDoc("Angular", "Add OAuth2 authentication") - .organization(JHipsterModuleOrganization.builder().feature("angular-authentication").addModuleDependency("angular-core").build()) + .organization(JHipsterModuleOrganization.builder().feature(ANGULAR_AUTHENTICATION).addDependency(ANGULAR_CORE).build()) .tags("client", "angular") .factory(angularOAuth2::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/client/react/core/infrastructure/primary/ReactCoreModulesConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/react/core/infrastructure/primary/ReactCoreModulesConfiguration.java index 3c1e4ae94dd..95934c291b3 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/react/core/infrastructure/primary/ReactCoreModulesConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/react/core/infrastructure/primary/ReactCoreModulesConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.client.react.core.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.client.react.core.application.ReactCoreApplicationService; @@ -16,12 +19,10 @@ class ReactCoreModulesConfiguration { JHipsterModuleResource reactCoreModule(ReactCoreApplicationService react) { return JHipsterModuleResource .builder() - .slug("react-core") + .slug(REACT_CORE) .propertiesDefinition(properties()) .apiDoc("React", "Add React+Vite with minimal CSS") - .organization( - JHipsterModuleOrganization.builder().feature("client-core").addModuleDependency("init").addModuleDependency("prettier").build() - ) + .organization(JHipsterModuleOrganization.builder().feature(CLIENT_CORE).addDependency(INIT).addDependency(PRETTIER).build()) .tags("client", REACT) .factory(react::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/client/react/security/jwt/infrastructure/primary/ReactJwtModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/react/security/jwt/infrastructure/primary/ReactJwtModuleConfiguration.java index c5498abc7ec..2ac86a9bc4c 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/react/security/jwt/infrastructure/primary/ReactJwtModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/react/security/jwt/infrastructure/primary/ReactJwtModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.client.react.security.jwt.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.client.react.security.jwt.application.ReactJwtApplicationService; @@ -14,10 +16,10 @@ class ReactJwtModuleConfiguration { JHipsterModuleResource reactJwtModule(ReactJwtApplicationService reactJwt) { return JHipsterModuleResource .builder() - .slug("react-jwt") + .slug(REACT_JWT) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addIndentation().build()) .apiDoc("React", "Add JWT Login React") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("react-core").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(REACT_CORE).build()) .tags("client", "react", "jwt") .factory(reactJwt::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/client/svelte/core/infrastructure/primary/SvelteModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/svelte/core/infrastructure/primary/SvelteModuleConfiguration.java index d4689b9e772..b5ccd90745b 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/svelte/core/infrastructure/primary/SvelteModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/svelte/core/infrastructure/primary/SvelteModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.client.svelte.core.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.client.svelte.core.application.SvelteApplicationService; @@ -13,12 +16,10 @@ public class SvelteModuleConfiguration { JHipsterModuleResource svelteModule(SvelteApplicationService svelteApplicationService) { return JHipsterModuleResource .builder() - .slug("svelte") + .slug(SVELTE) .withoutProperties() .apiDoc("Svelte", "Add Svelte") - .organization( - JHipsterModuleOrganization.builder().feature("client-core").addModuleDependency("init").addModuleDependency("prettier").build() - ) + .organization(JHipsterModuleOrganization.builder().feature(CLIENT_CORE).addDependency(INIT).addDependency(PRETTIER).build()) .tags("client", "svelte") .factory(svelteApplicationService::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/infrastructure/primary/CypressModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/infrastructure/primary/CypressModuleConfiguration.java index 92fe4284a3b..5f6595ff09a 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/infrastructure/primary/CypressModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/infrastructure/primary/CypressModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.client.tools.cypress.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.client.tools.cypress.application.CypressApplicationService; @@ -14,10 +17,10 @@ class CypressModuleConfiguration { JHipsterModuleResource cypresModule(CypressApplicationService cypress) { return JHipsterModuleResource .builder() - .slug("cypress") + .slug(CYPRESS) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addServerPort().addIndentation().build()) .apiDoc("E2e", "Add Cypress") - .organization(JHipsterModuleOrganization.builder().feature("front-browser-test").addModuleDependency("init").build()) + .organization(JHipsterModuleOrganization.builder().feature(FRONT_BROWSER_TEST).addDependency(INIT).build()) .tags("client", "test", "cypress", "e2e") .factory(cypress::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/infrastructure/primary/PlaywrightModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/infrastructure/primary/PlaywrightModuleConfiguration.java index d93d95276da..c6ae3e99cf6 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/infrastructure/primary/PlaywrightModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/tools/playwright/infrastructure/primary/PlaywrightModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.client.tools.playwright.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.client.tools.playwright.application.PlaywrightApplicationService; @@ -14,10 +17,10 @@ class PlaywrightModuleConfiguration { JHipsterModuleResource playwrightModule(PlaywrightApplicationService playwright) { return JHipsterModuleResource .builder() - .slug("playwright") + .slug(PLAYWRIGHT) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addServerPort().build()) .apiDoc("E2e", "Add Playwright") - .organization(JHipsterModuleOrganization.builder().feature("front-browser-test").addModuleDependency("init").build()) + .organization(JHipsterModuleOrganization.builder().feature(FRONT_BROWSER_TEST).addDependency(INIT).build()) .tags("client", "test", "playwright", "e2e") .factory(playwright::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/client/vue/core/infrastructure/primary/VueModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/client/vue/core/infrastructure/primary/VueModuleConfiguration.java index 445e4a52d24..a7737c280a6 100644 --- a/src/main/java/tech/jhipster/lite/generator/client/vue/core/infrastructure/primary/VueModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/client/vue/core/infrastructure/primary/VueModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.client.vue.core.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.client.vue.core.application.VueApplicationService; @@ -14,12 +17,10 @@ class VueModuleConfiguration { JHipsterModuleResource vueCoreModule(VueApplicationService vue) { return JHipsterModuleResource .builder() - .slug("vue-core") + .slug(VUE_CORE) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addIndentation().build()) .apiDoc("Vue", "Add Vue+Vite") - .organization( - JHipsterModuleOrganization.builder().feature("client-core").addModuleDependency("init").addModuleDependency("prettier").build() - ) + .organization(JHipsterModuleOrganization.builder().feature(CLIENT_CORE).addDependency(INIT).addDependency(PRETTIER).build()) .tags("client", "init", "vue") .factory(vue::buildVueModule); } @@ -28,10 +29,10 @@ JHipsterModuleResource vueCoreModule(VueApplicationService vue) { JHipsterModuleResource vuePiniaModule(VueApplicationService vue) { return JHipsterModuleResource .builder() - .slug("vue-pinia") + .slug(VUE_PINIA) .withoutProperties() .apiDoc("Vue", "Add pinia for state management") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("vue-core").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(VUE_CORE).build()) .tags("client", "vue", "store") .factory(vue::buildPiniaModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/infinitest/infrastructure/primary/InfinitestModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/infinitest/infrastructure/primary/InfinitestModuleConfiguration.java index b6c15c0e342..982b3d67afd 100644 --- a/src/main/java/tech/jhipster/lite/generator/infinitest/infrastructure/primary/InfinitestModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/infinitest/infrastructure/primary/InfinitestModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.infinitest.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.infinitest.application.InfinitestApplicationService; @@ -12,7 +14,7 @@ class InfinitestModuleConfiguration { JHipsterModuleResource infinitestModule(InfinitestApplicationService infinitest) { return JHipsterModuleResource .builder() - .slug("infinitest-filters") + .slug(INFINITEST_FILTERS) .withoutProperties() .apiDoc("Base", "Add filter for infinitest") .standalone() diff --git a/src/main/java/tech/jhipster/lite/generator/init/infrastructure/primary/InitModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/init/infrastructure/primary/InitModuleConfiguration.java index 55021efbd6a..e07affec967 100644 --- a/src/main/java/tech/jhipster/lite/generator/init/infrastructure/primary/InitModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/init/infrastructure/primary/InitModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.init.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.init.application.InitApplicationService; @@ -13,7 +15,7 @@ class InitModuleConfiguration { JHipsterModuleResource initModule(InitApplicationService inits) { return JHipsterModuleResource .builder() - .slug("init") + .slug(INIT) .propertiesDefinition(initPropertiesDefinition()) .apiDoc("Init", "Init project") .standalone() diff --git a/src/main/java/tech/jhipster/lite/generator/prettier/infrastructure/primary/PrettierModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/prettier/infrastructure/primary/PrettierModuleConfiguration.java index 213de45b7d8..849c656a4ed 100644 --- a/src/main/java/tech/jhipster/lite/generator/prettier/infrastructure/primary/PrettierModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/prettier/infrastructure/primary/PrettierModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.prettier.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.prettier.application.PrettierApplicationService; @@ -14,10 +16,10 @@ class PrettierModuleConfiguration { JHipsterModuleResource prettierModule(PrettierApplicationService prettier) { return JHipsterModuleResource .builder() - .slug("prettier") + .slug(PRETTIER) .propertiesDefinition(initPropertiesDefinition()) .apiDoc("Prettier", "Format project with prettier") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("init").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(INIT).build()) .tags("server", "client", "init") .factory(prettier::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/hexagonaldocumentation/infrastructure/primary/HexagonalArchitectureDocumentationModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/hexagonaldocumentation/infrastructure/primary/HexagonalArchitectureDocumentationModuleConfiguration.java index 1590571af7e..8e22c30a01c 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/hexagonaldocumentation/infrastructure/primary/HexagonalArchitectureDocumentationModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/hexagonaldocumentation/infrastructure/primary/HexagonalArchitectureDocumentationModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.hexagonaldocumentation.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.hexagonaldocumentation.application.HexagonalArchitectureDocumentationApplicationService; @@ -14,7 +16,7 @@ JHipsterModuleResource hexagonalArchitectureDocumentationModule( ) { return JHipsterModuleResource .builder() - .slug("application-service-hexagonal-architecture-documentation") + .slug(APPLICATION_SERVICE_HEXAGONAL_ARCHITECTURE_DOCUMENTATION) .withoutProperties() .apiDoc("Spring Boot", "Add documentation for hexagonal architecture") .standalone() diff --git a/src/main/java/tech/jhipster/lite/generator/server/javatool/arch/infrastructure/primary/ArchUnitModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/javatool/arch/infrastructure/primary/ArchUnitModuleConfiguration.java index ce1d1b8d311..930d3b4fb37 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/javatool/arch/infrastructure/primary/ArchUnitModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/javatool/arch/infrastructure/primary/ArchUnitModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.javatool.arch.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.javatool.arch.application.JavaArchUnitApplicationService; @@ -14,10 +17,10 @@ class ArchUnitModuleConfiguration { JHipsterModuleResource archUnitModule(JavaArchUnitApplicationService archUnit) { return JHipsterModuleResource .builder() - .slug("java-archunit") + .slug(JAVA_ARCHUNIT) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Java", "Add Hexagonal Arch Unit Tests to project") - .organization(JHipsterModuleOrganization.builder().addFeatureDependency("java-build-tool").addModuleDependency("java-base").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(JAVA_BUILD_TOOL).addDependency(JAVA_BASE).build()) .tags("server", "test") .factory(archUnit::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/javatool/base/infrastructure/primary/JavaBaseModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/javatool/base/infrastructure/primary/JavaBaseModuleConfiguration.java index 33abe23d8b9..70fe28ce517 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/javatool/base/infrastructure/primary/JavaBaseModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/javatool/base/infrastructure/primary/JavaBaseModuleConfiguration.java @@ -1,7 +1,10 @@ package tech.jhipster.lite.generator.server.javatool.base.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import tech.jhipster.lite.generator.JHLiteModuleSlug; import tech.jhipster.lite.generator.server.javatool.base.application.JavaBaseApplicationService; import tech.jhipster.lite.module.domain.resource.JHipsterModuleOrganization; import tech.jhipster.lite.module.domain.resource.JHipsterModulePropertiesDefinition; @@ -14,10 +17,10 @@ class JavaBaseModuleConfiguration { JHipsterModuleResource javaBaseModule(JavaBaseApplicationService javaBase) { return JHipsterModuleResource .builder() - .slug("java-base") + .slug(JHLiteModuleSlug.JAVA_BASE) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().build()) .apiDoc("Java", "Add Base classes and Error domain to project") - .organization(JHipsterModuleOrganization.builder().addFeatureDependency("java-build-tool").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(JAVA_BUILD_TOOL).build()) .tags("server") .factory(javaBase::build); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/javatool/frontendmaven/infrastructure/primary/FrontendMavenModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/javatool/frontendmaven/infrastructure/primary/FrontendMavenModuleConfiguration.java index 4f4a5f8c446..d3bb43d153b 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/javatool/frontendmaven/infrastructure/primary/FrontendMavenModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/javatool/frontendmaven/infrastructure/primary/FrontendMavenModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.javatool.frontendmaven.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.javatool.frontendmaven.application.FrontendMavenApplicationService; @@ -14,12 +17,10 @@ class FrontendMavenModuleConfiguration { JHipsterModuleResource frontendMavenModule(FrontendMavenApplicationService frontendMaven) { return JHipsterModuleResource .builder() - .slug("frontend-maven-plugin") + .slug(FRONTEND_MAVEN_PLUGIN) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addIndentation().build()) .apiDoc("Frontend Maven Plugin", "Add Frontend Maven Plugin") - .organization( - JHipsterModuleOrganization.builder().addFeatureDependency("java-build-tool").addFeatureDependency("client-core").build() - ) + .organization(JHipsterModuleOrganization.builder().addDependency(JAVA_BUILD_TOOL).addDependency(CLIENT_CORE).build()) .tags("server", "tools") .factory(frontendMaven::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/javatool/jacoco/infrastructure/primary/JacocoThresholdModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/javatool/jacoco/infrastructure/primary/JacocoThresholdModuleConfiguration.java index 68e87d3b749..402b9d6821c 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/javatool/jacoco/infrastructure/primary/JacocoThresholdModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/javatool/jacoco/infrastructure/primary/JacocoThresholdModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.javatool.jacoco.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.javatool.jacoco.application.JacocoApplicationService; @@ -13,10 +16,10 @@ class JacocoThresholdModuleConfiguration { JHipsterModuleResource jacocoModuleThreshold(JacocoApplicationService jacoco) { return JHipsterModuleResource .builder() - .slug("jacoco-check-min-coverage") + .slug(JACOCO_CHECK_MIN_COVERAGE) .withoutProperties() .apiDoc("Java", "Add JaCoCo configuration to check minimum coverage") - .organization(JHipsterModuleOrganization.builder().addFeatureDependency("java-build-tool").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(JAVA_BUILD_TOOL).build()) .tags("server", "tools", "coverage") .factory(jacoco::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/javatool/memoizer/infrastructure/primary/JavaMemoizersModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/javatool/memoizer/infrastructure/primary/JavaMemoizersModuleConfiguration.java index 6a59b69a57f..894815ec130 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/javatool/memoizer/infrastructure/primary/JavaMemoizersModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/javatool/memoizer/infrastructure/primary/JavaMemoizersModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.javatool.memoizer.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.javatool.memoizer.application.JavaMemoizersApplicationService; @@ -14,10 +16,10 @@ class JavaMemoizersModuleConfiguration { JHipsterModuleResource javaMemoizersModule(JavaMemoizersApplicationService javaMemoizers) { return JHipsterModuleResource .builder() - .slug("java-memoizers") + .slug(JAVA_MEMOIZERS) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().build()) .apiDoc("Java", "Add simple memoizers factory") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("java-base").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(JAVA_BASE).build()) .tags("server") .factory(javaMemoizers::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/pagination/domainmodel/infrastructure/primary/PaginationDomainModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/pagination/domainmodel/infrastructure/primary/PaginationDomainModuleConfiguration.java index 1f1d1af38cc..085839169ab 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/pagination/domainmodel/infrastructure/primary/PaginationDomainModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/pagination/domainmodel/infrastructure/primary/PaginationDomainModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.pagination.domainmodel.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.pagination.domainmodel.application.PaginationDomainApplicationService; @@ -14,10 +16,10 @@ class PaginationDomainModuleConfiguration { public JHipsterModuleResource paginationDomainModule(PaginationDomainApplicationService paginationDomain) { return JHipsterModuleResource .builder() - .slug("pagination-domain") + .slug(PAGINATION_DOMAIN) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().build()) .apiDoc("Pagination", "Add domain model for pagination management") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("java-base").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(JAVA_BASE).build()) .tags("server") .factory(paginationDomain::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/pagination/jpa/infrastructure/primary/JpaPaginationModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/pagination/jpa/infrastructure/primary/JpaPaginationModuleConfiguration.java index 88fd73eda67..77053cb8666 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/pagination/jpa/infrastructure/primary/JpaPaginationModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/pagination/jpa/infrastructure/primary/JpaPaginationModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.pagination.jpa.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.pagination.jpa.application.JpaPaginationModuleApplicationService; @@ -14,12 +17,10 @@ class JpaPaginationModuleConfiguration { JHipsterModuleResource jpaPaginationModule(JpaPaginationModuleApplicationService jpaPagination) { return JHipsterModuleResource .builder() - .slug("jpa-pagination") + .slug(JPA_PAGINATION) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().build()) .apiDoc("Pagination", "Add utility class for JPA pagination") - .organization( - JHipsterModuleOrganization.builder().addModuleDependency("pagination-domain").addFeatureDependency("jpa-persistence").build() - ) + .organization(JHipsterModuleOrganization.builder().addDependency(PAGINATION_DOMAIN).addDependency(JPA_PERSISTENCE).build()) .tags("server") .factory(jpaPagination::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/pagination/rest/infrastructure/primary/RestPaginationModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/pagination/rest/infrastructure/primary/RestPaginationModuleConfiguration.java index 4f6ba649bc1..f8b2504a4e2 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/pagination/rest/infrastructure/primary/RestPaginationModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/pagination/rest/infrastructure/primary/RestPaginationModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.pagination.rest.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.pagination.rest.application.RestPaginationModuleApplicationService; @@ -14,10 +17,10 @@ class RestPaginationModuleConfiguration { JHipsterModuleResource restPaginationModule(RestPaginationModuleApplicationService restPagination) { return JHipsterModuleResource .builder() - .slug("rest-pagination") + .slug(REST_PAGINATION) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().build()) .apiDoc("Pagination", "Add rest models for pagination handling") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("pagination-domain").addFeatureDependency("springdoc").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(PAGINATION_DOMAIN).addDependency(SPRINGDOC).build()) .tags("server") .factory(restPagination::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/sonar/infrastructure/primary/SonarModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/sonar/infrastructure/primary/SonarModuleConfiguration.java index f7385a8a08a..27399be331b 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/sonar/infrastructure/primary/SonarModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/sonar/infrastructure/primary/SonarModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.sonar.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.sonar.application.SonarApplicationService; @@ -14,10 +17,10 @@ class SonarModuleConfiguration { JHipsterModuleResource sonarBackendModule(SonarApplicationService sonar) { return JHipsterModuleResource .builder() - .slug("sonar-java-backend") + .slug(SONAR_JAVA_BACKEND) .propertiesDefinition(propertiesDefinition()) .apiDoc("Sonar", "Add Sonar configuration for Java Backend to inspect code quality") - .organization(JHipsterModuleOrganization.builder().addFeatureDependency("java-build-tool").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(JAVA_BUILD_TOOL).build()) .tags("server", "sonar") .factory(sonar::buildBackendModule); } @@ -26,10 +29,10 @@ JHipsterModuleResource sonarBackendModule(SonarApplicationService sonar) { JHipsterModuleResource sonarBackendFrontendModule(SonarApplicationService sonar) { return JHipsterModuleResource .builder() - .slug("sonar-java-backend-and-frontend") + .slug(SONAR_JAVA_BACKEND_AND_FRONTEND) .propertiesDefinition(propertiesDefinition()) .apiDoc("Sonar", "Add Sonar configuration for Java Backend and Frontend to inspect code quality") - .organization(JHipsterModuleOrganization.builder().addFeatureDependency("java-build-tool").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(JAVA_BUILD_TOOL).build()) .tags("server", "sonar") .factory(sonar::buildBackendFrontendModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocauth0/infrastructure/primary/SpringDocAuth0ModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocauth0/infrastructure/primary/SpringDocAuth0ModuleConfiguration.java index 33e17857d02..34d78f3f466 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocauth0/infrastructure/primary/SpringDocAuth0ModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocauth0/infrastructure/primary/SpringDocAuth0ModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.apidocumentation.springdocauth0.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.apidocumentation.springdocauth0.application.SpringDocAuth0ApplicationService; @@ -14,12 +17,10 @@ class SpringDocAuth0ModuleConfiguration { JHipsterModuleResource springDocAuth0Module(SpringDocAuth0ApplicationService springdocAuth0) { return JHipsterModuleResource .builder() - .slug("springdoc-oauth2-auth0") + .slug(SPRINGDOC_OAUTH_2_AUTH_0) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - API Documentation", "Add Auth0 authentication for springdoc") - .organization( - JHipsterModuleOrganization.builder().addFeatureDependency("springdoc").addModuleDependency("spring-boot-oauth2-auth0").build() - ) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRINGDOC).addDependency(SPRING_BOOT_OAUTH_2_AUTH_0).build()) .tags("server", "swagger", "springdoc", "auth0") .factory(springdocAuth0::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdoccore/infrastructure/primary/SpringdocModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdoccore/infrastructure/primary/SpringdocModuleConfiguration.java index 47e5151acf3..d123108d25f 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdoccore/infrastructure/primary/SpringdocModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdoccore/infrastructure/primary/SpringdocModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.apidocumentation.springdoccore.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.apidocumentation.springdoccore.application.SpringdocApplicationService; @@ -21,10 +24,10 @@ class SpringdocModuleConfiguration { JHipsterModuleResource springdocMvcModule(SpringdocApplicationService springdocApplicationService) { return JHipsterModuleResource .builder() - .slug("springdoc-mvc-openapi") + .slug(SPRINGDOC_MVC_OPENAPI) .propertiesDefinition(buildPropertiesDefinition()) .apiDoc(API_GROUP, "Add springdoc-openapi for spring MVC") - .organization(JHipsterModuleOrganization.builder().feature("springdoc").addModuleDependency("spring-boot-tomcat").build()) + .organization(JHipsterModuleOrganization.builder().feature(SPRINGDOC).addDependency(SPRING_BOOT_TOMCAT).build()) .tags(SERVER_TAG, SPRING_TAG, SPRING_BOOT_TAG, DOCUMENTATION_TAG, SWAGGER_TAG) .factory(springdocApplicationService::buildSpringdocMvcModule); } @@ -33,10 +36,10 @@ JHipsterModuleResource springdocMvcModule(SpringdocApplicationService springdocA JHipsterModuleResource springdocWebfluxModule(SpringdocApplicationService springdocApplicationService) { return JHipsterModuleResource .builder() - .slug("springdoc-webflux-openapi") + .slug(SPRINGDOC_WEBFLUX_OPENAPI) .propertiesDefinition(buildPropertiesDefinition()) .apiDoc(API_GROUP, "Add springdoc-openapi for webflux") - .organization(JHipsterModuleOrganization.builder().feature("springdoc").addModuleDependency("spring-boot-webflux-netty").build()) + .organization(JHipsterModuleOrganization.builder().feature(SPRINGDOC).addDependency(SPRING_BOOT_WEBFLUX_NETTY).build()) .tags(SERVER_TAG, SPRING_TAG, SPRING_BOOT_TAG, DOCUMENTATION_TAG, SWAGGER_TAG) .factory(springdocApplicationService::buildSpringdocWebfluxModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocjwt/infrastructure/primary/SpringdocJwtModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocjwt/infrastructure/primary/SpringdocJwtModuleConfiguration.java index c5ee0f707e0..1cd8f6cb86b 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocjwt/infrastructure/primary/SpringdocJwtModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocjwt/infrastructure/primary/SpringdocJwtModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.apidocumentation.springdocjwt.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.apidocumentation.springdocjwt.application.SpringdocJwtApplicationService; @@ -14,10 +17,10 @@ class SpringdocJwtModuleConfiguration { JHipsterModuleResource springdocJwtModule(SpringdocJwtApplicationService springdocJwt) { return JHipsterModuleResource .builder() - .slug("springdoc-jwt") + .slug(SPRINGDOC_JWT) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - API Documentation", "Add JWT authentication for springdoc") - .organization(JHipsterModuleOrganization.builder().addFeatureDependency("springdoc").addModuleDependency("spring-boot-jwt").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRINGDOC).addDependency(SPRING_BOOT_JWT).build()) .tags("server", "swagger", "springdoc") .factory(springdocJwt::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocoauth/infrastructure/primary/SpringdocOauth2ModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocoauth/infrastructure/primary/SpringdocOauth2ModuleConfiguration.java index 2e6106a8827..486a23229e7 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocoauth/infrastructure/primary/SpringdocOauth2ModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocoauth/infrastructure/primary/SpringdocOauth2ModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.apidocumentation.springdocoauth.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.apidocumentation.springdocoauth.application.SpringdocOauth2ApplicationService; @@ -14,12 +17,10 @@ class SpringdocOauth2ModuleConfiguration { JHipsterModuleResource springDocOAuth2Module(SpringdocOauth2ApplicationService springdocOauth2) { return JHipsterModuleResource .builder() - .slug("springdoc-oauth2") + .slug(SPRINGDOC_OAUTH_2) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - API Documentation", "Add OAuth2 authentication for springdoc") - .organization( - JHipsterModuleOrganization.builder().addFeatureDependency("springdoc").addModuleDependency("spring-boot-oauth2").build() - ) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRINGDOC).addDependency(SPRING_BOOT_OAUTH_2).build()) .tags("server", "swagger", "springdoc") .factory(springdocOauth2::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocokta/infrastructure/primary/SpringDocOktaModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocokta/infrastructure/primary/SpringDocOktaModuleConfiguration.java index 142f450ba9a..61719e1c118 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocokta/infrastructure/primary/SpringDocOktaModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/apidocumentation/springdocokta/infrastructure/primary/SpringDocOktaModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.apidocumentation.springdocokta.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.apidocumentation.springdocokta.application.SpringDocOktaApplicationService; @@ -14,12 +17,10 @@ class SpringDocOktaModuleConfiguration { JHipsterModuleResource springDocOktaModule(SpringDocOktaApplicationService springdocOkta) { return JHipsterModuleResource .builder() - .slug("springdoc-oauth2-okta") + .slug(SPRINGDOC_OAUTH_2_OKTA) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - API Documentation", "Add Okta authentication for springdoc") - .organization( - JHipsterModuleOrganization.builder().addFeatureDependency("springdoc").addModuleDependency("spring-boot-oauth2-okta").build() - ) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRINGDOC).addDependency(SPRING_BOOT_OAUTH_2_OKTA).build()) .tags("server", "swagger", "springdoc", "okta") .factory(springdocOkta::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/async/infrastructure/primary/SpringBootAsyncModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/async/infrastructure/primary/SpringBootAsyncModuleConfiguration.java index 15a27f40a07..6209bd51fcb 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/async/infrastructure/primary/SpringBootAsyncModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/async/infrastructure/primary/SpringBootAsyncModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.async.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.async.application.SpringBootAsyncApplicationService; @@ -14,10 +16,10 @@ class SpringBootAsyncModuleConfiguration { JHipsterModuleResource springBootAsync(SpringBootAsyncApplicationService springBootAsync) { return JHipsterModuleResource .builder() - .slug("spring-boot-async") + .slug(SPRING_BOOT_ASYNC) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().build()) .apiDoc("Spring Boot - Tools", "Add asynchronous execution and scheduling configuration") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("spring-boot").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_BOOT).build()) .tags("server", "spring", "spring-boot", "async") .factory(springBootAsync::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/banner/infrastructure/primary/BannerModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/banner/infrastructure/primary/BannerModuleConfiguration.java index 6d6f2faea5d..71b41bcba8b 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/banner/infrastructure/primary/BannerModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/banner/infrastructure/primary/BannerModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.banner.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.banner.application.BannerApplicationService; @@ -12,18 +15,18 @@ class BannerModuleConfiguration { private static final String GROUP = "Spring Boot - Banner"; private static final String SERVER = "server"; private static final String SPRING = "spring"; - private static final String SPRING_BOOT = "spring-boot"; - private static final String BANNER = "banner"; + private static final String SPRING_BOOT_TAG = "spring-boot"; + private static final String BANNER_TAG = "banner"; @Bean JHipsterModuleResource jhipsterV7BannerResource(BannerApplicationService banners) { return JHipsterModuleResource .builder() - .slug("banner-jhipster-v7") + .slug(BANNER_JHIPSTER_V7) .withoutProperties() .apiDoc(GROUP, "Add banner JHipster v7 for Angular") .organization(organization()) - .tags(SERVER, SPRING, SPRING_BOOT, BANNER) + .tags(SERVER, SPRING, SPRING_BOOT_TAG, BANNER_TAG) .factory(banners::buildJHipsterV7Banner); } @@ -31,11 +34,11 @@ JHipsterModuleResource jhipsterV7BannerResource(BannerApplicationService banners JHipsterModuleResource jhipsterV7ReactBannerResource(BannerApplicationService banners) { return JHipsterModuleResource .builder() - .slug("banner-jhipster-v7-react") + .slug(BANNER_JHIPSTER_V7_REACT) .withoutProperties() .apiDoc(GROUP, "Add banner JHipster v7 for React") .organization(organization()) - .tags(SERVER, SPRING, SPRING_BOOT, BANNER) + .tags(SERVER, SPRING, SPRING_BOOT_TAG, BANNER_TAG) .factory(banners::buildJHipsterV7ReactBanner); } @@ -43,11 +46,11 @@ JHipsterModuleResource jhipsterV7ReactBannerResource(BannerApplicationService ba JHipsterModuleResource jhipsterV7VueBannerResource(BannerApplicationService banners) { return JHipsterModuleResource .builder() - .slug("banner-jhipster-v7-vue") + .slug(BANNER_JHIPSTER_V7_VUE) .withoutProperties() .apiDoc(GROUP, "Add banner JHipster v7 for Vue") .organization(organization()) - .tags(SERVER, SPRING, SPRING_BOOT, BANNER) + .tags(SERVER, SPRING, SPRING_BOOT_TAG, BANNER_TAG) .factory(banners::buildJHipsterV7VueBanner); } @@ -55,11 +58,11 @@ JHipsterModuleResource jhipsterV7VueBannerResource(BannerApplicationService bann JHipsterModuleResource jhipsterV2BannerResource(BannerApplicationService banners) { return JHipsterModuleResource .builder() - .slug("banner-jhipster-v2") + .slug(BANNER_JHIPSTER_V2) .withoutProperties() .apiDoc(GROUP, "Add banner JHipster v2") .organization(organization()) - .tags(SERVER, SPRING, SPRING_BOOT, BANNER) + .tags(SERVER, SPRING, SPRING_BOOT_TAG, BANNER_TAG) .factory(banners::buildJHipsterV2Banner); } @@ -67,15 +70,15 @@ JHipsterModuleResource jhipsterV2BannerResource(BannerApplicationService banners JHipsterModuleResource jhipsterV3BannerResource(BannerApplicationService banners) { return JHipsterModuleResource .builder() - .slug("banner-jhipster-v3") + .slug(BANNER_JHIPSTER_V3) .withoutProperties() .apiDoc(GROUP, "Add banner JHipster v3") .organization(organization()) - .tags(SERVER, SPRING, SPRING_BOOT, BANNER) + .tags(SERVER, SPRING, SPRING_BOOT_TAG, BANNER_TAG) .factory(banners::buildJHipsterV3Banner); } private JHipsterModuleOrganization organization() { - return JHipsterModuleOrganization.builder().feature(BANNER).addModuleDependency(SPRING_BOOT).build(); + return JHipsterModuleOrganization.builder().feature(BANNER).addDependency(SPRING_BOOT).build(); } } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/broker/kafka/infrastructure/primary/KafkaModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/broker/kafka/infrastructure/primary/KafkaModuleConfiguration.java index 63c065ac1ae..79b1fec5845 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/broker/kafka/infrastructure/primary/KafkaModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/broker/kafka/infrastructure/primary/KafkaModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.broker.kafka.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.broker.kafka.application.KafkaApplicationService; @@ -12,7 +14,7 @@ class KafkaModuleConfiguration { private static final String TAG = "Spring Boot - Broker"; private static final String BROKER = "broker"; - private static final String SPRING_BOOT = "spring-boot"; + private static final String SPRING_BOOT_TAG = "spring-boot"; private static final String SPRING = "spring"; private static final String SERVER = "server"; @@ -20,11 +22,11 @@ class KafkaModuleConfiguration { JHipsterModuleResource kafkaResourceInit(KafkaApplicationService kafkaApplicationService) { return JHipsterModuleResource .builder() - .slug("spring-boot-kafka") + .slug(SPRING_BOOT_KAFKA) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc(TAG, "Add Kafka dependencies, with testcontainers") - .organization(JHipsterModuleOrganization.builder().addModuleDependency(SPRING_BOOT).build()) - .tags(SERVER, SPRING, SPRING_BOOT, BROKER) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_BOOT).build()) + .tags(SERVER, SPRING, SPRING_BOOT_TAG, BROKER) .factory(kafkaApplicationService::init); } @@ -32,11 +34,11 @@ JHipsterModuleResource kafkaResourceInit(KafkaApplicationService kafkaApplicatio JHipsterModuleResource kafkaResourceDummyProducerConsumer(KafkaApplicationService kafkaApplicationService) { return JHipsterModuleResource .builder() - .slug("spring-boot-kafka-dummy-producer-consumer") + .slug(SPRING_BOOT_KAFKA_DUMMY_PRODUCER_CONSUMER) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc(TAG, "Add dummy Kafka producer and consumer") - .organization(kafkaDepdency()) - .tags(SERVER, SPRING, SPRING_BOOT, BROKER) + .organization(kafkaDependency()) + .tags(SERVER, SPRING, SPRING_BOOT_TAG, BROKER) .factory(kafkaApplicationService::addDummyProducerConsumer); } @@ -44,15 +46,15 @@ JHipsterModuleResource kafkaResourceDummyProducerConsumer(KafkaApplicationServic JHipsterModuleResource kafkaResourceAkhq(KafkaApplicationService kafkaApplicationService) { return JHipsterModuleResource .builder() - .slug("spring-boot-kafka-akhq") + .slug(SPRING_BOOT_KAFKA_AKHQ) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addIndentation().build()) .apiDoc(TAG, "Add AKHQ") - .organization(kafkaDepdency()) - .tags(SERVER, SPRING, SPRING_BOOT, BROKER) + .organization(kafkaDependency()) + .tags(SERVER, SPRING, SPRING_BOOT_TAG, BROKER) .factory(kafkaApplicationService::addAkhq); } - private JHipsterModuleOrganization kafkaDepdency() { - return JHipsterModuleOrganization.builder().addModuleDependency("spring-boot-kafka").build(); + private JHipsterModuleOrganization kafkaDependency() { + return JHipsterModuleOrganization.builder().addDependency(SPRING_BOOT_KAFKA).build(); } } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/broker/pulsar/infrastructure/primary/PulsarModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/broker/pulsar/infrastructure/primary/PulsarModuleConfiguration.java index 96bfbbd3f21..83bb6409d57 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/broker/pulsar/infrastructure/primary/PulsarModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/broker/pulsar/infrastructure/primary/PulsarModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.broker.pulsar.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.broker.pulsar.application.PulsarApplicationService; @@ -14,10 +16,10 @@ class PulsarModuleConfiguration { JHipsterModuleResource pulsarModule(PulsarApplicationService pulsar) { return JHipsterModuleResource .builder() - .slug("spring-boot-pulsar") + .slug(SPRING_BOOT_PULSAR) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - Broker", "Add Pulsar dependencies, with testcontainers") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("spring-boot").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_BOOT).build()) .tags("server", "spring", "spring-boot", "broker") .factory(pulsar::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/cache/ehcache/infrastructure/primary/EHCacheModulesConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/cache/ehcache/infrastructure/primary/EHCacheModulesConfiguration.java index fa82c3fe088..17ddf5ffbf1 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/cache/ehcache/infrastructure/primary/EHCacheModulesConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/cache/ehcache/infrastructure/primary/EHCacheModulesConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.cache.ehcache.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.cache.ehcache.application.EhcacheApplicationService; @@ -10,18 +13,18 @@ @Configuration class EHCacheModulesConfiguration { - private static final String SPRING_BOOT = "spring-boot"; - private static final String CACHE = "cache"; + private static final String SPRING_BOOT_TAG = "spring-boot"; + private static final String CACHE_TAG = "cache"; @Bean JHipsterModuleResource javaEHCacheModule(EhcacheApplicationService ehCaches) { return JHipsterModuleResource .builder() - .slug("ehcache-java-config") + .slug(EHCACHE_JAVA_CONFIG) .propertiesDefinition(properties()) .apiDoc("Spring Boot - Cache", "Add Ehcache with Java configuration") .organization(organization()) - .tags("server", "spring", SPRING_BOOT, CACHE) + .tags("server", "spring", SPRING_BOOT_TAG, CACHE_TAG) .factory(ehCaches::buildJavaConfigurationModule); } @@ -29,11 +32,11 @@ JHipsterModuleResource javaEHCacheModule(EhcacheApplicationService ehCaches) { JHipsterModuleResource xmlEHCacheModule(EhcacheApplicationService ehCaches) { return JHipsterModuleResource .builder() - .slug("ehcache-xml-config") + .slug(EHCACHE_XML_CONFIG) .propertiesDefinition(properties()) .apiDoc("Spring Boot - Cache", "Add Ehcache with XML configuration") .organization(organization()) - .tags("server", "spring", SPRING_BOOT, CACHE) + .tags("server", "spring", SPRING_BOOT_TAG, CACHE_TAG) .factory(ehCaches::buildXmlConfigurationModule); } @@ -42,6 +45,6 @@ private JHipsterModulePropertiesDefinition properties() { } private JHipsterModuleOrganization organization() { - return JHipsterModuleOrganization.builder().feature(CACHE).addModuleDependency(SPRING_BOOT).build(); + return JHipsterModuleOrganization.builder().feature(CACHE).addDependency(SPRING_BOOT).build(); } } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/cache/simple/infrastructure/primary/CacheModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/cache/simple/infrastructure/primary/CacheModuleConfiguration.java index 6397487e154..b0f171e42d9 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/cache/simple/infrastructure/primary/CacheModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/cache/simple/infrastructure/primary/CacheModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.cache.simple.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.cache.simple.application.SpringBootCacheSimpleApplicationService; @@ -14,7 +16,7 @@ class CacheModuleConfiguration { JHipsterModuleResource simpleCacheModule(SpringBootCacheSimpleApplicationService caches) { return JHipsterModuleResource .builder() - .slug("spring-boot-cache") + .slug(SPRING_BOOT_CACHE) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - Cache", "Add simple cache") .organization(JHipsterModuleOrganization.SPRINGBOOT_DEPENDENCY) diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/core/infrastructure/primary/SpringBootCoreModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/core/infrastructure/primary/SpringBootCoreModuleConfiguration.java index 8630e5304c3..fe47bad58bc 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/core/infrastructure/primary/SpringBootCoreModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/core/infrastructure/primary/SpringBootCoreModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.core.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.core.application.SpringBootApplicationService; @@ -14,10 +17,10 @@ class SpringBootCoreModuleConfiguration { JHipsterModuleResource springBootCoreModule(SpringBootApplicationService springBoot) { return JHipsterModuleResource .builder() - .slug("spring-boot") + .slug(SPRING_BOOT) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addIndentation().build()) .apiDoc("Spring Boot", "Init Spring Boot project with dependencies, App, and properties") - .organization(JHipsterModuleOrganization.builder().addFeatureDependency("java-build-tool").addModuleDependency("java-base").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(JAVA_BUILD_TOOL).addDependency(JAVA_BASE).build()) .tags("server", "spring", "spring-boot") .factory(springBoot::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/cucumber/infrastructure/primary/CucumberModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/cucumber/infrastructure/primary/CucumberModuleConfiguration.java index c6c1aacc063..79c4840e8da 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/cucumber/infrastructure/primary/CucumberModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/cucumber/infrastructure/primary/CucumberModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.cucumber.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.cucumber.application.CucumberApplicationService; @@ -14,10 +17,10 @@ class CucumberModuleConfiguration { JHipsterModuleResource cucumberInitializationModule(CucumberApplicationService cucumber) { return JHipsterModuleResource .builder() - .slug("spring-boot-cucumber") + .slug(SPRING_BOOT_CUCUMBER) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().addProjectBaseName().build()) .apiDoc("Spring Boot - Component Tests", "Add cucumber integration to project") - .organization(JHipsterModuleOrganization.builder().addFeatureDependency("spring-server").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_SERVER).build()) .tags("server", "spring", "spring-boot", "test") .factory(cucumber::buildInitializationModule); } @@ -26,12 +29,10 @@ JHipsterModuleResource cucumberInitializationModule(CucumberApplicationService c JHipsterModuleResource cucumberJpaResetModule(CucumberApplicationService cucumber) { return JHipsterModuleResource .builder() - .slug("spring-boot-cucumber-jpa-reset") + .slug(SPRING_BOOT_CUCUMBER_JPA_RESET) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().build()) .apiDoc("Spring Boot - Component Tests", "Add jpa reset for cucumber") - .organization( - JHipsterModuleOrganization.builder().addModuleDependency("spring-boot-cucumber").addFeatureDependency("jpa-persistence").build() - ) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_BOOT_CUCUMBER).addDependency(JPA_PERSISTENCE).build()) .tags("server", "spring", "spring-boot", "test") .factory(cucumber::buildJpaResetModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/cucumberauthentication/infrastructure/primary/CucumberAuthenticationModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/cucumberauthentication/infrastructure/primary/CucumberAuthenticationModuleConfiguration.java index c3f1eba5f74..722bcc3fc6f 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/cucumberauthentication/infrastructure/primary/CucumberAuthenticationModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/cucumberauthentication/infrastructure/primary/CucumberAuthenticationModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.cucumberauthentication.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.cucumberauthentication.application.CucumberAuthenticationApplicationService; @@ -14,15 +17,15 @@ class CucumberAuthenticationModuleConfiguration { JHipsterModuleResource cucumberOAuth2AuthenticationModule(CucumberAuthenticationApplicationService cucumberAuthentications) { return JHipsterModuleResource .builder() - .slug("spring-boot-cucumber-oauth2-authentication") + .slug(SPRING_BOOT_CUCUMBER_OAUTH_2_AUTHENTICATION) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addIndentation().build()) .apiDoc("Spring Boot - Component Tests", "Add OAuth2 authentication steps for cucumber") .organization( JHipsterModuleOrganization .builder() - .feature("cucumber-authentication") - .addModuleDependency("spring-boot-cucumber") - .addModuleDependency("spring-boot-oauth2") + .feature(CUCUMBER_AUTHENTICATION) + .addDependency(SPRING_BOOT_CUCUMBER) + .addDependency(SPRING_BOOT_OAUTH_2) .build() ) .tags("server", "spring", "spring-boot", "test", "oauth2") @@ -33,15 +36,15 @@ JHipsterModuleResource cucumberOAuth2AuthenticationModule(CucumberAuthentication JHipsterModuleResource cucumberJwtAuthenticationModule(CucumberAuthenticationApplicationService cucumberAuthentications) { return JHipsterModuleResource .builder() - .slug("spring-boot-cucumber-jwt-authentication") + .slug(SPRING_BOOT_CUCUMBER_JWT_AUTHENTICATION) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().build()) .apiDoc("Spring Boot - Component Tests", "Add JWT authentication steps for cucumber") .organization( JHipsterModuleOrganization .builder() - .feature("cucumber-authentication") - .addModuleDependency("spring-boot-cucumber") - .addModuleDependency("spring-boot-jwt") + .feature(CUCUMBER_AUTHENTICATION) + .addDependency(SPRING_BOOT_CUCUMBER) + .addDependency(SPRING_BOOT_JWT) .build() ) .tags("server", "spring", "spring-boot", "test", "jwt") diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/customjhlite/infrastructure/primary/CustomJHLiteModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/customjhlite/infrastructure/primary/CustomJHLiteModuleConfiguration.java index 984c7b557d5..1f0620f4ef9 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/customjhlite/infrastructure/primary/CustomJHLiteModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/customjhlite/infrastructure/primary/CustomJHLiteModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.customjhlite.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.customjhlite.application.CustomJHLiteApplicationService; @@ -14,10 +16,10 @@ class CustomJHLiteModuleConfiguration { JHipsterModuleResource customJHLiteModule(CustomJHLiteApplicationService customJHLite) { return JHipsterModuleResource .builder() - .slug("custom-jhlite") + .slug(CUSTOM_JHLITE) .propertiesDefinition(propertiesDefinition()) .apiDoc("JHLite", "Create a custom JHLite instance to build custom modules") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("spring-boot").build()) + .organization(JHipsterModuleOrganization.SPRINGBOOT_DEPENDENCY) .tags("server") .factory(customJHLite::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mariadb/infrastructure/primary/MariaDBModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mariadb/infrastructure/primary/MariaDBModuleConfiguration.java index dd119f1fe60..f31d093b806 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mariadb/infrastructure/primary/MariaDBModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mariadb/infrastructure/primary/MariaDBModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.database.mariadb.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.database.mariadb.application.MariaDBApplicationService; @@ -14,10 +17,10 @@ class MariaDBModuleConfiguration { JHipsterModuleResource mariaDBModule(MariaDBApplicationService applicationService) { return JHipsterModuleResource .builder() - .slug("mariadb") + .slug(MARIADB) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().addProjectBaseName().build()) .apiDoc("Spring Boot - Database", "Add MariaDB to project") - .organization(JHipsterModuleOrganization.builder().feature("jpa-persistence").addModuleDependency("spring-boot").build()) + .organization(JHipsterModuleOrganization.builder().feature(JPA_PERSISTENCE).addDependency(SPRING_BOOT).build()) .tags("server", "spring", "spring-boot", "database") .factory(applicationService::build); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mongodb/infrastructure/primary/MongoDbModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mongodb/infrastructure/primary/MongoDbModuleConfiguration.java index e256ef283fe..fb73ef6ed3c 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mongodb/infrastructure/primary/MongoDbModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mongodb/infrastructure/primary/MongoDbModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.database.mongodb.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.database.mongodb.application.MongodbApplicationService; @@ -14,7 +16,7 @@ class MongoDbModuleConfiguration { JHipsterModuleResource mongoDbModule(MongodbApplicationService mongoDb) { return JHipsterModuleResource .builder() - .slug("mongodb") + .slug(MONGODB) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - Database", "Add MongoDB drivers and dependencies, with testcontainers") .organization(JHipsterModuleOrganization.SPRINGBOOT_DEPENDENCY) diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mssql/infrastructure/primary/MsSQLModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mssql/infrastructure/primary/MsSQLModuleConfiguration.java index b033ca3b43f..00dbafb7603 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mssql/infrastructure/primary/MsSQLModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mssql/infrastructure/primary/MsSQLModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.database.mssql.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.database.mssql.application.MsSQLApplicationService; @@ -14,10 +17,10 @@ class MsSQLModuleConfiguration { JHipsterModuleResource msSQLModule(MsSQLApplicationService applicationService) { return JHipsterModuleResource .builder() - .slug("mssql") + .slug(MSSQL) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().addProjectBaseName().build()) .apiDoc("Spring Boot - Database", "Add MsSQL to project") - .organization(JHipsterModuleOrganization.builder().feature("jpa-persistence").addModuleDependency("spring-boot").build()) + .organization(JHipsterModuleOrganization.builder().feature(JPA_PERSISTENCE).addDependency(SPRING_BOOT).build()) .tags("server", "database", "mssql") .factory(applicationService::build); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mysql/infrastructure/primary/MySQLModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mysql/infrastructure/primary/MySQLModuleConfiguration.java index d53520f2a69..14fe9d6265c 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mysql/infrastructure/primary/MySQLModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/mysql/infrastructure/primary/MySQLModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.database.mysql.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.database.mysql.application.MySQLApplicationService; @@ -14,10 +17,10 @@ class MySQLModuleConfiguration { JHipsterModuleResource mySQLModule(MySQLApplicationService applicationService) { return JHipsterModuleResource .builder() - .slug("mysql") + .slug(MYSQL) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().addProjectBaseName().build()) .apiDoc("Spring Boot - Database", "Add MySQL to project") - .organization(JHipsterModuleOrganization.builder().feature("jpa-persistence").addModuleDependency("spring-boot").build()) + .organization(JHipsterModuleOrganization.builder().feature(JPA_PERSISTENCE).addDependency(SPRING_BOOT).build()) .tags("server", "spring", "spring-boot", "database") .factory(applicationService::build); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/infrastructure/primary/PostgresqlModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/infrastructure/primary/PostgresqlModuleConfiguration.java index 66984e97884..48582a48c6c 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/infrastructure/primary/PostgresqlModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/database/postgresql/infrastructure/primary/PostgresqlModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.database.postgresql.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.database.postgresql.application.PostgresqlApplicationService; @@ -16,10 +19,10 @@ class PostgresqlModuleConfiguration { JHipsterModuleResource postgresqlModule(PostgresqlApplicationService postgresql) { return JHipsterModuleResource .builder() - .slug("postgresql") + .slug(POSTGRESQL) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().addProjectBaseName().build()) .apiDoc("Spring Boot - Database", "Add Postgresql to project") - .organization(JHipsterModuleOrganization.builder().feature("jpa-persistence").addModuleDependency("spring-boot").build()) + .organization(JHipsterModuleOrganization.builder().feature(JPA_PERSISTENCE).addDependency(SPRING_BOOT).build()) .tags("server", "spring", "spring-boot", "database") .factory(postgresql::build); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/flyway/infrastructure/primary/FlywayModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/flyway/infrastructure/primary/FlywayModuleConfiguration.java index 55397e00859..22bae5e5c1e 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/flyway/infrastructure/primary/FlywayModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/flyway/infrastructure/primary/FlywayModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.dbmigration.flyway.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.dbmigration.flyway.application.FlywayApplicationService; @@ -14,10 +17,10 @@ class FlywayModuleConfiguration { JHipsterModuleResource flywayInitializationModule(FlywayApplicationService flyway) { return JHipsterModuleResource .builder() - .slug("flyway") + .slug(FLYWAY) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - Database Migration", "Add Flyway") - .organization(JHipsterModuleOrganization.builder().feature("database-migration").addFeatureDependency("jpa-persistence").build()) + .organization(JHipsterModuleOrganization.builder().feature(DATABASE_MIGRATION).addDependency(JPA_PERSISTENCE).build()) .tags("server", "spring", "spring-boot", "database", "migration") .factory(flyway::buildInitializationModule); } @@ -26,10 +29,10 @@ JHipsterModuleResource flywayInitializationModule(FlywayApplicationService flywa JHipsterModuleResource flywayMysqlModule(FlywayApplicationService flyway) { return JHipsterModuleResource .builder() - .slug("flyway-mysql") + .slug(FLYWAY_MYSQL) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - Database Migration", "Add Flyway mysql") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("flyway").addModuleDependency("mysql").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(FLYWAY).addDependency(MYSQL).build()) .tags("server", "spring", "spring-boot", "database", "migration") .factory(flyway::buildMysqlDependencyModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/liquibase/infrastructure/primary/LiquibaseModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/liquibase/infrastructure/primary/LiquibaseModuleConfiguration.java index 48803e359c6..0bfa28b4a6b 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/liquibase/infrastructure/primary/LiquibaseModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/liquibase/infrastructure/primary/LiquibaseModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.dbmigration.liquibase.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.dbmigration.liquibase.application.LiquibaseApplicationService; @@ -14,10 +17,10 @@ class LiquibaseModuleConfiguration { JHipsterModuleResource liquibaseModule(LiquibaseApplicationService liquibase) { return JHipsterModuleResource .builder() - .slug("liquibase") + .slug(LIQUIBASE) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addIndentation().addBasePackage().build()) .apiDoc("Spring Boot - Database Migration", "Add Liquibase") - .organization(JHipsterModuleOrganization.builder().feature("database-migration").addFeatureDependency("jpa-persistence").build()) + .organization(JHipsterModuleOrganization.builder().feature(DATABASE_MIGRATION).addDependency(JPA_PERSISTENCE).build()) .tags("server", "spring", "spring-boot", "database", "migration", "liquibase") .factory(liquibase::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/mongock/infrastructure/primary/MongockModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/mongock/infrastructure/primary/MongockModuleConfiguration.java index 3734a143f7c..5d1b5d3fdf1 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/mongock/infrastructure/primary/MongockModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/dbmigration/mongock/infrastructure/primary/MongockModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.dbmigration.mongock.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.dbmigration.mongock.application.MongockApplicationService; @@ -14,10 +16,10 @@ class MongockModuleConfiguration { JHipsterModuleResource mongockModule(MongockApplicationService mongock) { return JHipsterModuleResource .builder() - .slug("mongock") + .slug(MONGOCK) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - Database Migration", "Add Mongock") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("mongodb").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(MONGODB).build()) .tags("server", "spring", "spring-boot", "database", "migration", "mongo-db") .factory(mongock::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/devtools/infrastructure/primary/DevToolsModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/devtools/infrastructure/primary/DevToolsModuleConfiguration.java index ac6f39ee64a..9af34aa48a0 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/devtools/infrastructure/primary/DevToolsModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/devtools/infrastructure/primary/DevToolsModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.devtools.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.devtools.application.DevToolsApplicationService; @@ -14,7 +16,7 @@ class DevToolsModuleConfiguration { JHipsterModuleResource devTools(DevToolsApplicationService devtools) { return JHipsterModuleResource .builder() - .slug("spring-boot-devtools") + .slug(SPRING_BOOT_DEVTOOLS) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addIndentation().build()) .apiDoc("Spring Boot - Tools", "Add Spring Boot devtools.") .organization(JHipsterModuleOrganization.SPRINGBOOT_DEPENDENCY) diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/docker/infrastructure/primary/SpringBootDockerModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/docker/infrastructure/primary/SpringBootDockerModuleConfiguration.java index 4bd2281aa2e..56d6f3569bc 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/docker/infrastructure/primary/SpringBootDockerModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/docker/infrastructure/primary/SpringBootDockerModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.docker.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.docker.application.SpringBootDockerApplicationService; @@ -14,7 +17,7 @@ class SpringBootDockerModuleConfiguration { JHipsterModuleResource jibModule(SpringBootDockerApplicationService springBootDocker) { return JHipsterModuleResource .builder() - .slug("jib") + .slug(JIB) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addServerPort().build()) .apiDoc("Spring Boot - Tools", "Add Docker image building with Jib") .organization(organization()) @@ -26,7 +29,7 @@ JHipsterModuleResource jibModule(SpringBootDockerApplicationService springBootDo JHipsterModuleResource dockerFileModule(SpringBootDockerApplicationService springBootDocker) { return JHipsterModuleResource .builder() - .slug("dockerfile") + .slug(DOCKERFILE) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addServerPort().build()) .apiDoc("Spring Boot - Tools", "Add Dockerfile") .organization(organization()) @@ -35,6 +38,6 @@ JHipsterModuleResource dockerFileModule(SpringBootDockerApplicationService sprin } private JHipsterModuleOrganization organization() { - return JHipsterModuleOrganization.builder().addFeatureDependency("java-build-tool").build(); + return JHipsterModuleOrganization.builder().addDependency(JAVA_BUILD_TOOL).build(); } } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/logging/logstash/infrastructure/primary/LogstashModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/logging/logstash/infrastructure/primary/LogstashModuleConfiguration.java index a24054c4259..b6fd970a864 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/logging/logstash/infrastructure/primary/LogstashModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/logging/logstash/infrastructure/primary/LogstashModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.logging.logstash.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.logging.logstash.application.LogstashApplicationService; @@ -14,7 +16,7 @@ class LogstashModuleConfiguration { JHipsterModuleResource logstashModule(LogstashApplicationService logstash) { return JHipsterModuleResource .builder() - .slug("logstash") + .slug(LOGSTASH) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - Logging", "Add Logstash TCP appender") .organization(JHipsterModuleOrganization.SPRINGBOOT_DEPENDENCY) diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/feature/infrastructure/primary/DummyFeatureModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/feature/infrastructure/primary/DummyFeatureModuleConfiguration.java index 889424bcd90..830250e64b7 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/feature/infrastructure/primary/DummyFeatureModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/feature/infrastructure/primary/DummyFeatureModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.mvc.dummy.feature.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.mvc.dummy.feature.application.DummyApplicationService; @@ -14,16 +17,16 @@ class DummyFeatureModuleConfiguration { JHipsterModuleResource dummyFeatureModule(DummyApplicationService dummy) { return JHipsterModuleResource .builder() - .slug("dummy-feature") + .slug(DUMMY_FEATURE) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - MVC", "Add Dummy context with some APIs") .organization( JHipsterModuleOrganization .builder() - .addFeatureDependency("cucumber-authentication") - .addFeatureDependency("web-error-management") - .addFeatureDependency("springdoc") - .addModuleDependency("java-base") + .addDependency(CUCUMBER_AUTHENTICATION) + .addDependency(WEB_ERROR_MANAGEMENT) + .addDependency(SPRINGDOC) + .addDependency(JAVA_BASE) .build() ) .tags("server") diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/flyway/infrastructure/primary/DummyFlywaModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/flyway/infrastructure/primary/DummyFlywaModuleConfiguration.java index 8358fc54e8f..d49730192d5 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/flyway/infrastructure/primary/DummyFlywaModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/flyway/infrastructure/primary/DummyFlywaModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.mvc.dummy.flyway.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.mvc.dummy.flyway.application.DummyFlywayApplicationService; @@ -13,16 +16,16 @@ class DummyFlywaModuleConfiguration { JHipsterModuleResource dummyFlywayPostgresqlModule(DummyFlywayApplicationService dummyFlyway) { return JHipsterModuleResource .builder() - .slug("dummy-postgresql-flyway-changelog") + .slug(DUMMY_POSTGRESQL_FLYWAY_CHANGELOG) .withoutProperties() .apiDoc("Spring Boot - MVC", "Add postgresql flyway changelog for dummy feature") .organization( JHipsterModuleOrganization .builder() - .feature("dummy-schema") - .addModuleDependency("flyway") - .addModuleDependency("dummy-feature") - .addModuleDependency("postgresql") + .feature(DUMMY_SCHEMA) + .addDependency(FLYWAY) + .addDependency(DUMMY_FEATURE) + .addDependency(POSTGRESQL) .build() ) .tags("server") @@ -33,17 +36,10 @@ JHipsterModuleResource dummyFlywayPostgresqlModule(DummyFlywayApplicationService JHipsterModuleResource dummyFlywayNotPostgresqlModule(DummyFlywayApplicationService dummyFlyway) { return JHipsterModuleResource .builder() - .slug("dummy-not-postgresql-flyway-changelog") + .slug(DUMMY_NOT_POSTGRESQL_FLYWAY_CHANGELOG) .withoutProperties() .apiDoc("Spring Boot - MVC", "Add not postgresql flyway changelog for dummy feature") - .organization( - JHipsterModuleOrganization - .builder() - .feature("dummy-schema") - .addModuleDependency("flyway") - .addModuleDependency("dummy-feature") - .build() - ) + .organization(JHipsterModuleOrganization.builder().feature(DUMMY_SCHEMA).addDependency(FLYWAY).addDependency(DUMMY_FEATURE).build()) .tags("server") .factory(dummyFlyway::buildNotPostgresqlModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/jpapersistence/infrastructure/primary/DummyJpaPersistenceModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/jpapersistence/infrastructure/primary/DummyJpaPersistenceModuleConfiguration.java index d0d1bccc8c0..67251c18670 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/jpapersistence/infrastructure/primary/DummyJpaPersistenceModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/jpapersistence/infrastructure/primary/DummyJpaPersistenceModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.mvc.dummy.jpapersistence.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.mvc.dummy.jpapersistence.application.DummyJpaPersistenceApplicationService; @@ -14,15 +17,15 @@ class DummyJpaPersistenceModuleConfiguration { JHipsterModuleResource dummyJpaPersistenceModule(DummyJpaPersistenceApplicationService dummyJpaPersistence) { return JHipsterModuleResource .builder() - .slug("dummy-jpa-persistence") + .slug(DUMMY_JPA_PERSISTENCE) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().build()) .apiDoc("Spring Boot - MVC", "Add JPA persistence for dummy feature") .organization( JHipsterModuleOrganization .builder() - .feature("dummy-persistence") - .addFeatureDependency("dummy-schema") - .addModuleDependency("spring-boot-cucumber-jpa-reset") + .feature(DUMMY_PERSISTENCE) + .addDependency(DUMMY_SCHEMA) + .addDependency(SPRING_BOOT_CUCUMBER_JPA_RESET) .build() ) .tags("server") diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/liquibase/infrastructure/primary/DummyLiquibaseModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/liquibase/infrastructure/primary/DummyLiquibaseModuleConfiguration.java index 89528fc7db7..a72ddf16424 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/liquibase/infrastructure/primary/DummyLiquibaseModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/liquibase/infrastructure/primary/DummyLiquibaseModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.mvc.dummy.liquibase.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.mvc.dummy.liquibase.application.DummyLiquibaseApplicationService; @@ -13,16 +16,11 @@ class DummyLiquibaseModuleConfiguration { JHipsterModuleResource dummyLiquibaseModule(DummyLiquibaseApplicationService dummyLiquibase) { return JHipsterModuleResource .builder() - .slug("dummy-liquibase-changelog") + .slug(DUMMY_LIQUIBASE_CHANGELOG) .withoutProperties() .apiDoc("Spring Boot - MVC", "Add liquibase changelog for dummy feature") .organization( - JHipsterModuleOrganization - .builder() - .feature("dummy-schema") - .addModuleDependency("liquibase") - .addModuleDependency("dummy-feature") - .build() + JHipsterModuleOrganization.builder().feature(DUMMY_SCHEMA).addDependency(LIQUIBASE).addDependency(DUMMY_FEATURE).build() ) .tags("server") .factory(dummyLiquibase::buildModule); diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/mongopersistence/infrastructure/primary/DummyMongoDBPersistenceModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/mongopersistence/infrastructure/primary/DummyMongoDBPersistenceModuleConfiguration.java index 1e22ed82925..f23bfbb0f72 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/mongopersistence/infrastructure/primary/DummyMongoDBPersistenceModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/dummy/mongopersistence/infrastructure/primary/DummyMongoDBPersistenceModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.mvc.dummy.mongopersistence.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.mvc.dummy.mongopersistence.application.DummyMongoDBPersistenceApplicationService; @@ -14,16 +17,11 @@ class DummyMongoDBPersistenceModuleConfiguration { JHipsterModuleResource dummyMongoDBModule(DummyMongoDBPersistenceApplicationService dummyMongoDBPersistence) { return JHipsterModuleResource .builder() - .slug("dummy-mongodb-persistence") + .slug(DUMMY_MONGODB_PERSITENCE) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().build()) .apiDoc("Spring Boot - MVC", "Add MongoDB persistence for dummy feature") .organization( - JHipsterModuleOrganization - .builder() - .feature("dummy-persistence") - .addModuleDependency("dummy-feature") - .addModuleDependency("mongock") - .build() + JHipsterModuleOrganization.builder().feature(DUMMY_PERSISTENCE).addDependency(DUMMY_FEATURE).addDependency(MONGOCK).build() ) .tags("server") .factory(dummyMongoDBPersistence::buildModule); diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/infrastructure/primary/JwtAuthenticationModulesConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/infrastructure/primary/JwtAuthenticationModulesConfiguration.java index fc3d893aff1..9ba330ab7f0 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/infrastructure/primary/JwtAuthenticationModulesConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/jwt/infrastructure/primary/JwtAuthenticationModulesConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.mvc.security.jwt.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.mvc.security.jwt.application.JwtAuthenticationApplicationService; @@ -10,25 +13,25 @@ @Configuration public class JwtAuthenticationModulesConfiguration { - private static final String AUTHENTICATION = "authentication"; + private static final String AUTHENTICATION_TAG = "authentication"; @Bean JHipsterModuleResource jwtAuthenticationModule(JwtAuthenticationApplicationService jwtAuthentications) { return JHipsterModuleResource .builder() - .slug("spring-boot-jwt") + .slug(SPRING_BOOT_JWT) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().addProjectBaseName().build()) .apiDoc("Spring Boot - MVC - Security", "Add Spring Security JWT") .organization( JHipsterModuleOrganization .builder() .feature(AUTHENTICATION) - .addModuleDependency("java-base") - .addFeatureDependency("web-error-management") - .addFeatureDependency("spring-server") + .addDependency(JAVA_BASE) + .addDependency(WEB_ERROR_MANAGEMENT) + .addDependency(SPRING_SERVER) .build() ) - .tags("server", "spring", "spring-boot", AUTHENTICATION) + .tags("server", "spring", "spring-boot", AUTHENTICATION_TAG) .factory(jwtAuthentications::buildAuthenticationModule); } @@ -36,13 +39,11 @@ JHipsterModuleResource jwtAuthenticationModule(JwtAuthenticationApplicationServi JHipsterModuleResource jwtBasicAuthModule(JwtAuthenticationApplicationService jwtAuthentications) { return JHipsterModuleResource .builder() - .slug("spring-boot-jwt-basic-auth") + .slug(SPRING_BOOT_JWT_BASIC_AUTH) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - MVC - Security", "Add Basic Auth for Spring Security JWT") - .organization( - JHipsterModuleOrganization.builder().addModuleDependency("spring-boot-jwt").addModuleDependency("springdoc-jwt").build() - ) - .tags("server", "spring", "spring-boot", AUTHENTICATION) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_BOOT_JWT).addDependency(SPRINGDOC_JWT).build()) + .tags("server", "spring", "spring-boot", AUTHENTICATION_TAG) .factory(jwtAuthentications::buildBasicAuthModule); } } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/account/infrastructure/primary/OAuth2AccountModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/account/infrastructure/primary/OAuth2AccountModuleConfiguration.java index 3eb31c44a39..060bcc4951b 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/account/infrastructure/primary/OAuth2AccountModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/account/infrastructure/primary/OAuth2AccountModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.mvc.security.oauth2.account.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.mvc.security.oauth2.account.application.OAuth2AccountSecurityApplicationService; @@ -16,10 +18,10 @@ class OAuth2AccountModuleConfiguration { JHipsterModuleResource oAuth2AccountModule(OAuth2AccountSecurityApplicationService oAuth2Account) { return JHipsterModuleResource .builder() - .slug("spring-boot-oauth2-account") + .slug(SPRING_BOOT_OAUTH_2_ACCOUNT) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().build()) .apiDoc("Spring Boot - MVC - Security", "Add a account context for OAuth 2.0 / OIDC Authentication") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("spring-boot-oauth2").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_BOOT_OAUTH_2).build()) .tags("server", "spring", "spring-boot", AUTHENTICATION, "account", "user") .factory(oAuth2Account::buildOAuth2AccountModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/auth0/infrastructure/primary/OAuth2Auth0ModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/auth0/infrastructure/primary/OAuth2Auth0ModuleConfiguration.java index 93322e25954..692edf2b206 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/auth0/infrastructure/primary/OAuth2Auth0ModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/auth0/infrastructure/primary/OAuth2Auth0ModuleConfiguration.java @@ -1,5 +1,6 @@ package tech.jhipster.lite.generator.server.springboot.mvc.security.oauth2.auth0.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; import static tech.jhipster.lite.module.domain.resource.JHipsterModulePropertyDefinition.mandatoryStringProperty; import org.springframework.context.annotation.Bean; @@ -19,13 +20,13 @@ class OAuth2Auth0ModuleConfiguration { JHipsterModuleResource oAuth2Auth0Module(OAuth2Auth0SecurityApplicationService oAuth2) { return JHipsterModuleResource .builder() - .slug("spring-boot-oauth2-auth0") + .slug(SPRING_BOOT_OAUTH_2_AUTH_0) .propertiesDefinition(initPropertiesDefinition()) .apiDoc( "Spring Boot - MVC - Security", "Add a Spring Security: OAuth 2.0 / OIDC Authentication / Auth0 Provider (stateful, works with Keycloak and Auth0)" ) - .organization(JHipsterModuleOrganization.builder().addModuleDependency("spring-boot-oauth2").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_BOOT_OAUTH_2).build()) .tags("server", "spring", "spring-boot", AUTHENTICATION, "auth0") .factory(oAuth2::buildOAuth2Auth0Module); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/core/infrastructure/primary/OAuth2ModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/core/infrastructure/primary/OAuth2ModuleConfiguration.java index 85e31436c5f..d92168270de 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/core/infrastructure/primary/OAuth2ModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/core/infrastructure/primary/OAuth2ModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.mvc.security.oauth2.core.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.mvc.security.oauth2.core.application.OAuth2SecurityApplicationService; @@ -10,13 +13,13 @@ @Configuration class OAuth2ModuleConfiguration { - private static final String AUTHENTICATION = "authentication"; + private static final String AUTHENTICATION_TAG = "authentication"; @Bean JHipsterModuleResource oAuth2Module(OAuth2SecurityApplicationService oAuth2) { return JHipsterModuleResource .builder() - .slug("spring-boot-oauth2") + .slug(SPRING_BOOT_OAUTH_2) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().addIndentation().build()) .apiDoc( "Spring Boot - MVC - Security", @@ -26,12 +29,12 @@ JHipsterModuleResource oAuth2Module(OAuth2SecurityApplicationService oAuth2) { JHipsterModuleOrganization .builder() .feature(AUTHENTICATION) - .addModuleDependency("java-base") - .addFeatureDependency("web-error-management") - .addFeatureDependency("spring-server") + .addDependency(JAVA_BASE) + .addDependency(WEB_ERROR_MANAGEMENT) + .addDependency(SPRING_SERVER) .build() ) - .tags("server", "spring", "spring-boot", AUTHENTICATION) + .tags("server", "spring", "spring-boot", AUTHENTICATION_TAG) .factory(oAuth2::buildOAuth2Module); } } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/okta/infrastructure/primary/OAuth2OktaModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/okta/infrastructure/primary/OAuth2OktaModuleConfiguration.java index 12825a4acba..7d7b40a73a4 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/okta/infrastructure/primary/OAuth2OktaModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/security/oauth2/okta/infrastructure/primary/OAuth2OktaModuleConfiguration.java @@ -1,5 +1,6 @@ package tech.jhipster.lite.generator.server.springboot.mvc.security.oauth2.okta.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; import static tech.jhipster.lite.module.domain.resource.JHipsterModulePropertyDefinition.mandatoryStringProperty; import org.springframework.context.annotation.Bean; @@ -19,13 +20,13 @@ class OAuth2OktaModuleConfiguration { JHipsterModuleResource oAuth2OktaModule(OAuth2OktaSecurityApplicationService oAuth2) { return JHipsterModuleResource .builder() - .slug("spring-boot-oauth2-okta") + .slug(SPRING_BOOT_OAUTH_2_OKTA) .propertiesDefinition(initPropertiesDefinition()) .apiDoc( "Spring Boot - MVC - Security", "Add a Spring Security: OAuth 2.0 / OIDC Authentication / Okta Provider (stateful, works with Keycloak and Okta)" ) - .organization(JHipsterModuleOrganization.builder().addModuleDependency("spring-boot-oauth2").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_BOOT_OAUTH_2).build()) .tags("server", "spring", "spring-boot", AUTHENTICATION, "okta") .factory(oAuth2::buildOAuth2OktaModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/web/infrastructure/primary/SpringBootMvcModulesConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/web/infrastructure/primary/SpringBootMvcModulesConfiguration.java index 5bae1e8071d..134b53aa4f3 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/web/infrastructure/primary/SpringBootMvcModulesConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/web/infrastructure/primary/SpringBootMvcModulesConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.mvc.web.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.mvc.web.application.SpringBootMvcApplicationService; @@ -10,17 +13,17 @@ @Configuration class SpringBootMvcModulesConfiguration { - private static final String SPRING_BOOT = "spring-boot"; + private static final String SPRING_BOOT_TAG = "spring-boot"; @Bean JHipsterModuleResource springBootTomcatMvcModule(SpringBootMvcApplicationService springBootMvc) { return JHipsterModuleResource .builder() - .slug("spring-boot-tomcat") + .slug(SPRING_BOOT_TOMCAT) .propertiesDefinition(properties()) .apiDoc("Spring Boot - MVC", "Add Spring Boot MVC with Tomcat") .organization(organization()) - .tags("server", "spring", SPRING_BOOT, "mvc", "web", "tomcat") + .tags("server", "spring", SPRING_BOOT_TAG, "mvc", "web", "tomcat") .factory(springBootMvc::buildTomcatModule); } @@ -28,11 +31,11 @@ JHipsterModuleResource springBootTomcatMvcModule(SpringBootMvcApplicationService JHipsterModuleResource springBootUndertowMvcModule(SpringBootMvcApplicationService springBootMvc) { return JHipsterModuleResource .builder() - .slug("spring-boot-undertow") + .slug(SPRING_BOOT_UNDERTOW) .propertiesDefinition(properties()) .apiDoc("Spring Boot - MVC", "Add Spring Boot MVC with Undertow") .organization(organization()) - .tags("server", "spring", SPRING_BOOT, "mvc", "web", "undertow") + .tags("server", "spring", SPRING_BOOT_TAG, "mvc", "web", "undertow") .factory(springBootMvc::buildUndertowModule); } @@ -41,6 +44,6 @@ private JHipsterModulePropertiesDefinition properties() { } private JHipsterModuleOrganization organization() { - return JHipsterModuleOrganization.builder().feature("spring-server").addModuleDependency(SPRING_BOOT).build(); + return JHipsterModuleOrganization.builder().feature(SPRING_SERVER).addDependency(SPRING_BOOT).build(); } } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/zalandoproblem/infrastructure/primary/ZalandoProblemsModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/zalandoproblem/infrastructure/primary/ZalandoProblemsModuleConfiguration.java index fb8c592bf3c..f4902063b7e 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/zalandoproblem/infrastructure/primary/ZalandoProblemsModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/mvc/zalandoproblem/infrastructure/primary/ZalandoProblemsModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.mvc.zalandoproblem.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.mvc.zalandoproblem.application.ZalandoProblemsApplicationService; @@ -14,10 +17,10 @@ class ZalandoProblemsModuleConfiguration { JHipsterModuleResource zalandoProblemsModule(ZalandoProblemsApplicationService zalandoProblems) { return JHipsterModuleResource .builder() - .slug("zalando-problems") + .slug(ZALANDO_PROBLEMS) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().build()) .apiDoc("Spring Boot - MVC", "Zalando problems and error handler") - .organization(JHipsterModuleOrganization.builder().feature("web-error-management").addFeatureDependency("spring-server").build()) + .organization(JHipsterModuleOrganization.builder().feature(WEB_ERROR_MANAGEMENT).addDependency(SPRING_SERVER).build()) .tags("server", "spring", "spring-boot", "mvc", "problem") .factory(zalandoProblems::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/configclient/infrastructure/primary/SpringCloudConfigModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/configclient/infrastructure/primary/SpringCloudConfigModuleConfiguration.java index 21f884dae22..9d9915b6685 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/configclient/infrastructure/primary/SpringCloudConfigModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/configclient/infrastructure/primary/SpringCloudConfigModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.springcloud.configclient.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.springcloud.configclient.application.SpringCloudConfigClientApplicationService; @@ -14,10 +17,10 @@ class SpringCloudConfigModuleConfiguration { JHipsterModuleResource springCloudConfigModule(SpringCloudConfigClientApplicationService cloudConfigs) { return JHipsterModuleResource .builder() - .slug("spring-cloud") + .slug(SPRING_CLOUD) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addProjectBaseName().build()) .apiDoc("Spring Boot - Spring Cloud", "Add Spring Cloud Config Client") - .organization(JHipsterModuleOrganization.builder().feature("service-discovery").addModuleDependency("spring-boot-actuator").build()) + .organization(JHipsterModuleOrganization.builder().feature(SERVICE_DISCOVERY).addDependency(SPRING_BOOT_ACTUATOR).build()) .tags("server", "spring", "spring-boot", "cloud") .factory(cloudConfigs::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/consul/infrastructure/primary/ConsulModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/consul/infrastructure/primary/ConsulModuleConfiguration.java index 1337209cefe..d7db0e006aa 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/consul/infrastructure/primary/ConsulModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/consul/infrastructure/primary/ConsulModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.springcloud.consul.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.springcloud.consul.application.ConsulApplicationService; @@ -14,10 +17,10 @@ class ConsulModuleConfiguration { JHipsterModuleResource consulModule(ConsulApplicationService consulApplicationService) { return JHipsterModuleResource .builder() - .slug("consul") + .slug(CONSUL) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addProjectBaseName().build()) .apiDoc("Spring Boot - Spring Cloud", "Add Spring Cloud Consul config and discovery") - .organization(JHipsterModuleOrganization.builder().feature("service-discovery").addModuleDependency("spring-boot-actuator").build()) + .organization(JHipsterModuleOrganization.builder().feature(SERVICE_DISCOVERY).addDependency(SPRING_BOOT_ACTUATOR).build()) .tags("server", "spring", "spring-boot", "cloud") .factory(consulApplicationService::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/eureka/infrastructure/primary/EurekaModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/eureka/infrastructure/primary/EurekaModuleConfiguration.java index 5064005f6a8..0fe93978431 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/eureka/infrastructure/primary/EurekaModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/eureka/infrastructure/primary/EurekaModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.springcloud.eureka.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.springcloud.eureka.application.EurekaApplicationService; @@ -14,10 +16,10 @@ class EurekaModuleConfiguration { JHipsterModuleResource eurekaModule(EurekaApplicationService eureka) { return JHipsterModuleResource .builder() - .slug("eureka-client") + .slug(EUREKA_CLIENT) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addProjectBaseName().addIndentation().build()) .apiDoc("Spring Boot - Spring Cloud", "Add Spring Cloud Eureka Client") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("spring-cloud").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_CLOUD).build()) .tags("server", "spring", "spring-boot", "cloud") .factory(eureka::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/gateway/infrastructure/primary/GatewayModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/gateway/infrastructure/primary/GatewayModuleConfiguration.java index 1a7cff8aea6..6692d67d761 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/gateway/infrastructure/primary/GatewayModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/springcloud/gateway/infrastructure/primary/GatewayModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.server.springboot.springcloud.gateway.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.springcloud.gateway.application.GatewayApplicationService; @@ -14,10 +16,10 @@ class GatewayModuleConfiguration { JHipsterModuleResource gatewayModule(GatewayApplicationService gateway) { return JHipsterModuleResource .builder() - .slug("gateway") + .slug(GATEWAY) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().build()) .apiDoc("Spring Boot - Spring Cloud", "Add Spring Cloud Gateway") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("spring-cloud").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_CLOUD).build()) .tags("server", "spring", "spring-boot", "cloud") .factory(gateway::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/infrastructure/primary/SpringBootActuatorModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/infrastructure/primary/SpringBootActuatorModuleConfiguration.java index 71347930c6a..d19e2cc7186 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/infrastructure/primary/SpringBootActuatorModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/technicaltools/actuator/infrastructure/primary/SpringBootActuatorModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.technicaltools.actuator.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.technicaltools.actuator.application.SpringBootActuatorApplicationService; @@ -14,10 +17,10 @@ class SpringBootActuatorModuleConfiguration { JHipsterModuleResource springBootActuatorModule(SpringBootActuatorApplicationService actuatorModule) { return JHipsterModuleResource .builder() - .slug("spring-boot-actuator") + .slug(SPRING_BOOT_ACTUATOR) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addProjectBaseName().build()) .apiDoc("Spring Boot", "Add Spring Boot Actuator to the project") - .organization(JHipsterModuleOrganization.builder().addFeatureDependency("spring-server").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(SPRING_SERVER).build()) .tags("server", "spring", "spring-boot") .factory(actuatorModule::buildSpringBootActuatorModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/server/springboot/webflux/web/infrastructure/primary/SpringBootWebfluxModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/server/springboot/webflux/web/infrastructure/primary/SpringBootWebfluxModuleConfiguration.java index ab94f350195..ee6e6347c4a 100644 --- a/src/main/java/tech/jhipster/lite/generator/server/springboot/webflux/web/infrastructure/primary/SpringBootWebfluxModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/server/springboot/webflux/web/infrastructure/primary/SpringBootWebfluxModuleConfiguration.java @@ -1,5 +1,8 @@ package tech.jhipster.lite.generator.server.springboot.webflux.web.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteFeatureSlug.*; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.server.springboot.webflux.web.application.SpringBootWebfluxApplicationService; @@ -14,10 +17,10 @@ class SpringBootWebfluxModuleConfiguration { JHipsterModuleResource springBootWebfluxModule(SpringBootWebfluxApplicationService webflux) { return JHipsterModuleResource .builder() - .slug("spring-boot-webflux-netty") + .slug(SPRING_BOOT_WEBFLUX_NETTY) .propertiesDefinition(JHipsterModulePropertiesDefinition.builder().addBasePackage().addIndentation().addServerPort().build()) .apiDoc("Spring Boot - Webflux", "Add Spring Boot Webflux with Netty") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("spring-boot").feature("spring-server").build()) + .organization(JHipsterModuleOrganization.builder().feature(SPRING_SERVER).addDependency(SPRING_BOOT).build()) .tags("server", "webflux") .factory(webflux::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/generator/setup/codespaces/infrastructure/primary/CodespaceModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/setup/codespaces/infrastructure/primary/CodespaceModuleConfiguration.java index f3dc7377ff6..cddb15d6817 100644 --- a/src/main/java/tech/jhipster/lite/generator/setup/codespaces/infrastructure/primary/CodespaceModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/setup/codespaces/infrastructure/primary/CodespaceModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.setup.codespaces.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.setup.codespaces.application.CodespacesApplicationService; @@ -14,7 +16,7 @@ class CodespaceModuleConfiguration { JHipsterModuleResource codespaceModule(CodespacesApplicationService codespaces) { return JHipsterModuleResource .builder() - .slug("github-codespaces") + .slug(GITHUB_CODESPACES) .propertiesDefinition(propertiesDefinition()) .apiDoc("Codespaces", "Init GitHub Codespaces configuration files") .standalone() diff --git a/src/main/java/tech/jhipster/lite/generator/setup/gitpod/infrastructure/primary/GitpodModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/setup/gitpod/infrastructure/primary/GitpodModuleConfiguration.java index a937379b990..e231df517c9 100644 --- a/src/main/java/tech/jhipster/lite/generator/setup/gitpod/infrastructure/primary/GitpodModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/setup/gitpod/infrastructure/primary/GitpodModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.setup.gitpod.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.setup.gitpod.application.GitpodApplicationService; @@ -12,7 +14,7 @@ class GitpodModuleConfiguration { JHipsterModuleResource gitpodModule(GitpodApplicationService gitPods) { return JHipsterModuleResource .builder() - .slug("gitpod") + .slug(GITPOD) .withoutProperties() .apiDoc("Gitpod", "Init Gitpod configuration files") .standalone() diff --git a/src/main/java/tech/jhipster/lite/generator/typescript/infrastructure/primary/TypescriptModuleConfiguration.java b/src/main/java/tech/jhipster/lite/generator/typescript/infrastructure/primary/TypescriptModuleConfiguration.java index e54e9bbb0fc..9daea3181ed 100644 --- a/src/main/java/tech/jhipster/lite/generator/typescript/infrastructure/primary/TypescriptModuleConfiguration.java +++ b/src/main/java/tech/jhipster/lite/generator/typescript/infrastructure/primary/TypescriptModuleConfiguration.java @@ -1,5 +1,7 @@ package tech.jhipster.lite.generator.typescript.infrastructure.primary; +import static tech.jhipster.lite.generator.JHLiteModuleSlug.*; + import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import tech.jhipster.lite.generator.typescript.application.TypescriptApplicationService; @@ -13,10 +15,10 @@ class TypescriptModuleConfiguration { JHipsterModuleResource typescriptModule(TypescriptApplicationService typescriptApplicationService) { return JHipsterModuleResource .builder() - .slug("typescript") + .slug(TYPESCRIPT) .withoutProperties() .apiDoc("Typescript", "Init Typescript project") - .organization(JHipsterModuleOrganization.builder().addModuleDependency("init").build()) + .organization(JHipsterModuleOrganization.builder().addDependency(INIT).build()) .tags("typescript") .factory(typescriptApplicationService::buildModule); } diff --git a/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterFeatureSlugFactory.java b/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterFeatureSlugFactory.java new file mode 100644 index 00000000000..7da761be084 --- /dev/null +++ b/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterFeatureSlugFactory.java @@ -0,0 +1,13 @@ +package tech.jhipster.lite.module.domain.resource; + +import java.util.Optional; +import tech.jhipster.lite.module.domain.JHipsterFeatureSlug; + +@FunctionalInterface +public interface JHipsterFeatureSlugFactory { + String get(); + + default Optional build() { + return JHipsterFeatureSlug.of(get()); + } +} diff --git a/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleOrganization.java b/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleOrganization.java index 38202b67312..ea2fc73df2b 100644 --- a/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleOrganization.java +++ b/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleOrganization.java @@ -3,8 +3,8 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Optional; +import tech.jhipster.lite.error.domain.Assert; import tech.jhipster.lite.module.domain.JHipsterFeatureSlug; -import tech.jhipster.lite.module.domain.JHipsterModuleSlug; import tech.jhipster.lite.module.domain.landscape.JHipsterFeatureDependency; import tech.jhipster.lite.module.domain.landscape.JHipsterLandscapeDependency; import tech.jhipster.lite.module.domain.landscape.JHipsterModuleDependency; @@ -39,20 +39,50 @@ public static class JHipsterModuleOrganizationBuilder { private final Collection dependencies = new ArrayList<>(); private Optional feature = Optional.empty(); + /** + * @deprecated use {@link #feature(JHipsterFeatureSlugFactory)} instead + */ + @Deprecated(forRemoval = true) public JHipsterModuleOrganizationBuilder feature(String feature) { - this.feature = JHipsterFeatureSlug.of(feature); + return feature(() -> feature); + } + + public JHipsterModuleOrganizationBuilder feature(JHipsterFeatureSlugFactory feature) { + Assert.notNull("feature", feature); + + this.feature = feature.build(); return this; } + /** + * @deprecated use {@link #addDependency(JHipsterModuleSlugFactory)} instead + */ + @Deprecated(forRemoval = true) public JHipsterModuleOrganizationBuilder addModuleDependency(String module) { - dependencies.add(new JHipsterModuleDependency(new JHipsterModuleSlug(module))); + return addDependency((JHipsterModuleSlugFactory) () -> module); + } + + public JHipsterModuleOrganizationBuilder addDependency(JHipsterModuleSlugFactory module) { + Assert.notNull("module", module); + + dependencies.add(new JHipsterModuleDependency(module.build())); return this; } + /** + * @deprecated use {@link #addDependency(JHipsterFeatureSlugFactory)} instead + */ + @Deprecated(forRemoval = true) public JHipsterModuleOrganizationBuilder addFeatureDependency(String feature) { - dependencies.add(new JHipsterFeatureDependency(new JHipsterFeatureSlug(feature))); + return addDependency((JHipsterFeatureSlugFactory) () -> feature); + } + + public JHipsterModuleOrganizationBuilder addDependency(JHipsterFeatureSlugFactory feature) { + Assert.notNull("feature", feature); + + feature.build().map(JHipsterFeatureDependency::new).ifPresent(dependencies::add); return this; } diff --git a/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleResource.java b/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleResource.java index 7dca47de5cf..123067bc77e 100644 --- a/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleResource.java +++ b/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleResource.java @@ -16,7 +16,7 @@ public class JHipsterModuleResource { private JHipsterModuleResource(JHipsterModuleResourceBuilder builder) { assertMandatoryFields(builder); - slug = new JHipsterModuleSlug(builder.slug); + slug = builder.slug.build(); propertiesDefinition = builder.propertiesDefinition; apiDoc = builder.apiDoc; tags = builder.tags; @@ -25,6 +25,7 @@ private JHipsterModuleResource(JHipsterModuleResourceBuilder builder) { } private void assertMandatoryFields(JHipsterModuleResourceBuilder builder) { + Assert.notNull("slug", builder.slug); Assert.notNull("propertiesDefinition", builder.propertiesDefinition); Assert.notNull("apiDoc", builder.apiDoc); Assert.notNull("tags", builder.tags); @@ -73,7 +74,7 @@ public static class JHipsterModuleResourceBuilder JHipsterModuleResourceTagsBuilder, JHipsterModuleResourceFactoryBuilder { - private String slug; + private JHipsterModuleSlugFactory slug; private JHipsterModuleApiDoc apiDoc; private JHipsterModuleFactory factory; private JHipsterModulePropertiesDefinition propertiesDefinition; @@ -84,7 +85,7 @@ public static class JHipsterModuleResourceBuilder private JHipsterModuleResourceBuilder() {} @Override - public JHipsterModuleResourcePropertiesDefinitionBuilder slug(String slug) { + public JHipsterModuleResourcePropertiesDefinitionBuilder slug(JHipsterModuleSlugFactory slug) { this.slug = slug; return this; @@ -127,7 +128,15 @@ public JHipsterModuleResource factory(JHipsterModuleFactory factory) { } public interface JHipsterModuleResourceSlugBuilder { - JHipsterModuleResourcePropertiesDefinitionBuilder slug(String slug); + JHipsterModuleResourcePropertiesDefinitionBuilder slug(JHipsterModuleSlugFactory slug); + + /** + * @deprecated use {@link #slug(JHipsterModuleSlugFactory)} instead + */ + @Deprecated(forRemoval = true) + default JHipsterModuleResourcePropertiesDefinitionBuilder slug(String slug) { + return slug(() -> slug); + } } public interface JHipsterModuleResourcePropertiesDefinitionBuilder { diff --git a/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleSlugFactory.java b/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleSlugFactory.java new file mode 100644 index 00000000000..9aa53b9ce10 --- /dev/null +++ b/src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterModuleSlugFactory.java @@ -0,0 +1,12 @@ +package tech.jhipster.lite.module.domain.resource; + +import tech.jhipster.lite.module.domain.JHipsterModuleSlug; + +@FunctionalInterface +public interface JHipsterModuleSlugFactory { + String get(); + + default JHipsterModuleSlug build() { + return new JHipsterModuleSlug(get()); + } +}