Skip to content

Commit

Permalink
Improve Read me
Browse files Browse the repository at this point in the history
  • Loading branch information
shyamz-22 committed Jan 6, 2018
1 parent 506950c commit 45f0231
Showing 1 changed file with 41 additions and 3 deletions.
44 changes: 41 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,47 @@

[![Build Status](https://travis-ci.org/shyamz-22/conditional-profiles.svg?branch=master)](https://travis-ci.org/shyamz-22/conditional-profiles)
[![codecov](https://codecov.io/gh/shyamz-22/conditional-profiles/branch/master/graph/badge.svg)](https://codecov.io/gh/shyamz-22/conditional-profiles)
[![MavenCentral](https://maven-badges.herokuapp.com/maven-central/io.github.shyamz-22/conditional/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.github.shyamz-22/conditional)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

### Default Spring profile behavior
```@Profile("A", "B")``` on a bean , Creates that bean when Profile A or B is active.

### Conditional Profiles
```@ConditionalOnProfiles("A","B")``` on a bean , Creates that bean only when Profile A and B is active.
Creates the bean when Profile A **OR** B is active.

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

### Conditional On Profiles

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

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

## Installation

### Gradle

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

### Maven

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

0 comments on commit 45f0231

Please sign in to comment.