Difference in behavior of PluginWrapper.getDependencies() and UpdateSite.Plugin.dependencies

24 views
Skip to first unread message

Brian Ray

unread,
Aug 3, 2015, 12:37:08 PM8/3/15
to Jenkins Users
Can anybody explain the difference in behavior between these two APIs? The only thing that I can make out is that UpdateSite's dependency properties seem to mirror exactly the dependencies declared in each plugin's MANIFEST.MF file. The PluginWrapper APIs usually return more dependencies, but the nature of the "extra" dependencies returned is unclear. I thought perhaps it was transitive dependencies but tracing 2nd- and N-order dependencies of a few plugins by hand didn't seem to reflect that.

Here's an example console script:

final plug = 'nodelabelparameter'
println
"Plugin-Plugin Dependencies for $plug:\n"

println
'PluginManager/PluginWrapper'
println
'-' * 80
println
Jenkins.instance.pluginManager.getPlugin(plug).dependencies
println
Jenkins.instance.pluginManager.getPlugin(plug).optionalDependencies

println
'\nUpdateCenter/UpdateSite.Plugin'
println
'-' * 80
println
Jenkins.instance.updateCenter.getPlugin(plug).dependencies
println
Jenkins.instance.updateCenter.getPlugin(plug).optionalDependencies

println
'\nUpdateCenter/UpdateSite.Plugin alt'
println
'-' * 80
println
Jenkins.instance.updateCenter.getPlugin(plug).getNeededDependencies()


And output:

Plugin-Plugin Dependencies for nodelabelparameter:

PluginManager/PluginWrapper
--------------------------------------------------------------------------------
[token-macro (1.9), jquery (1.7.2-1), parameterized-trigger (2.22;resolution:=optional), matrix-auth (1.0.2), windows-slaves (1.0), antisamy-markup-formatter (1.0), matrix-project (1.0), junit (1.0)]
[parameterized-trigger (2.22;resolution:=optional), matrix-auth (1.0.2), windows-slaves (1.0), antisamy-markup-formatter (1.0), matrix-project (1.0), junit (1.0)]

UpdateCenter/UpdateSite.Plugin
--------------------------------------------------------------------------------
[token-macro:1.9, jquery:1.7.2-1]
[parameterized-trigger:2.22]

UpdateCenter/UpdateSite.Plugin alt
--------------------------------------------------------------------------------
[]


James Nord

unread,
Aug 4, 2015, 5:31:37 PM8/4/15
to Jenkins Users
the former looks should include all transative deps which will likely incluce the dependencies that are bundled with Jenkins core for the version of jenkins you target (like junit that used to not be a plugin).

The UpdateSite should match exactly the json from the updateCenter.

Brian Ray

unread,
Aug 5, 2015, 2:29:41 PM8/5/15
to Jenkins Users
Transitive dependencies for the first API seems like the best bet. I tried to trace them manually but at that point I was going cross-eyed walking the graph.

Thanks
Reply all
Reply to author
Forward
0 new messages