Skip to content

@EruptScan

Placed on the Spring Boot application entry class to trigger Erupt's package scanning and initialization. Every Erupt project must declare this annotation — without it, the framework will not start.

Basic Usage

With no arguments, Erupt scans the package of the annotated class and all its sub-packages:

java
@SpringBootApplication
@EruptScan
public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
}

Specifying Packages

When Erupt entity classes are spread across multiple packages, declare them explicitly via value:

java
@SpringBootApplication
@EruptScan({"com.example.model", "com.example.system"})
public class DemoApplication {
    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }
}

Attributes

AttributeTypeDefaultDescription
valueString[]{}Package names to scan. When empty, the entry class's own package is used

Notes

spring-boot-devtools incompatibility

spring-boot-devtools conflicts with Erupt's class loader and will cause startup errors. Do not add this dependency to your project.

When integrating into an existing project, pair @EruptScan with @EntityScan to ensure JPA entity classes are also discovered:

java
@SpringBootApplication
@EntityScan("com.example.model")
@EruptScan("com.example.model")
public class DemoApplication { ... }

Contributors

The avatar of contributor named as YuePeng YuePeng
The avatar of contributor named as Claude Opus 5 (1M context) Claude Opus 5 (1M context)

Changelog

Released under the Apache-2.0 License.