Skip to content

Build: Forbiddenapis is not running for Java9 SourceSet #29292

@uschindler

Description

@uschindler

Due to a bug in forbiddenapis the forbidden tasks are not enabled for the sourceSet named "java9" in the server module.

The corresponding bug is: policeman-tools/forbidden-apis#138

See also discussion on #29289

I fixed the bug locally and it was working now, the only problem is setup of signatures files for the "java9" sourceSet: We do not have any dependencies, so parsing the default signatures fails:

:server:java9Classes (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.0 secs.
:server:forbiddenApisJava9 (Thread[Task worker for ':' Thread 3,5,main]) started.

> Task :server:forbiddenApisJava9 FAILED
Task ':server:forbiddenApisJava9' is not up-to-date because:
  Task has failed previously.
Reading bundled API signatures: jdk-unsafe-1.8
Reading bundled API signatures: jdk-deprecated-1.8
Reading bundled API signatures: jdk-non-portable
Reading bundled API signatures: jdk-system-out
Reading API signatures: jar:file:/C:/Users/Uwe%20Schindler/.gradle/caches/jars-3/f2f51995af2698f84880e96f412cac8d/buildSrc-7.0.0-alpha1-SNAPSHOT.jar!/forbidden/jdk-signatures.txt
Reading API signatures: jar:file:/C:/Users/Uwe%20Schindler/.gradle/caches/jars-3/f2f51995af2698f84880e96f412cac8d/buildSrc-7.0.0-alpha1-SNAPSHOT.jar!/forbidden/es-all-signatures.txt

:server:forbiddenApisJava9 (Thread[Task worker for ':' Thread 3,5,main]) completed. Took 0.538 secs.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':server:forbiddenApisJava9'.
> Parsing signatures failed: Class 'org.apache.lucene.util.IOUtils' not found on classpath while parsing signature: org.apache.lucene.util.IOUtils

This has to be fixed once forbiddenApis is updated:

  • set targetCompatibility (like done for the compile task). Maybe there is a more generic solution in the build plugin.
  • add missing dependencies to compile classpath, or alternatively remove the signatures that don't work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Delivery/BuildBuild or test infrastructureTeam:DeliveryMeta label for Delivery team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions