Package grails.boot.annotation
Annotation Type GrailsComponentScan
-
@Retention(RUNTIME) @Target(TYPE) @Documented @Import(Registrar.class) public @interface GrailsComponentScan
Configures the base packages used by auto-configuration when scanning for Grails classes.Using
@GrailsComponentScanwill cause auto-configuration to:- Set the
@GrailsApplicationPostProcessorfor Grailsclasses, such as Application, Domain, Controller.
One of
basePackageClasses(),basePackages()or its aliasvalue()may be specified to define specific packages to scan. If specific packages are not defined scanning will occur from the package of the class with this annotation.- Since:
- 2022.0.0
- See Also:
ComponentScan
- Set the
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.Class<?>[]basePackageClassesType-safe alternative tobasePackages()for specifying the packages to scan for entities.java.lang.String[]basePackagesBase packages to scan for entities.java.lang.String[]valueAlias for thebasePackages()attribute.
-
-
-
Element Detail
-
value
@AliasFor("basePackages") java.lang.String[] valueAlias for thebasePackages()attribute. Allows for more concise annotation declarations e.g.:@EntityScan("org.my.pkg")instead of@GrailsComponentScan(basePackages="org.my.pkg").- Returns:
- the base packages to scan
- Default:
- {}
-
-
-
basePackages
@AliasFor("value") java.lang.String[] basePackagesBase packages to scan for entities.value()is an alias for (and mutually exclusive with) this attribute.Use
basePackageClasses()for a type-safe alternative to String-based package names.- Returns:
- the base packages to scan
- Default:
- {}
-
-
-
basePackageClasses
java.lang.Class<?>[] basePackageClasses
Type-safe alternative tobasePackages()for specifying the packages to scan for entities. The package of each class specified will be scanned.Consider creating a special no-op marker class or interface in each package that serves no purpose other than being referenced by this attribute.
- Returns:
- classes from the base packages to scan
- Default:
- {}
-
-