-
Notifications
You must be signed in to change notification settings - Fork 27
chore: derive shared-dependencies version from effective pom #6531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| ModelBuilder builder = new DefaultModelBuilderFactory().newInstance(); | ||
| Model effectiveModel = builder.build(request).getEffectiveModel(); | ||
| return effectiveModel.getProperties().getProperty("google-cloud-shared-dependencies.version"); | ||
| } catch (XmlPullParserException | IOException ignored) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know why these exceptions are ignored, but the ModelBuildingException is thrown?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a good question. It is a little unclear as to why the exceptions were ignored. https://effectivejava.googleplex.com/third-edition#page=331 advices against this especially without appropriate comments explaining the reasoning and suggests the following to avoid silent failures:
Merely letting an exception propagate outward can at least cause the
program to fail swiftly, preserving information to aid in debugging the failure.
...ard/src/main/java/com/google/cloud/tools/opensource/cloudbomdashboard/ArtifactMavenData.java
Outdated
Show resolved
Hide resolved
…dbomdashboard/ArtifactMavenData.java Co-authored-by: Burke Davison <[email protected]>
Fixes #6523. Locally tested by calling: