How to extend Jenkins job page with new links and icons

后端 未结 5 1044
难免孤独
难免孤独 2021-02-14 13:29

I\'m developing my first Jenkins plugin and followed the tutorial at wiki.jenkins-ci.org. After adding a BuildStep and generating the results I now want to publish them to the u

5条回答
  •  悲哀的现实
    2021-02-14 13:57

    An addition to @dchang comment:

    I managed to make this functionality work also on pipelines by extending TransientActionFactory:

    @Extension
    public static class PipelineLatestConsoleProjectActionFactory extends TransientActionFactory {
    
        @Override
        public Class type() {
            return WorkflowJob.class;
        }
    
        @Nonnull
        @Override
        public Collection createFor(@Nonnull WorkflowJob job) {
            return Collections.singletonList(new LatestConsoleProjectAction(job));
        }
    }
    

提交回复
热议问题