On Tue, Jun 6, 2017 at 4:38 PM, Ullrich Hafner <
ullrich...@gmail.com> wrote:
> java.lang.ClassNotFoundException: hudson.plugins.analysis.core.GlobalSettings
>
> The exception is thrown by the following snippet:
>
> <j:invokeStatic var="settings" className="hudson.plugins.analysis.core.GlobalSettings" method="instance“/>
Unfortunately you cannot use this tag on classes in plugins, only
Jenkins core and its dependencies, I guess since Jenkins fails to
communicate the `uberClassLoader` to Stapler. At least I recall
running into that problem in the past. Instead find some handy `it`,
`instance`, etc. object already in scope and define an instance method
on it to give you whatever object you really need, keeping the logic
in Java code. In this case `DryTabDetail` could have a method
public List<SomeType> getWarnings() {
return DuplicateCode.filter(getAnnotations().getSortedAnnotations());
}
and then you would just need to write
<j:forEach var="warning" items="${it.warnings}">