Skip to content

Conversation

@GaoSSR
Copy link

@GaoSSR GaoSSR commented Dec 31, 2025

Fixes #10324

enhanced.append("Failed to collect dependencies");

org.eclipse.aether.graph.Dependency root = request.getRoot();
if (root != null && root.getArtifact() != null) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (root != null && root.getArtifact() != null) {
return if (root != null && root.getArtifact() != null) ? enhanceDependency() : enhanceDependencies(...);

could be extracted as dedicated branch/concern to provide cohesion over coupling.

}
}

for (org.eclipse.aether.graph.Dependency dep : request.getDependencies()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be extracted as dedicated branch/concern to provide cohesion over coupling.

Suggested change
for (org.eclipse.aether.graph.Dependency dep : request.getDependencies()) {
return enhanceDependencies(...)

} catch (DependencyCollectionException e) {
throw new DependencyResolverException("Unable to collect dependencies", e);
String enhancedMessage = enhanceCollectionError(e, collectRequest);
throw new DependencyResolverException(enhancedMessage, e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new DependencyResolverException(enhancedMessage, e);
throw new DependencyResolverException(enhanceCollectionError(e, collectRequest), e);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[MNG-8751] Bad error message when unresolved expressions exist in POM

2 participants