* Check that dependencies are enabled. A disabled optional dependency
will not prevent a plugin from loading.
* Check versions of dependencies declared by a plugin before loading it.
If any dependency (even optional) is older than what is required,
then the plugin isn't loaded.
This should prevent use cases where a plugin is loaded but one of its
dependencies is too old so that :
* its @Extension annotated classes cannot be loaded, causing the full
Jenkins to blow up with crapload of exceptions which are tedious to
investigate to understand the root cause.
* NoSuchMethodError and the likes at runtime even though boot has
completed.
Version check (for setups where version list is manually crafted but yet
works) can be disabled by starting Jenkins with
-Dhudson.PluginWrapper.dependenciesVersionCheck.enabled=true
Minor fixes done while implementing this change :
* Fix version parsing in PluginWrapper.Dependency
* Dynamic plugin load didn't check for disabled flag
Without it version of optional dependencies is set to "X.Y;resolution:=optional" which causes problems when using hudson.util.VersionNumber comparison methods.
* Check that dependencies are enabled. A disabled optional dependency
will not prevent a plugin from loading.
* Check versions of dependencies declared by a plugin before loading it.
If any dependency (even optional) is older than what is required,
then the plugin isn't loaded.
This should prevent use cases where a plugin is loaded but one of its
dependencies is too old so that :
* its @Extension annotated classes cannot be loaded, causing the full
Jenkins to blow up with crapload of exceptions which are tedious to
investigate to understand the root cause.
* NoSuchMethodError and the likes at runtime even though boot has
completed.
Version check (for setups where version list is manually crafted but yet
works) can be disabled by starting Jenkins with
-Dhudson.PluginWrapper.dependenciesVersionCheck.enabled=true
Minor fixes done while implementing this change :
* Fix version parsing in PluginWrapper.Dependency
* Dynamic plugin load didn't check for disabled flag
Since sorting of plugins in the update manager is based on displayName
this name should not have a common prefix otherwise it's hard to find
a given plugin name.
Defense against an exception consistently thrown when running functional tests against 1.532.1 (but not 1.540, for whatever reason):
… hudson.PluginWrapper stop
WARNING: Failed to shut down …
java.lang.NullPointerException
at jenkins.model.Jenkins.lookup(Jenkins.java:3898)
at hudson.PluginWrapper.getPlugin(PluginWrapper.java:287)
at hudson.PluginWrapper.stop(PluginWrapper.java:377)
at hudson.PluginManager.stop(PluginManager.java:650)
at org.jvnet.hudson.test.TestPluginManager.reallyStop(TestPluginManager.java:129)
at org.jvnet.hudson.test.TestPluginManager.access$000(TestPluginManager.java:55)
at org.jvnet.hudson.test.TestPluginManager$1.run(TestPluginManager.java:140)
Normally this is only printed during functional tests or during in-process restart.
In neither case do we really want to see a log message (i.e. two lines of text) for each plugin in the system being stopped.