configuration-as-code-plugin icon indicating copy to clipboard operation
configuration-as-code-plugin copied to clipboard

Remove jsr-305 dependency

Open timja opened this issue 4 years ago • 0 comments

jenkins core 2.231 removed jsr305 which broke JCasC, as a quick fix we've added the dependency in jcasc (https://github.com/jenkinsci/configuration-as-code-plugin/pull/1359) but we should really remove it.

Note: ensure testing is done interactively in a standalone instance of jenkins, jenkins rule and hpi:run have weird classloading

Originally posted by @jtnord in https://github.com/jenkinsci/configuration-as-code-plugin/pull/1359#issuecomment-614102100

Is their no better way to achieve the same without JSR 305?

check the annotation classname rather than the class itself. (which is what spotbugs acutally does to support a viarety of Nonnull classes.

re-introducing jsr-305 goes against the point of getting rid of it as it has a horrible license.

now the annotation won't be present unless the annotation class can be loaded (and this may well cause you not to find the annotations even if you provide it - if the classloader of the class with the use of the annotation can not load the class via itself or its parents. So what you are trying to achieve here is probably doomed to failure anyway (or the other plugin will have the class but it will be a different one due to the classloader and then probably not match when you expect it would - and your unit tests give false positives due to the Classloading differences in Jenkins vs JenkinsRule)

timja avatar Apr 15 '20 15:04 timja