Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Dependency recommender incompatible with org.apache.maven:maven-model-builder >= 3.8.5 #124

Open
LorenzoMartini opened this issue Oct 24, 2023 · 1 comment

Comments

@LorenzoMartini
Copy link

This repo current has a dependency is on org.apache.maven:maven-model-builder version 3.8.3 (see https://github.com/nebula-plugins/nebula-dependency-recommender-plugin/blob/v12.2.0/build.gradle#L33).

There is a break in maven-model-builder version 3.8.5 that needs consumers to set the version processor (see https://maven.apache.org/ref/3.8.5/apidocs/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.html).
This repo is using that here https://github.com/nebula-plugins/nebula-dependency-recommender-plugin/blob/v12.2.0/src/main/groovy/netflix/nebula/dependency/recommender/provider/MavenBomRecommendationProvider.java#L178-L179 so if in my project for some reason I end up resolving version 3.8.5 of those jars, I will get the following error

Exception while polling provider recommender-4 for version
java.lang.RuntimeException: java.lang.NullPointerException: Cannot invoke "org.apache.maven.model.interpolation.ModelVersionProcessor.overwriteModelProperties(java.util.Properties, org.apache.maven.model.building.ModelBuildingRequest)" because "this.versionProcessor" is null
	at netflix.nebula.dependency.recommender.provider.MavenBomRecommendationProvider.getRecommendations(MavenBomRecommendationProvider.java:93)
	at netflix.nebula.dependency.recommender.provider.MavenBomRecommendationProvider.getVersion(MavenBomRecommendationProvider.java:85)
	at netflix.nebula.dependency.recommender.provider.RecommendationProviderContainer.getRecommendedVersion(RecommendationProviderContainer.java:206)
	at netflix.nebula.dependency.recommender.DependencyRecommendationsPlugin.getRecommendedVersionRecursive(DependencyRecommendationsPlugin.java:219)
	at netflix.nebula.dependency.recommender.DependencyRecommendationsPlugin$2$1$1.execute(DependencyRecommendationsPlugin.java:123)
	at netflix.nebula.dependency.recommender.DependencyRecommendationsPlugin$2$1$1.execute(DependencyRecommendationsPlugin.java:109)
..
..
Caused by: java.lang.NullPointerException: Cannot invoke "org.apache.maven.model.interpolation.ModelVersionProcessor.overwriteModelProperties(java.util.Properties, org.apache.maven.model.building.ModelBuildingRequest)" because "this.versionProcessor" is null
	at org.apache.maven.model.interpolation.AbstractStringBasedModelInterpolator.createValueSources(AbstractStringBasedModelInterpolator.java:160)
	at netflix.nebula.dependency.recommender.provider.MavenBomRecommendationProvider$ProjectPropertiesModelInterpolator.createValueSources(MavenBomRecommendationProvider.java:184)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator.interpolateObject(StringSearchModelInterpolator.java:71)
	at org.apache.maven.model.interpolation.StringSearchModelInterpolator.interpolateModel(StringSearchModelInterpolator.java:65)
	at org.apache.maven.model.building.DefaultModelBuilder.interpolateModel(DefaultModelBuilder.java:750)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:377)
	at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:243)
	at netflix.nebula.dependency.recommender.provider.MavenBomRecommendationProvider.getMavenRecommendations(MavenBomRecommendationProvider.java:155)
	at netflix.nebula.dependency.recommender.provider.MavenBomRecommendationProvider.getRecommendations(MavenBomRecommendationProvider.java:91)
	... 220 more
	```
@jwtodd
Copy link

jwtodd commented Sep 15, 2024

is there any update and/or workaround for this item?

using the palantir baseline plugin which via many-a-dependency surfaces this issue.

Gradle:7.6.4
nebula-dependency-recommender:12.5.0

i'm able to suppress this exception by pinning org.apache.maven-model-builder:3.8.3 whereas it was, in my env, promoting to 3.9.1. the later version clearly has a versionProcessor field which is for unknown reasons null

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants