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
-
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:
{}
-