How to add nested view with groovy script ?

176 views
Skip to first unread message

user-dev

unread,
Sep 23, 2016, 10:33:53 AM9/23/16
to Jenkins Developers
I am trying to add a nested view using groovy script but is failing 
Jenkins.instance.instance.addView(new hudson.plugins.nested__view.NestedView("Sample View"))

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 3: unable to resolve class hudson.plugins.nested__view.NestedView 
 @ line 3, column 35.
   Jenkins.instance.instance.addView(new hudson.plugins.nested__view.NestedView("ViewX"

Victor Martinez

unread,
Sep 25, 2016, 6:01:30 PM9/25/16
to Jenkins Developers
Hi,

There is a typo as far as I see in that package name:

hudson.plugins.nested_view rather than hudson.plugins.nested__view


As you can see in the source code:

- https://github.com/jenkinsci/nested-view-plugin/blob/master/src/main/java/hudson/plugins/nested_view/NestedView.java#L25


Cheers

Daniel Beck

unread,
Sep 25, 2016, 6:13:50 PM9/25/16
to jenkin...@googlegroups.com
Notably, Xstream serialization escapes with underscores, so copying class names from XML files will result in this problem.

http://x-stream.github.io/faq.html#XML_double_underscores
> --
> You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/c4734796-20d5-43e1-98d5-9692af38128f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

user-dev

unread,
Sep 26, 2016, 8:46:00 AM9/26/16
to Jenkins Developers
Thanks Victor and Daniel removing extra underscore made it to work
Reply all
Reply to author
Forward
0 new messages