XDean / auto-spring-factories

Auto Spring Factories

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto spring.factories

Build Status codecov.io Maven Central

Auto generate spring.factories in type-safe way.

Get it

<dependency>
    <groupId>com.github.XDean</groupId>
    <artifactId>auto-spring-factories</artifactId>
    <version>0.1.2</version>
    <scope>provided</scope>
</dependency>

Usage

For example, you write a custom auto-configuration MyAutoConfiguration.

You may create META-INF/spring.factories in resource and write

org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
your.package.MyAutoConfiguration

But now you can use auto-spring-factories:

@AutoSpringFactories(EnableAutoConfiguration.class)
public class MyAutoConfiguration{
}

It will auto generate spring.factories.

Notice

  • Only support top-level class

About

Auto Spring Factories

License:Apache License 2.0


Languages

Language:Java 100.0%