Skip to content

Commit 0091efa

Browse files
committed
Enable forbiddenapis in Maven build
The detects issues like JCRVLT-702
1 parent d5605dc commit 0091efa

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

parent/pom.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,37 @@ Bundle-Category: jackrabbit
346346
</execution>
347347
</executions>
348348
</plugin>
349+
<plugin>
350+
<groupId>de.thetaphi</groupId>
351+
<artifactId>forbiddenapis</artifactId>
352+
<version>3.5.1</version>
353+
<configuration>
354+
<!--
355+
if the used Java version is too new,
356+
don't fail, just do nothing:
357+
-->
358+
<failOnUnsupportedJava>false</failOnUnsupportedJava>
359+
<bundledSignatures>
360+
<!--
361+
This will automatically choose the right
362+
signatures based on 'maven.compiler.target':
363+
-->
364+
<bundledSignature>jdk-unsafe</bundledSignature>
365+
<bundledSignature>jdk-deprecated</bundledSignature>
366+
<!-- disallow undocumented classes like sun.misc.Unsafe: -->
367+
<bundledSignature>jdk-non-portable</bundledSignature>
368+
<!-- don't allow unsafe reflective access: -->
369+
<bundledSignature>jdk-reflection</bundledSignature>
370+
</bundledSignatures>
371+
</configuration>
372+
<executions>
373+
<execution>
374+
<goals>
375+
<goal>check</goal>
376+
</goals>
377+
</execution>
378+
</executions>
379+
</plugin>
349380
</plugins>
350381

351382
</build>

vault-core/pom.xml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@
124124
<groupId>biz.aQute.bnd</groupId>
125125
<artifactId>bnd-resolver-maven-plugin</artifactId>
126126
</plugin>
127+
<plugin>
128+
<groupId>de.thetaphi</groupId>
129+
<artifactId>forbiddenapis</artifactId>
130+
<configuration>
131+
<excludes>
132+
<!-- excluded embedded 3rd party libraries -->
133+
<exclude>com/ctc/wstx/**/*.class</exclude>
134+
<exclude>org/apache/jackrabbit/jcr2spi/**/*.class</exclude>
135+
<exclude>org/codehaus/stax/**/*.class</exclude>
136+
<exclude>org/codehaus/stax2/**/*.class</exclude>
137+
<exclude>org/h2/**/*.class</exclude>
138+
</excludes>
139+
</configuration>
140+
</plugin>
127141
</plugins>
128142
</build>
129143

0 commit comments

Comments
 (0)