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

44 views
Skip to first unread message

Brian Ray

unread,
Aug 19, 2015, 2:51:47 PM8/19/15
to Jenkins Developers
[Originally posted on 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--either that or maybe I lost my way in the dependency tree.

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
--------------------------------------------------------------------------------
[]

Jesse Glick

unread,
Aug 20, 2015, 10:30:05 AM8/20/15
to Jenkins Dev
On Wed, Aug 19, 2015 at 2:51 PM, Brian Ray <be_...@sbcglobal.net> wrote:
> The PluginWrapper APIs usually return more dependencies,
> but the nature of the "extra" dependencies returned is unclear.

https://github.com/jenkinsci/jenkins/blob/fd83a285b3b1560ba19122ff33edc522de7027f0/core/src/main/java/hudson/ClassicPluginStrategy.java#L238-L239

Brian Ray

unread,
Aug 20, 2015, 4:56:05 PM8/20/15
to Jenkins Developers
Ah, the previously-core plugins. Makes sense now.

Thanks,
Reply all
Reply to author
Forward
0 new messages