From 45f02317e36325944940b26bfa1851815d6a7a22 Mon Sep 17 00:00:00 2001 From: shyamz-22 Date: Sat, 6 Jan 2018 10:05:17 +0100 Subject: [PATCH] Improve Read me --- README.md | 44 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ffbe705..513db74 100644 --- a/README.md +++ b/README.md @@ -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 + + io.github.shyamz-22 + conditional + 0.0.2 + +```