Annotation Type Profile


Expresses a requirement for a bean to be wired/registered into the BeanScope.

 @Factory
 public class MyAutoConfiguration {

   @Bean
   @Profile("test")
   public MyService myService() {
       ...
   }

 }

 

In the sample above, the MyService bean will get wired only if avaje.profiles is set to "test" in the PropertyRequiresPlugin.

Avaje Config provides an implementation and if it is included in the classpath then Avaje Config will be used to test the property conditions.

If no PropertyRequiresPlugin is found then the default implementation is used which uses System.getProperty(String) and System.getenv(String).

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Expresses that all of the given profiles must be set for the bean to load.
    Expresses that none of the given profiles must be set for the bean to load.
    Expresses that any of the given profiles must be set for the bean to load.
  • Element Details

    • value

      Expresses that any of the given profiles must be set for the bean to load.
      Returns:
      the property to check
      Default:
      {}
    • all

      Expresses that all of the given profiles must be set for the bean to load.
      Returns:
      the property to check
      Default:
      {}
    • none

      Expresses that none of the given profiles must be set for the bean to load.
      Returns:
      the properties to check
      Default:
      {}