resilience4j / resilience4j-spring-boot2-demo

A Spring Boot 2 demo which shows how to use the Resilience4j Spring Boot 2 Starter
Apache License 2.0
254 stars 190 forks source link

Provide aspectj definitions #71

Closed vspiliop closed 1 year ago

vspiliop commented 1 year ago

It would be very useful to provide Aspectj definitions for supporting non-runtime weaving. For example, I would like to be able to do the following and do post-compile weaving of my classes. That would allow for much faster execution and for better usage flexibility (e.g. being able to weave methods inside the same class).

<plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>${aspectj-maven-plugin.version}</version>
                <configuration>
                    <complianceLevel>17</complianceLevel>
                    <source>17</source>
                    <target>17</target>
                    <showWeaveInfo>true</showWeaveInfo>
                    <forceAjcCompile>true</forceAjcCompile>
                    <sources/>
                    <testSources/>
                    <weaveDirectories>
                        <weaveDirectory>${project.build.directory}/classes</weaveDirectory>
                    </weaveDirectories>
                    <verbose>true</verbose>
                    <Xlint>warning</Xlint>
                    <aspectLibraries>
                        <aspectLibrary>
                            <groupId>org.springframework</groupId>
                            <artifactId>spring-aspects</artifactId>
                        </aspectLibrary>
                        <aspectLibrary>
                            <groupId>io.github.resilience4j</groupId>
                            <artifactId>resilience4j-spring</artifactId>
                        </aspectLibrary>
                    </aspectLibraries>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjtools</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
 </plugin>
vspiliop commented 1 year ago

Raise an issue to the proper git repo: https://github.com/resilience4j/resilience4j/issues/1877