Let me begin starting with I have never written a plugin to Jenkins before.
I have plenty of insight into the Jenkins API for Groovy scripting in 
script console and scripting Pipeline scripts.
I am a Java developer for over 10 years (API/Spring, Swing/JavaFX), and 
have been using Jenkins for most of those years. Most of our inhouse 
software is C++ though, and a few Java.

I was thinking of creating a custom view plugin to Jenkins for our company. 
Our developers are not happy with the Jenkins UI (Blue Ocean is a step 
forward, but it is still slow and doesn't support customization on 
pipelines view). They feel it is difficult to get an overview which release 
branches has failed, as all the user branches are getting in the way of 
that on Multibranch Pipeline jobs. 

It is hard to convince my peers that Jenkins is much better than our 
inhouse legacy CI system (bunch of ruby scripts, which a single developer 
now has revamped with a Vue.js frontend) for people that has never used a 
third party CI system like Jenkins. The arguments I frequent hear is why 
use resources with Jenkins when there is already a functional CI system. 
They (He) feels all the work I have put in pipelines is wasted, and that we 
should abandon Jenkins to build releases. Well, enough about that (I just 
had to went a little about my reason for creating a custom view plugin).

The plugin I was thinking of creating should list projects with branches 
status. Usually with multibranch pipelines you would have to click on the 
project to get the list of branches, but I wanted the view plugin to list 
branches along with the project on the view page.

Currently I want to start simple, by just listing all the projects and get 
it up and running on Jenkins.

I am seeking some good documentation, howto's for creating Jenkins plugins, 
specifically a View plugin.
https://wiki.jenkins.io/display/JENKINS/Plugin+tutorial
This tutorial revolves around creating a Builder. Could not find a tutorial 
for creating a view plugin, so I will start with this one.
http://www.baeldung.com/jenkins-custom-plugin

Even a visual simple view plugin like jenkins-build-monitor-plugin 
<https://github.com/jan-molak/jenkins-build-monitor-plugin/>, looks very 
complex. I am getting lost in all the source code. Most of it probably not 
relevant for my plugin.
A reckon a view plugin is half Java code, half HTML/Javascript/CSS code, 
and some jelly it seems also.
https://wiki.jenkins.io/display/JENKINS/Basic+guide+to+Jelly+usage+in+Jenkins

Having browsed this jenkins-build-monitor-plugin 
<https://github.com/jan-molak/jenkins-build-monitor-plugin/> on GitHub I am 
overwhelmed. It has almost chased me away, but not quite. I think I must 
start small, just the few bits I need to get a view plugin up to display 
some projects, get the basic feel of the building blocks.


Generating the maven project

mvn archetype:generate -Dfilter=io.jenkins.archetypes:plugin

[INFO] No archetype defined. Using maven-archetype-quickstart 
(org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: remote -> io.jenkins.archetypes:empty-plugin (Skeleton of a Jenkins plugin 
with a POM and an empty source tree.)
2: remote -> io.jenkins.archetypes:global-configuration-plugin (Skeleton of a 
Jenkins plugin with a POM and an example piece of global configuration.)
3: remote -> io.jenkins.archetypes:hello-world-plugin (Skeleton of a Jenkins 
plugin with a POM and an example build step.)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive 
contains): : 1
Choose io.jenkins.archetypes:empty-plugin version:  

1: 1.0
2: 1.1
3: 1.2
4: 1.3
5: 1.4
Choose a number: 5: 5
I Went through the pom.xml and updated some values

 <jenkins.version>2.117</jenkins.version>
 <java.level>8</java.level>

Currently no source files yet in my plugin, nor tests. Running mvn install 
fails:
[ERROR] Errors:  
[ERROR] 
org.junit.runner.manipulation.Filter.initializationError(org.junit.runner.manipulation.Filter)
 
[ERROR]   Run 1: Filter.initializationError »  No tests found matching 
Method org.jvnet.hudson.... 
[ERROR]   Run 2: Filter.initializationError »  No runnable methods 
[ERROR]   Run 3: Filter.initializationError »  No runnable methods 
[ERROR]   Run 4: Filter.initializationError »  No runnable methods 
[INFO]  
[ERROR]   FailedTest.org.jvnet.hudson.test.JellyTestSuiteBuilder$JellyTestSuite 
» FailingHttpStatusCode 
[INFO]  
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0

What kind of test is this? There is nothing in my newly created project.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/b0320f5b-97fc-4c22-985a-607e9dc7bb5e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to