-
Notifications
You must be signed in to change notification settings - Fork 74
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
Linkage Checker to throw exception upon missing artifact #2105
Conversation
Interesting. It's always freemarker, why?
|
for (UnresolvableArtifactProblem artifactProblem : artifactProblems) { | ||
logger.warning(artifactProblem.toString()); | ||
} | ||
throw new IOException("Could not resolve dependencies"); |
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.
This might break project with complex dependency tree such as Beam and spring-cloud-gcp.
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.
Confirmed that these are not the case. Beam's usage (LinkageCheckerMain with "-a" option) does not use this code path. Spring-cloud-gcp's usage is through the enforcer rule, which uses ClassPathBuilder before calling LinkageChecker.
This constructor is used by Linkage Monitor and MaximumLinkageErrorsTest.
Todo: add test. What's a good artifact (that has missing transitive dependencies) to create a Bom instance? |
@@ -110,6 +111,20 @@ public static LinkageChecker create(Bom bom, Path exclusionFile) | |||
classPathBuilder.resolve(managedDependencies, true, DependencyMediation.MAVEN); | |||
ImmutableList<ClassPathEntry> classpath = classPathResult.getClassPath(); | |||
|
|||
ImmutableList<UnresolvableArtifactProblem> artifactProblems = | |||
classPathResult.getArtifactProblems(); |
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.
The artifact problems were not not reported. For the Cloud SQL case, it was unclear why MaximumLinkageErrorsTest
fails GoogleCloudPlatform/cloud-sql-jdbc-socket-factory#507 (comment) until I ran it with the debugger.
Fixes #2097