Added another attribute 'checkDependsOn' on <input> elements (akin to
'fillDependsOn', etc) to list up the other dependency controls, and
insert appropriate onchange events.
'checkUrl' is now just the stem portion of the URL to invoke, and
the client script builds up the query parameters.
Also cleaning up variable names to be less misleading.
Note that new File("target") is really a bad idea since we cannot predict the CWD in effect when Maven is run.
(From the standard bin/mvn launcher, it seems that it will always be *some* Maven project at least.
This may not be true for Maven run embedded from various tools.)
But leaving that as is for now, since it is not clear how else we would find the project location.
(new File(env.description().getTestClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile() might work but it is pretty hacky.)
Apparently the Maven 2 process factory fails to adequately insulate the Maven process from Jenkins library dependencies;
if you specify a build extension that can override dependencies used by Jenkins core classes!
A real fix would involve changing class loader delegation, since presumably similar bugs could still occur.
Ensure the addTrigger and removeTrigger methods only use methods that are
supported by DescribableList. This means no indexed operations are
supported, so use only Iterator#remove and Collection#add
Add Integration Tests to ensure methods work as expected
From now on user needs:
Computer.CREATE to use 'create-node' CLI command
Computer.DELETE to use 'delete-node' CLI command
Computer.CONFIGURE to use 'update-node' CLI command and its REST alternative
Computer.READ to use 'get-node' CLI command and its REST alternative
It turns out that Groovy compiler we use to compile src/test/groovy was
not properly generating the 'enclosing class' information inside
*.class, which was causing the load failure of the descriptors marked
by @TestExtension in test code.
To fix this and forestall other possible GMaven related issues, I
decided to bump up the GMaven version. As it turns out, Codehaus GMaven
had ceased the development of the 1.x branch, so I initially tried 2.x
release line.
The 2.x release line got rid of the stub generation functionality, which
we badly need for annotation processing. It instead recommend using
Eclipse compiler to jointly compile Java and Groovy source code
together, but when I tried to compile our tests, it failed to properly
handle nested classes. The compiler quality appears quite premature.
I was then going back to GMaven 1.5, the last 1.x release. I took this
opportunity to rebase my local patches in org.kohsuke.gmaven to the
latest release, which in my mind gets justified now that the upstream
has ceased the development.
My local patch to GMaven is captured in GMAVEN-3 and GMAVEN-4
(see http://jira.codehaus.org/browse/GMAVEN-3 and
http://jira.codehaus.org/browse/GMAVEN-4).
GMAVEN-4 is claimed to be fixed, but when I tried to compile our source
tree I discovered that its handling of nested types breaks the generated
stub code.
In the end, I managed to patch gmaven and posted 1.5-jenkins-1.
The bottom line is, we can now use @TestExtension correctly with Groovy
tests. Also on the upside, we can get rid of org.kohsuke.gmaven and
avoid the current confusion situation of using two GMaven plugins.
I'll make a follow-up change to remove org.kohsuke.gmaven from elsewhere
in our POM.