Skip to content

Inlcude optional dependencies to avoid warnings #2111

@HerrDerb

Description

@HerrDerb

I am using v2.0-rc.3 and when starting an application I get a load of warnings regarding annotation used in the github-api library.

...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHArtifact.class): warning: Cannot find annotation method 'value()' in type 'WithBridgeMethods': class file for com.infradna.tool.bridge_method_injector.WithBridgeMethods not found
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHArtifact.class): warning: Cannot find annotation method 'adapterMethod()' in type 'WithBridgeMethods'
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHArtifact.class): warning: Cannot find annotation method 'value()' in type 'SuppressFBWarnings': class file for edu.umd.cs.findbugs.annotations.SuppressFBWarnings not found
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHArtifact.class): warning: Cannot find annotation method 'justification()' in type 'SuppressFBWarnings'
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHWorkflowRun.class): warning: Cannot find annotation method 'value()' in type 'WithBridgeMethods'
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHWorkflowRun.class): warning: Cannot find annotation method 'adapterMethod()' in type 'WithBridgeMethods'
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHWorkflowRun.class): warning: Cannot find annotation method 'value()' in type 'SuppressFBWarnings'
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHWorkflowRun.class): warning: Cannot find annotation method 'justification()' in type 'SuppressFBWarnings'
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHWorkflowRun.class): warning: Cannot find annotation method 'value()' in type 'SuppressFBWarnings'
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHWorkflowRun.class): warning: Cannot find annotation method 'justification()' in type 'SuppressFBWarnings'
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHWorkflowRun.class): warning: Cannot find annotation method 'value()' in type 'SuppressFBWarnings'
...\github-api-2.0-rc.3.jar(/org/kohsuke/github/GHWorkflowRun.class): warning: Cannot find annotation method 'justification()' in type 'SuppressFBWarnings'
...

To avoid this warnings, one needs to add the required dependencies

- com.infradna.tool:bridge-method-annotation
- com.github.spotbugs:spotbugs-annotations

to each project. Additionally the bridge-method-annotation dependency doesn't even exist on maven central and a thirdparty repo needs to be added to the project which is a massive overhead to only avoid warnings.

By adding the dependencies as runtime this solves the problem for all users of this library
Originally posted by @HerrDerb in #2090

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions