Skip to content

custom flag as compiler argument is not accessible from BugChecker #680

@dganesh5

Description

@dganesh5

tried passing additional key value pair to Custom BugChecker following the instructions from this doc : http://errorprone.info/docs/flags

Tried setting this in pom

<compilerArgs> <arg>-XepOpt:mvnBuildDirectory=${project.build.directory}</arg> </compilerArgs>

And access using below code in MyCustomChecker
public MyCustomChecker(ErrorProneFlags flags) { this.pwd = flags.get("mvnBuildDirectory").toString(); }

upon running this, I get an java.util.ServiceConfigurationError.
java.util.ServiceConfigurationError: com.google.errorprone.bugpatterns.BugChecker: Provider com.abc.errorprone.MyCustomChecker could not be instantiated

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