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
[MNG-7771] Don't use ArtifactResolutionException#getMessage() w/o knowing whether there are other exceptions or not #9214
ArtifactResolutionException#getMessage() only considers the message from the first cause, completely ignoring other causes. So it is order-dependent and can be misleading. Create an expeception-agnotic message and all submessages shall be retrieved through API.
The exception carries multiple important information, and this really about formatting understandable, meaningful, but at the same time complete error message on console (to user) in case it is being thrown.
Correct, Tamas Cservenak nailed it mostly. The information has to be in the exception and Maven has to expose it correct. Neither is. Even if the issue is not in Maven per sé, the issue is visible from Maven from a user's PoV.
Activity
jira-importer commentedon Jun 1, 2023
Guillaume Nodet commented
AFAIK,
ArtifactResolutionExceptionare thrown from old services in maven-compat, so I don't think we should waste any time on those.jira-importer commentedon Jun 3, 2023
Michael Osipov commented
No, they come straight from Resolver otherwise I would not raise. This is a seriously annoying issue.
jira-importer commentedon Dec 11, 2023
Michael Osipov commented
Tamas Cservenak
jira-importer commentedon Dec 11, 2023
Tamas Cservenak commented
There are several of these:
https://github.com/apache/maven/blob/master/maven-artifact/src/main/java/org/apache/maven/artifact/resolver/ArtifactResolutionException.java
But we talk about resolver one:
https://github.com/apache/maven-resolver/blob/master/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResolutionException.java
Yes, Resolver 2.0.0 makes possible now to create more meaningful (and precise) messages, as this new method is added:
https://github.com/apache/maven-resolver/blob/master/maven-resolver-api/src/main/java/org/eclipse/aether/resolution/ArtifactResult.java#L141
jira-importer commentedon Jul 6, 2024
Guillaume Nodet commented
I don't see any place in Maven where this exception is created. AFAIK, it always comes from the resolver.
jira-importer commentedon Jul 6, 2024
Michael Osipov commented
gnodet, it is not, but it is visible through Maven to the user.
jira-importer commentedon Jul 7, 2024
Guillaume Nodet commented
Michael Osipov That was my understanding too. But then, shouldn't we move the issue to maven-resolver ?
I don't really understand what you expect from Maven.
jira-importer commentedon Jul 7, 2024
Tamas Cservenak commented
The exception carries multiple important information, and this really about formatting understandable, meaningful, but at the same time complete error message on console (to user) in case it is being thrown.
jira-importer commentedon Jul 7, 2024
Tamas Cservenak commented
So this is more about "consuming" and formatting console output for user when this exception is thrown.
jira-importer commentedon Jul 7, 2024
Michael Osipov commented
Correct, Tamas Cservenak nailed it mostly. The information has to be in the exception and Maven has to expose it correct. Neither is. Even if the issue is not in Maven per sé, the issue is visible from Maven from a user's PoV.