You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enhancement: limit report to updates actionable in the context of pom.xml #1140
I found nothing similar in closed issues, if you consider this a duplicate to a previous issue, feel free to close it.
Motivation:
I'm trying to limit the reports down to a point that all listed dependencies, plugins, parent and properties version are specified in the analyzed pom.xml. Basically all inherited (upstream) issues should be ignored. I want to make it as simple and fast as possible to fix such issues without the need to reason about if a reported issue is inherited from upstream.
Example: two projects, from different reactors
parent/pom.xml uses spring-boot-starter-parent:3.3.1, but 3.3.3 is latest version
service/pom.xml uses parent/pom.xml at latest version
report for
parent/pom.xml
MUST list outdated parent
MUST NOT list e.g. outdated plugins, dependencies that are inherited from spring-boot-starter-parent
service/pom.xml
MUST NOT list e.g. outdated parent, plugins etc. inherited from parent/pom.xml
Possible Solutions:
preferred, additional flag e.g. ignoreInherited to control this behavior
alternative, mark "inherited" issues in reports (and possibly xml) as such
[INFO] The following dependencies in Dependencies have newer versions:
[INFO] com.oracle.database.jdbc:ojdbc11 ............ 21.9.0.0 -> 23.6.0.24.10
...
[INFO] The following dependencies in pluginManagement of plugins have newer versions:
[INFO] org.springframework.boot:spring-boot-maven-plugin ..... 3.3.4 -> 3.3.5
The version of neither of both is directly specified in child/pom.xml, but inherited from parent/pom.xml, and both are ignored by e. g. versions:use-latest-version. This makes it hard to reason about what e. g. versions:use-latest-version will change.
Thanks for the update. Not exactly sure how to tackle this. The plugin has a history and its goals do differ in behaviour ever so slightly. For example, use-latest-versions doesn't process any dependencies within build plugins or pluginManagement, display-dependency-updates does do it (which can be disabled e.g. by processPluginDependencies or processPluginDependenciesInPluginManagement), hence it displays the updates there (spring-boot-maven-plugin) whereas use-latest-versions doesn't.
Regarding the version of ojdbc11 -- it's assigned by Maven based on parent of the parent. This should probably not be reported by display-dependency-updates especially considering the fact that you did disable transitive dependencies.
use-latest-versions does see the version as well, and it's trying to update it but it can't find the <version> element to update and it skips it because of that.
I believe that showing an update of a dependency which is not governed by any of the project files is incorrect; it can be updated by updating the parent or bom dependencies. Even so, there exists an integration test checking for just that, added by #291.
Marking as both bug and enhancement as it will probably need a feature toggle to preserve backward compatibility.
Same thing is true about e.g. dependency-updates-report, which also outputs dependencies managed by parent outside of the reactor in this case, because the that Mojo, too, operates on the Maven interpolated model.
Activity
andrzejj0 commentedon Oct 27, 2024
Have you tried setting processDependencyManagementTransitive to false?
rmie commentedon Oct 28, 2024
yes
andrzejj0 commentedon Nov 17, 2024
I can't reproduce the issue when using -DprocessDependencyManagementTransitive=false.
Please provide a minimal pom.xml (or set of maven projects) reproducing the issue.
For example, for the following pom.xml
the report lists
dummy-apias the only dependency having available dependency updatesrmie commentedon Nov 18, 2024
The testcase is made up of two poms, parent/pom.xml and child/pom.xml, intentionally not placed in a single reactor build.
running mvn -f child/pom.xml' versions:display-dependency-updates gives
The version of neither of both is directly specified in child/pom.xml, but inherited from parent/pom.xml, and both are ignored by e. g. versions:use-latest-version. This makes it hard to reason about what e. g. versions:use-latest-version will change.
andrzejj0 commentedon Nov 18, 2024
I'm missing the actual pom.xml files to be able to reproduce your case.
rmie commentedon Nov 18, 2024
sorry forgot to upload testcase.zip
andrzejj0 commentedon Nov 18, 2024
Thanks for the update. Not exactly sure how to tackle this. The plugin has a history and its goals do differ in behaviour ever so slightly. For example,
use-latest-versionsdoesn't process any dependencies within build plugins orpluginManagement,display-dependency-updatesdoes do it (which can be disabled e.g. by processPluginDependencies or processPluginDependenciesInPluginManagement), hence it displays the updates there (spring-boot-maven-plugin) whereasuse-latest-versionsdoesn't.Regarding the version of
ojdbc11-- it's assigned by Maven based on parent of the parent. This should probably not be reported bydisplay-dependency-updatesespecially considering the fact that you did disable transitive dependencies.use-latest-versionsdoes see the version as well, and it's trying to update it but it can't find the<version>element to update and it skips it because of that.I believe that showing an update of a dependency which is not governed by any of the project files is incorrect; it can be updated by updating the parent or bom dependencies. Even so, there exists an integration test checking for just that, added by #291.
Marking as both
bugandenhancementas it will probably need a feature toggle to preserve backward compatibility.andrzejj0 commentedon Nov 20, 2024
Same thing is true about e.g.
dependency-updates-report, which also outputs dependencies managed by parent outside of the reactor in this case, because the that Mojo, too, operates on the Maven interpolated model.7 remaining items
Fixes mojohaus#1140: Added showVersionless (default true)
Fixes mojohaus#1140: Added showVersionless (default true)
Fixes mojohaus#1140: Added showVersionless (default true)
Fixes mojohaus#1140: Added showVersionless (default true)
Fixes mojohaus#1140: Added showVersionless (default true)
Fixes mojohaus#1140: Added showVersionless (default true)
Fixes mojohaus#1140: Added showVersionless (default true)
Fixes #1140: Added showVersionless (default true) (#1187)
Fixes mojohaus#1140 for reports
Fixes mojohaus#1140 for reports
Fixes mojohaus#1140 for reports
Fixes mojohaus#1140 for reports
Fixes #1140 for reports (#1188)