ph-forbidden-apis

Forbidden APIs rules

License

License

GroupId

GroupId

com.helger
ArtifactId

ArtifactId

ph-forbidden-apis
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

ph-forbidden-apis
Forbidden APIs rules
Project URL

Project URL

https://github.com/phax/ph-forbidden-apis
Project Organization

Project Organization

Philip Helger
Source Code Management

Source Code Management

http://github.com/phax/ph-forbidden-apis

Download ph-forbidden-apis

How to add to project

<!-- https://jarcasting.com/artifacts/com.helger/ph-forbidden-apis/ -->
<dependency>
    <groupId>com.helger</groupId>
    <artifactId>ph-forbidden-apis</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.helger/ph-forbidden-apis/
implementation 'com.helger:ph-forbidden-apis:1.1.1'
// https://jarcasting.com/artifacts/com.helger/ph-forbidden-apis/
implementation ("com.helger:ph-forbidden-apis:1.1.1")
'com.helger:ph-forbidden-apis:jar:1.1.1'
<dependency org="com.helger" name="ph-forbidden-apis" rev="1.1.1">
  <artifact name="ph-forbidden-apis" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.helger', module='ph-forbidden-apis', version='1.1.1')
)
libraryDependencies += "com.helger" % "ph-forbidden-apis" % "1.1.1"
[com.helger/ph-forbidden-apis "1.1.1"]

Dependencies

test (3)

Group / Artifact Type Version
junit : junit jar 4.12
org.slf4j : slf4j-simple jar 1.7.25
de.thetaphi : forbiddenapis jar 2.4.1

Project Modules

There are no modules declared in this project.

ph-forbidden-apis

Forbidden APIs signature for my projects. They are mostly about style and performance and not so much about correctness.

Usage in Maven

Put a call to the forbidden-apis plugin and add this as a signatureArtifact:

  <build>
...
    <plugins>
...
      <plugin>
        <groupId>de.thetaphi</groupId>
        <artifactId>forbiddenapis</artifactId>
        <version>2.4.1</version>
        <configuration>
          <failOnUnsupportedJava>false</failOnUnsupportedJava>
          <bundledSignatures>
            <!-- Choose the right signatures based on 'maven.compiler.target' property: -->
            <bundledSignature>jdk-unsafe</bundledSignature>
            <bundledSignature>jdk-deprecated</bundledSignature>
            <bundledSignature>jdk-internal</bundledSignature>
            <bundledSignature>jdk-non-portable</bundledSignature>
            <bundledSignature>jdk-system-out</bundledSignature>
            <bundledSignature>jdk-reflection</bundledSignature>
          </bundledSignatures>
          <signaturesArtifacts>
            <!-- Finally add this artifact --> 
            <signaturesArtifact>
              <groupId>com.helger</groupId>
              <artifactId>ph-forbidden-apis</artifactId>
              <version>1.1.1</version>
              <type>jar</type>
              <path>forbidden-apis-java8.txt</path>
            </signaturesArtifact>
          </signaturesArtifacts>
          <excludes>
             <!-- Example on how to exclude classes -->
            <exclude>**/TestClassToExclude.class</exclude>
          </excludes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <!-- Execute for main and test -->
              <goal>check</goal>
              <goal>testCheck</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
...
    </plugins>
...
  </build>

News and Noteworthy

  • v1.1.1 - 2018-03-28
    • Fixed a typo in Java9 file, and added a test for reading
  • v1.1.0 - 2018-03-28
    • Changed filenames to forbidden-apis-java8.txt and forbidden-apis-java9.txt
  • v1.0.0 - 2017-03-29
    • Initial version containing forbidden-apis.txt

My personal Coding Styleguide | On Twitter: @philiphelger | Kindly supported by YourKit Java Profiler

Versions

Version
1.1.1
1.1.0
1.0.0