problem icon indicating copy to clipboard operation
problem copied to clipboard

api-guardian "soft dependency"

Open floriankoch0360 opened this issue 3 years ago • 7 comments

When using the library without depending on org.apiguardian:apiguardian-api, on compilation several warnings will occur:

unknown enum constant Status.STABLE
unknown enum constant Status.MAINTAINED

Description

The api-guardian (introduced in #58) isn't listed as mandatory dependency for the library. Actually, it isn't even mentioned in the README. So, when using the lib as documented one will encounter said warnings on compilation.

Expected Behavior

Either make the dependency mandatory, or at least mention it in the README.

Actual Behavior

Warnings will occur on compilation.

Your Environment

  • Version used: 0.26.0

floriankoch0360 avatar Dec 15 '21 10:12 floriankoch0360

Can you share a sample project where I can see those warnings?

I haven't seen those before.

whiskeysierra avatar Dec 15 '21 10:12 whiskeysierra

I can try to create a minimal example, since I can't share the code I'm working on

floriankoch0360 avatar Dec 15 '21 10:12 floriankoch0360

i managed to reproduce it fairly simply, please have a look here: https://github.com/floriankoch0360/zalando-problem-demo when running gradle :build the warning occurs in this case, the warning is already hinting at the issue, I'm not sure sure why this isn't the case in my real project

you can uncomment the line 21 in build.gradle to fix the warning

floriankoch0360 avatar Dec 15 '21 12:12 floriankoch0360

Looks like JUnit themselves switched to compile dependencies to get around those warnings: https://stackoverflow.com/questions/46702273/warning-unknown-enum-constant-status-stable

whiskeysierra avatar Dec 15 '21 12:12 whiskeysierra

@floriankoch0360 Care to create a PR to remove the specific scope for that dependency (implicitly making it compile)?

whiskeysierra avatar Dec 15 '21 12:12 whiskeysierra

I created the PR, currently totally untested: https://github.com/zalando/problem/pull/342 I had the hope CI would handle testing for me, however workflow execution must be approved first

floriankoch0360 avatar Dec 15 '21 14:12 floriankoch0360

since https://github.com/zalando/problem/pull/342 was merged, this can be closed now 👍🏻

TheFlow0360 avatar Mar 02 '22 08:03 TheFlow0360