I am using ValidatorException class which is inside the package sun.security.validator.ValidatorException in java 11. But I am getting the following error :
AJC compiler errors: The type sun.security.validator.ValidatorException is not accessible
In maven compiler, i have fixed this problem using the compiler arguments --add-exports java.base/sun.security.validator=ALL-UNNAMED
but I don't know how to do with the AspectJ plugin.
Snapshot of my pom.xml for maven compiler
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>
<arg>--add-exports</arg><arg>java.base/sun.security.validator=ALL-UNNAMED</arg>
</compilerArgs>
</configuration>
<executions>
<execution>
<id>default-compile</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
Snapshot my pom.xml for aspectj plugin
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.7</version>
<configuration>
<showWeaveInfo>true</showWeaveInfo>
<verbose>true</verbose>
<source>11</source>
<target>11</target>
<complianceLevel>11</complianceLevel>
</configuration>
<executions>
<execution>
<id>compile-with-aspectj</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<weaveDirectories>
<weaveDirectory>${project.build.outputDirectory}/aspectJ-classes</weaveDirectory>
</weaveDirectories>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>11</version>
<scope>system</scope>
<systemPath>${project.basedir}/pom.xml</systemPath>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjrt</artifactId>
<version>1.9.6</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjtools</artifactId>
<version>1.9.6</version>
</dependency>
</dependencies>
</plugin>