Thank you! If ,config.jelly is not present for CustomBuildWrapper (extends SimpleBuildWrapper), the below exception is thrown for Workflow job . No exception if used via FreeStyleProject
Aug 28, 2015 3:36:26 PM hudson.widgets.RenderOnDemandClosure$1 generateResponse WARNING: Failed to evaluate the template closure org.apache.commons.jelly.JellyTagException: jar:file:.../target/work/webapp/WEB-INF/lib/jenkins-core-1.609.2.jar!/lib/form/dropdownDescriptorSelector.jelly:60:78: <st:include> No page found 'config.jelly' for class my.CustomBuildWrapper$DescriptorImpl at org.kohsuke.stapler.jelly.IncludeTag.doTag(IncludeTag.java:124) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99) at org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91) at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269) at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95) at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161) at org.apache.commons.jelly.tags.core.OtherwiseTag.doTag(OtherwiseTag.java:41 CustomBuildWrapper doesn't have any GUI apart from the default one(one checkbox) provided by SimpleBuildWrapper (i guess it is from SimpleBuildWrapper). The above exception occurs when Snippet Generator is used to get the groovy code. Any solutions? Thank you! On Friday, 28 August 2015 15:13:33 UTC+5:30, Robert Sandell wrote: > > use run.getParent() instead. > > /B > > On Fri, Aug 28, 2015 at 11:34 AM, Vinodhini Vijay <vinodhi...@gmail.com > <javascript:>> wrote: > >> >> Thank you all!! :) Is it valid to use the below to get the >> AbstractProject or Project or WorkFlowJob? >> >> SubTask currentExecutable = >> run.getExecutor().getCurrentExecutable().getParent(); >> >> Thanks! >> >> On Friday, 28 August 2015 13:36:05 UTC+5:30, Daniel Beck wrote: >>> >>> >>> On 28.08.2015, at 06:20, Vinodhini Vijay <vinodhi...@gmail.com> wrote: >>> >>> > I had overridden the method : >>> > >>> > public void setUp(Context context, Run<?, ?> run, FilePath workspace, >>> Launcher launcher, TaskListener listener, EnvVars initialEnvironment) >>> > throws IOException, InterruptedException >>> > >>> > But, how to get the workspace directory location from the Run object? >>> (As I have to read some file within workspace) >>> >>> The point of SimpleBuildWrapper and similar other interfaces is that it >>> tells you e.g. the relevant workspace as a parameter. This way your >>> Workflow job/run can have any number of workspaces in parallel. >>> >>> --- >>> >>> On 28.08.2015, at 08:37, Mads Nielsen <m...@praqma.net> wrote: >>> >>> > You can get the Workspace from the run object by doing >>> run.getExecutor().getCurrentWorkspace(). >>> >>> From Javadoc of Executor#getCurrentWorkspace(): >>> >>> > If current executable is AbstractBuild, return the workspace that this >>> executor is using, or null if the build hasn't gotten to that point yet. >>> >>> So that won't work for Workflow, which isn't based on AbstractBuild. >>> >>> -- >> 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 <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jenkinsci-dev/da8ae8fa-daf8-4470-9fad-413cfae77f57%40googlegroups.com >> >> <https://groups.google.com/d/msgid/jenkinsci-dev/da8ae8fa-daf8-4470-9fad-413cfae77f57%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Robert Sandell > *Software Engineer* > *CloudBees Inc.* > -- 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-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-dev/e77eaf09-8ebd-4b69-aa9a-55335c00af0d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.