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.
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.
You will need Java 17+. Then simply run:
mvnw clean package