Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pf4j2-spring-boot-starter

Spring Boot Starter for pf4j2

Maven Central Java License

简体中文 | English

Positioning · Capabilities · Dependency · Quick Start · Configuration · Versions · Build · License


Current Version2.0.0.RELEASE
JDK Baseline17
Group IDio.github.easy4j
Artifact IDpf4j2-spring-boot-starter
License:Apache License 2.0

1. Positioning

pf4j2-spring-boot-starter is a Spring Boot starter that integrates pf4j2 for applications using pf4j2. It provides auto-configuration, property binding, and ready-to-use beans so that applications can consume pf4j2 capabilities with minimal setup.

Dimension Description
Type Spring Boot Starter
Consumers Spring Boot applications using pf4j2
Core Capabilities auto-configuration, property binding, ready-to-use beans for pf4j2
JDK 17
Coordinates io.github.easy4j:pf4j2-spring-boot-starter:2.0.0.RELEASE
Config Prefix pf4j2

2. Core Capabilities

Capability Status Description
Auto-configuration ✅ Stable Registers pf4j2 beans automatically
Property Binding ✅ Stable Binds pf4j2.* to Pf4jMavenProperties
Pf4jDynamicControllerRegistry bean ✅ Stable Auto-registered via Pf4jAutoConfiguration, Pf4jMavenAutoConfiguration, Pf4jUpdateAutoConfiguration

3. Requirements and Compatibility

Dependency Minimum Evidence
JDK 17 pom.xml
Spring Boot 2.6.0 pom.xml parent
Maven 3.6+ Maven Enforcer

4. Auto-configuration

The starter auto-configures the following beans:

Bean Condition Missing Behavior
Pf4jDynamicControllerRegistry classpath + property not created
PluginStateListener classpath + property not created
PluginManager classpath + property not created
PluginInfoProvider classpath + property not created
MavenUpdateRepository classpath + property not created
UpdateManager classpath + property not created

Auto-configuration registration:

  • META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports (Spring Boot 2.7+ / 3.x / 4.x)
  • META-INF/spring.factories (Spring Boot 2.x legacy)

5. Dependency

<dependency>
    <groupId>io.github.easy4j</groupId>
    <artifactId>pf4j2-spring-boot-starter</artifactId>
    <version>2.0.0.RELEASE</version>
</dependency>

No additional easy4j component dependencies.

6. Quick Start

6.1 Add dependency

Add the dependency above to your pom.xml.

6.2 Configure

pf4j2:
  enabled: true

6.3 Use the bean

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

Then inject the auto-configured bean in your code:

@Autowired
private Pf4jDynamicControllerRegistry pf4jDynamicControllerRegistry;

7. Configuration Reference

7.1 Config Prefix

pf4j2

7.2 Configuration Items

Property Type Default Required Description Sensitive
pf4j2.enabled boolean true No Enable the starter No

8. Version Lines and Compatibility

Branch JDK Spring Boot Component Version Status
2.3.x / 2.7.x 8+ 2.3.x / 2.7.x 1.0.x Maintenance
3.0.x ~ 3.5.x 17 3.x 2.0.x Maintenance
4.0.x / 4.1.x 17+ 4.x 3.0.x Active

9. Build and Test

mvn clean verify
mvn -pl pf4j2-spring-boot-starter -am test

10. Troubleshooting

Symptom Diagnosis Resolution
Bean not created Check auto-configuration report Verify pf4j2.enabled=true and classpath
ClassNotFoundException Missing dependency Add the required module
Version conflict mvn dependency:tree Use BOM for version alignment

11. Contribution

  1. Fork the repository.
  2. Create a feature branch.
  3. Run mvn clean verify before submitting.
  4. Submit a pull request.

12. License

This project is licensed under the Apache License, Version 2.0.


About

Spring Boot Starter For Pf4j 2.x

Topics

Resources

Stars

21 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages