0

I am publishing a package to github packages . In the published package, the argument names in interfaces are getting polluted.

this is how my interface class looks like-

public interface detailAPI {
  getDetails(@ApiParam(value = "", required = true)  @RequestParam(value = "userId", required = true) BigDecimal userId
}

After loading the package from github packages in another project , this is the class in my external dependencies -

public interface detailAPI {
    getDetails(@ApiParam(value = "",required = true) @RequestParam(value = "userId",required = true) BigDecimal var1
}

the argument "userID" has been changed to "var1" in the uploaded package. I'm assuming gradle/maven both do this for some optimisation.

All argument names have changes to vars, s1, s2...

Is there a way to prevent this ? Would appreciate your help.

4

1 回答 1

1

I believe you need to compile with the -parameters flag.

tasks {
    javaCompile {
        options.compilerArgs.add("-parameters")
    }
}

Reference: https://www.baeldung.com/java-parameter-reflection

于 2020-04-28T01:19:14.913 回答