01 — Getting Started
Installation & Setup
Requirements
Java 17+
Required by both rulii and Spring Boot 3.x.
Spring Boot 3.4+
Uses Spring Framework 6.2 and the @AutoConfiguration mechanism.
rulii 1.1.0
The core rule engine. Pulled in transitively.
Maven
Add rulii-spring to your pom.xml. It transitively brings in the core rulii library, so you don't need to declare it separately.
<dependency>
<groupId>org.rulii</groupId>
<artifactId>rulii-spring</artifactId>
<version>1.1.0</version>
</dependency>
You also need Spring Boot's autoconfigure starter on the classpath (typically already present in any Spring Boot project):
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
Gradle
implementation 'org.rulii:rulii-spring:1.1.0'
implementation 'org.springframework.boot:spring-boot-starter'
Minimal Application
Once the dependency is on the classpath, Spring Boot auto-configures the rule engine. Add @RuleScan to tell it where your rules live:
import org.rulii.spring.annotation.RuleScan;
@SpringBootApplication
@RuleScan(scanBasePackages = "com.example.rules")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
That's it. On startup, rulii-spring will scan the specified packages for classes annotated with @Rule, register them as Spring beans, and wire up all nine core beans (covered in the next section).
Version Compatibility Matrix
| rulii-spring | rulii | Spring Boot | Java |
|---|---|---|---|
| 1.1.0 | 1.1.0 | 3.4+ | 17+ |