diff --git a/pom.xml b/pom.xml index bf12a0206bb0b690ada87100e4eb7898291b4d31..b6360bad55ace3faba438706dbd017912104ab18 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> - <version>3.4.0</version> + <version>3.2.3</version> <relativePath/> <!-- Lookup parent from repository --> </parent> @@ -29,6 +29,18 @@ <sonar.organization>gitlab-univ-2</sonar.organization> </properties> + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.springframework.cloud</groupId> + <artifactId>spring-cloud-dependencies</artifactId> + <version>2023.0.1</version> <!-- Compatible with Spring Boot 3.2.x --> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + <dependencies> <!-- Spring Boot Starters --> <dependency> @@ -47,7 +59,6 @@ <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> - <version>4.2.0</version> </dependency> <!-- Database drivers --> @@ -56,11 +67,7 @@ <artifactId>postgresql</artifactId> <version>42.7.2</version> </dependency> - <dependency> - <groupId>mysql</groupId> - <artifactId>mysql-connector-java</artifactId> - <version>8.0.33</version> - </dependency> + <!-- Removing MySQL dependency as PostgreSQL is the preferred DB for cloud deployment --> <!-- H2 Database for testing --> <dependency> diff --git a/src/main/resources/application-cloud.yml b/src/main/resources/application-cloud.yml index 52124da2c1bd49ba554f47a4202b4abc5f000a78..25e8bacb3286012efc1e0284807f9eedce6f1ed9 100644 --- a/src/main/resources/application-cloud.yml +++ b/src/main/resources/application-cloud.yml @@ -1,21 +1,24 @@ server: address: 0.0.0.0 - port: ${PORT:8080} + port: ${PORT:80} + error: + include-message: always spring: + application: + name: user-management-service datasource: - url: jdbc:postgresql://172.29.32.3:5432/bdd_assure - username: dbuser - password: ComplexPassword123! + url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/userdb} + username: ${SPRING_DATASOURCE_USERNAME:postgres} + password: ${SPRING_DATASOURCE_PASSWORD:postgres} driver-class-name: org.postgresql.Driver jpa: - database-platform: org.hibernate.dialect.PostgreSQLDialect hibernate: ddl-auto: update properties: hibernate: - '[format_sql]': true - show-sql: true + dialect: org.hibernate.dialect.PostgreSQLDialect + format_sql: true eureka: client: @@ -24,10 +27,12 @@ eureka: registryFetchIntervalSeconds: 30 healthcheck: enabled: true + register-with-eureka: true + fetch-registry: true instance: prefer-ip-address: true hostname: ${K_SERVICE:user-management-service}.${K_REVISION:default}.${K_CONFIGURATION:default}.run.app - secure-port: ${PORT:8080} + secure-port: ${PORT:80} secure-port-enabled: true non-secure-port-enabled: false instance-id: ${spring.application.name}:${random.uuid} @@ -35,4 +40,13 @@ eureka: leaseRenewalIntervalInSeconds: 30 leaseExpirationDurationInSeconds: 90 metadataMap: - instanceId: ${spring.application.name}:${random.uuid} \ No newline at end of file + instanceId: ${spring.application.name}:${random.uuid} + +management: + endpoints: + web: + exposure: + include: health,info + endpoint: + health: + show-details: always \ No newline at end of file