HomeOfTheWizard / spring-bridge-maven-plugin

A maven plugin that enables the usage of spring libraries in the development of other maven plugins
1 stars 0 forks source link

Maven Central Reproducible Builds CI Passing

Spring Bridge Maven Plugin

A plugin that helps other plugins/extensions to use spring libraries.
It builds the spring context for you at compile time and inject your beans into maven at runtime so you can use them in your Mojos.

Documentation

You need to add this plugin in the pom.xml of your 'under development' plugin. Like so:

<dependencies>
    <!-- HERE -->
    <dependency>
        <groupId>com.homeofthewizard</groupId>
        <artifactId>spring-bridge-maven-plugin</artifactId>
        <version>1.0.0-alpha</version>
    </dependency>

    <!-- some spring library I want to use in my plugin's mojo -->
    <dependency>
        <groupId>org.springframework.foo</groupId>
        <artifactId>spring-bar-lib</artifactId>
        <version>x.x.x</version>
    </dependency>
</dependencies>

...

<build>
    <plugins>
        <!-- HERE -->
        <plugin>
            <groupId>com.homeofthewizard</groupId>
            <artifactId>spring-bridge-maven-plugin</artifactId>
            <version>1.0.0-alpha</version>
            <executions>
                <execution>
                    <id>generate</id>
                    <goals>
                        <goal>generate</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <contextConfigClasses>
                    <contextConfigClass>org.springframework.foo.bar.config.SomeBeansConfiguration</contextConfigClass>
                </contextConfigClasses>
            </configuration>
        </plugin>
    </plugins>
</build>

You can now use the beans created directly in your Mojo !
More information can be found here.

Quick building

You will need Java 17+. Then simply run:
mvnw clean package

Contributing