Skip to content

Commit

Permalink
Enable forbiddenapis in Maven build
Browse files Browse the repository at this point in the history
The detects issues like JCRVLT-702
  • Loading branch information
kwin committed Apr 5, 2023
1 parent d5605dc commit 8f9bab5
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
62 changes: 62 additions & 0 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,68 @@ Bundle-Category: jackrabbit
</execution>
</executions>
</plugin>
<plugin>
<groupId>de.thetaphi</groupId>
<artifactId>forbiddenapis</artifactId>
<version>3.5.1</version>
<configuration>
<!--
if the used Java version is too new,
don't fail, just do nothing:
-->
<failOnUnsupportedJava>false</failOnUnsupportedJava>
<bundledSignatures>
<!--
This will automatically choose the right
signatures based on 'maven.compiler.target':
-->
<bundledSignature>jdk-unsafe</bundledSignature>
<bundledSignature>jdk-deprecated</bundledSignature>
<!-- disallow undocumented classes like sun.misc.Unsafe: -->
<bundledSignature>jdk-non-portable</bundledSignature>
<!-- don't allow unsafe reflective access: -->
<bundledSignature>jdk-reflection</bundledSignature>
</bundledSignatures>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>de.thetaphi</groupId>
<artifactId>forbiddenapis</artifactId>
<version>3.5.1</version>
<configuration>
<!--
if the used Java version is too new,
don't fail, just do nothing:
-->
<failOnUnsupportedJava>false</failOnUnsupportedJava>
<bundledSignatures>
<!--
This will automatically choose the right
signatures based on 'maven.compiler.target':
-->
<bundledSignature>jdk-unsafe</bundledSignature>
<bundledSignature>jdk-deprecated</bundledSignature>
<!-- disallow undocumented classes like sun.misc.Unsafe: -->
<bundledSignature>jdk-non-portable</bundledSignature>
<!-- don't allow unsafe reflective access: -->
<bundledSignature>jdk-reflection</bundledSignature>
</bundledSignatures>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>

</build>
Expand Down
13 changes: 13 additions & 0 deletions vault-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,19 @@
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-resolver-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>de.thetaphi</groupId>
<artifactId>forbiddenapis</artifactId>
<configuration>
<excludes>
<!-- excluded embedded 3rd party libraries -->
<exclude>com/ctc/wstx/**/*.class</exclude>
<exclude>org/apache/jackrabbit/jcr2spi/**/*.class</exclude>
<exclude>org/codehaus/stax/**/*.class</exclude>
<exclude>org/h2/**/*.class</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 8f9bab5

Please sign in to comment.