rodolphofr / propertypathexists

Check if property path exists in an application properties file ( Spring Boot 3 )

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Conditional Property Path Exists Annotation

Annotation for initialization of classes and methods through the existence of a property path.

Pre-requirements

  1. Java 11+
  2. Maven 3.8+
  3. Spring Boot 3+

Example

There may be cases where it is necessary to determine the initialization of a class by the property path:

@Configuration
@ConditionalOnPropertyPathExist("spring.cloud.azure")
class AzureConfiguration {
    ...
}

@Configuration
@ConditionalOnPropertyPathExist("spring.cloud.stream.rabbit")
class RabbitMqConfiguration {
    ...
}

About

Check if property path exists in an application properties file ( Spring Boot 3 )


Languages

Language:Java 100.0%