Closed hohwille closed 2 years ago
As a result in case of a ModelBuildingException
the following code can cause an exception with a wrong message causing confusion.
https://github.com/m-m-m/code/blob/632393e544504754b3d391a9a36e0ddeccdcbc48/java/impl/src/main/java/net/sf/mmm/code/impl/java/source/maven/JavaSourceProviderUsingMaven.java#L179
If computing the effective model results in a
ModelBuildingException
this is catched, logged and thennull
is returned: https://github.com/m-m-m/code/blob/92ef01aba4f112f28964d088278e65cfad1446ab/java/maven/src/main/java/net/sf/mmm/code/java/maven/impl/MavenBridgeImpl.java#L189Instead I would expect we should throw the exception (converted as runtime exception) so callers can catch it and decide ow to handle it (e.g. enrich it with details). Currently the caller is unable to distinguish if he gets
null
because the POM did not exist at all or maven could not resolve a dependency and therefore was unable to compute the effective model.