Skip to content

Latest commit

 

History

History
48 lines (36 loc) · 1.24 KB

README.md

File metadata and controls

48 lines (36 loc) · 1.24 KB

Conditional Profiles

Build Status codecov MavenCentral License: MIT

Default Spring profile behavior

Creates the bean when Profile A OR B is active.

@Bean
@Profile("A", "B")
public ExampleBean exampleBean() {
  return new ExampleBean();
}

Conditional On Profiles

Creates the bean only when Profile A AND B are active.

@Bean
@ConditionalOnProfiles("A","B")
public ExampleBean exampleBean() {
  return new ExampleBean();
}

Installation

Gradle

compile 'io.github.shyamz-22:conditional:0.0.2'

Maven

<dependency>
    <groupId>io.github.shyamz-22</groupId>
    <artifactId>conditional</artifactId>
    <version>0.0.2</version>
</dependency>