Move the process to core to be reusable, not only for the cli command.
Add optionalDependants list to PluginWrapper to process them easily.
Replace (depreacate) the disable method without checks by this one with
strategies.
Improve messages and tests
* [JENKINS-50336] Only keep extensions that could be loaded in memory
So that delta computations will re-attempt to load any extension that
previously failed or was skipped after a new plugin is installed.
After installing a plugin, need to refresh extensions in order to pick
up extensions that can be loaded thanks to this new plugin.
* [JENKINS-50336] @OptionalExtension annotated classes were not being picked up after dynamic load of variant
Recompute GuiceExtensionAnnotation list when refreshing extensions
* Adding some interface default method implementations rather than catching AbstractMethodError or providing partial implementation classes.
* Show Javadoc warnings and errors, but not ‘Generating …/core/target/site/apidocs/jenkins/model/lazy/class-use/AbstractLazyLoadRunMap.html...’ and the like.
* Javadoc fixes.
* Review comments from @oleg-nenashev.
* Test fixes.
* Remove the unused import
* [SECURITY-372] Update bundled mailer to 1.20.
* Updated to pick up other detached plugins mentioned in https://jenkins.io/security/advisory/2016-04-11/ or https://jenkins.io/security/advisory/2017-03-20/ while we are here.
* I18nTest.test_baseName_plugin caught that the detached version of credentials was too old to serve as a dependency.
Probably there should be some test case verifying that all detached plugins could be loaded at once,
though it would need to do a topological sort in dependency order.
* Must also include display-url-api as a detached plugin as it is a dependency, even though it was never actually detached from core.
* @oleg-nenashev insists on bundling display-url-api 2.0.
* Do not load detached plugins during tests.
Also warn about plugins which force us to create classes.jar.
* Porting POM fix from #2795: we must allow snapshots from repo.jenkins-ci.org so as to be able to test upstream component PRs.
* Fixed failures in tests which assumed detached plugins were being loaded.
* jenkins-test-harness 2.20
* Unreproducible test failure on CI, probably due to timing.
* [FIXED JENKINS-41684] Ensure that PluginManager.dynamicLoad runs as SYSTEM.
Test plugin source:
package test;
import hudson.Plugin;
import jenkins.model.Jenkins;
public class ThePlugin extends Plugin {
@Override
public void postInitialize() throws Exception {
Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
}
}
* @daniel-beck wants this all reindented.
* [JENKINS-37332] - Improve diagnostics of non-closed streams during reading of the manifests in PluginManager
* [JENKINS-37332] - Leakless processing of JarUrlConnection during Manifest parsing
* [JENKINS-37332] - Also implement leak-safe method for retrieving file modification date
* [JENKINS-37332] - Add spotcheck methods for manifest file access + Javadoc
* [JENKINS-37332] - Also test multi-line and empty attributes in the test
(cherry picked from commit 96c97860b0)
* [JENKINS-37332] - Improve diagnostics of non-closed streams during reading of the manifests in PluginManager
* [JENKINS-37332] - Leakless processing of JarUrlConnection during Manifest parsing
* [JENKINS-37332] - Also implement leak-safe method for retrieving file modification date
* [JENKINS-37332] - Add spotcheck methods for manifest file access + Javadoc
* [JENKINS-37332] - Also test multi-line and empty attributes in the test
* 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