#1129 Add forbidden apis plugin to fail on illegal TypeMirror usages

This commit is contained in:
Filip Hrisafov 2017-05-30 22:32:27 +02:00
parent 9fc111f7df
commit 2acaffa3ec
3 changed files with 26 additions and 0 deletions

4
etc/forbidden-apis.txt Normal file
View File

@ -0,0 +1,4 @@
@defaultMessage TypeMirror equals and hashCode are not stable. Types.isSameType(TypeMirror, TypeMirror) should be used
javax.lang.model.type.TypeMirror#hashCode()
javax.lang.model.type.TypeMirror#equals(java.lang.Object)

View File

@ -506,6 +506,16 @@
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
</plugin>
<plugin>
<groupId>de.thetaphi</groupId>
<artifactId>forbiddenapis</artifactId>
<version>2.3</version>
<configuration>
<signaturesFiles>
<signaturesFile>${project.basedir}/../etc/forbidden-apis.txt</signaturesFile>
</signaturesFiles>
</configuration>
</plugin>
</plugins>
</pluginManagement>
@ -525,6 +535,7 @@
<exclude>**/mapstruct.xml</exclude>
<exclude>**/toolchains-*.xml</exclude>
<exclude>**/eclipse-formatter-config.xml</exclude>
<exclude>**/forbidden-apis.txt</exclude>
<exclude>**/checkstyle-for-generated-sources.xml</exclude>
<exclude>**/nb-configuration.xml</exclude>
<exclude>maven-settings.xml</exclude>

View File

@ -319,6 +319,17 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>de.thetaphi</groupId>
<artifactId>forbiddenapis</artifactId>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>