Skip to content

Commit

Permalink
feat: Replace Jcabi Plugin by AspectJ Maven Plugin - Meeds-io/meeds#2417
Browse files Browse the repository at this point in the history
 (#978)

Prior to this change, the jcabi maven plugin was used to weave classes
for annotation processing, especially and annotations. This plugin isn't
maintained and should be replace by the default AspectJ libraries for
Annotation Processing. In addition, the Jcabi plugin makes the build
longer and takes a lot of time in addition to heigh I/O operations on
disk. This change applies the required configuration (In addition to
Meeds-io/maven-parent-pom@bea09a8)
in order to replace usage of Jcabi plugin.
  • Loading branch information
boubaker authored Sep 27, 2024
1 parent 2f5f8fe commit 1b0262b
Show file tree
Hide file tree
Showing 16 changed files with 188 additions and 32 deletions.
4 changes: 0 additions & 4 deletions component/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-core</artifactId>
Expand Down
9 changes: 5 additions & 4 deletions component/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-fileupload2-jakarta</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.meeds.kernel</groupId>
Expand All @@ -68,10 +73,6 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-maven-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
Expand Down
16 changes: 12 additions & 4 deletions component/file-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,18 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand All @@ -52,10 +64,6 @@
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;

import jakarta.persistence.EntityManager;
import jakarta.persistence.EntityTransaction;
Expand All @@ -34,10 +34,7 @@
import static org.mockito.Matchers.*;
import static org.mockito.Mockito.*;

/**
*
*/
@RunWith(MockitoJUnitRunner.class)
@RunWith(MockitoJUnitRunner.Silent.class)
public class FileServiceImplTest {

@Rule
Expand Down
26 changes: 26 additions & 0 deletions component/identity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,37 @@
<version>${berkeleydb.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
16 changes: 16 additions & 0 deletions component/management/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,20 @@
<type>test-jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
</plugins>
</build>
</project>
16 changes: 16 additions & 0 deletions component/pc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,20 @@
<type>test-jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
</plugins>
</build>
</project>
12 changes: 12 additions & 0 deletions component/portal/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@

<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
16 changes: 16 additions & 0 deletions component/resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,20 @@
<type>test-jar</type>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
</plugins>
</build>
</project>
16 changes: 16 additions & 0 deletions component/scripting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,20 @@
<artifactId>groovy-all</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
</plugins>
</build>
</project>
16 changes: 16 additions & 0 deletions component/web/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,20 @@
<artifactId>portal.component.web.controller</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
</plugins>
</build>
</project>
16 changes: 16 additions & 0 deletions component/web/controller/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,20 @@
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
</plugins>
</build>
</project>
12 changes: 12 additions & 0 deletions component/web/resources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,18 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
Expand Down
14 changes: 11 additions & 3 deletions component/web/security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,21 @@
<artifactId>sso-agent</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>com.jcabi</groupId>
<artifactId>jcabi-maven-plugin</artifactId>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
</plugins>
</build>

</project>
12 changes: 0 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -345,18 +345,6 @@
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down
12 changes: 12 additions & 0 deletions webui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,18 @@
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>${project.groupId}</groupId>
<artifactId>portal.component.common</artifactId>
</aspectLibrary>
</aspectLibraries>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down

0 comments on commit 1b0262b

Please sign in to comment.