plugin-installation-manager-tool icon indicating copy to clipboard operation
plugin-installation-manager-tool copied to clipboard

CLI fails with incorrect plugin dependency minimum version requirement

Open MarkRx opened this issue 4 years ago • 1 comments

The CLI is failing with a false positive incorrect minimum dependency version.

In the example below the active-directory plugin version 2.23 requires a minimum jenkins-configuration-as-code version of 1.35. The update-center and the jar manifest also lists 1.35. The CLI errors out saying that it requires 1.51.

Version

jenkins-plugin-manager: 2.10.0

Reproduction steps

Run the following command: java -jar jenkins-plugin-manager-2.10.0.jar --jenkins-version 2.277.3 --plugins active-directory:2.23 configuration-as-code:1.46 --verbose

Results

Expected result:

The plugins are downloaded as the required minimum dependency versions are met

Actual result:

The CLI fails with an incorrect error

Plugin active-directory:2.23 depends on configuration-as-code:1.51, but there is an older version defined on the top level - configuration-as-code:1.46

Full log

$ java -jar jenkins-plugin-manager-2.10.0.jar --jenkins-version 2.277.3 --plugins active-directory:2.23 configuration-as-code:1.46 --verbose No .txt or .yaml file containing list of plugins to be downloaded entered. No directory to download plugins entered. Will use default of C:\ProgramData\Jenkins\Reference\Plugins No CLI option or environment variable set for update center, using default of https://updates.jenkins.io/update-center.json No CLI option or environment variable set for experimental update center, using default of https://updates.jenkins.io/experimental/update-center.json No CLI option or environment variable set for incrementals mirror, using default of https://repo.jenkins-ci.org/incrementals No CLI option or environment variable set for plugin info, using default of https://updates.jenkins.io/plugin-versions.json No war entered. Will use default of C:\ProgramData\Jenkins\jenkins.war

Retrieving update center information Returning cached value for: update-center-2.277.3 Returning cached value for: experimental-update-center-2.277.3 Returning cached value for: plugin-versions War not found, installing all plugins: C:\ProgramData\Jenkins\jenkins.war Couldn't find checksum for active-directory at version: 2.23 Setting checksum for: active-directory to 3BKDBBSMPMxSsV9GblPciUCuOnJane8yx97mitd2PbQ=

active-directory depends on: configuration-as-code 1.51 mailer 1.34 Setting checksum for: mailer to o4uYQA0ZFVaIRx8/9XOQNT9W4nc/hHbnu3jtem8pHSk=

mailer depends on: display-url-api 2.3.5 Setting checksum for: display-url-api to SkGIILn6p/Ac+pkLdd3GfwkICdP5vYuVcHzXhA60Ugk=

display-url-api has no dependencies Couldn't find checksum for configuration-as-code at version: 1.46 Setting checksum for: configuration-as-code to diOcOromWyfmxnNK3AjseHP3DYSSUnFwnegSUf2hkoU=

configuration-as-code depends on: snakeyaml-api 1.29.1 Setting checksum for: snakeyaml-api to n4s08eZXpOiDSWY5iLQF4t6tax+ec36PrJc2pptuVZU=

snakeyaml-api has no dependencies Will install new plugin display-url-api 2.3.5 Will install new plugin active-directory 2.23 Will install new plugin configuration-as-code 1.51 Will install new plugin snakeyaml-api 1.29.1 Will install new plugin mailer 1.34 io.jenkins.tools.pluginmanager.impl.AggregatePluginPrerequisitesNotMetException: Plugin prerequisite not met: Plugin active-directory:2.23 depends on configuration-as-code:1.51, but there is an older version defined on the top level - configuration-as-code:1.46 at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:218) at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:167) at io.jenkins.tools.pluginmanager.cli.Main.main(Main.java:70) Suppressed: io.jenkins.tools.pluginmanager.impl.PluginDependencyException: Plugin active-directory:2.23 depends on configuration-as-code:1.51, but there is an older version defined on the top level - configuration-as-code:1.46 at io.jenkins.tools.pluginmanager.impl.PluginManager.resolveRecursiveDependencies(PluginManager.java:1093) at io.jenkins.tools.pluginmanager.impl.PluginManager.findPluginsAndDependencies(PluginManager.java:645) at io.jenkins.tools.pluginmanager.impl.PluginManager.start(PluginManager.java:210) ... 2 more Plugin prerequisite not met: Plugin active-directory:2.23 depends on configuration-as-code:1.51, but there is an older version defined on the top level - configuration-as-code:1.46

MarkRx avatar Jul 26 '21 21:07 MarkRx

May be related to #250

MarkRx avatar Jul 26 '21 21:07 MarkRx

This is a user misunderstanding. The plugin installation manager tool installs the most recent version of a dependency unless the --latest false argument is passed.

MarkEWaite avatar Jan 27 '23 03:01 MarkEWaite