GoogleCloudPlatform / GoogleCloudPlatform/cloud-opensource-java
Enforcer rule to work with partial dependency graph for reportOnlyReachable=true
- Dominant language
- Java
- Stars
- 163
- Forks
- 80
- PR merge metrics
- No merged PRs in 30d
Description
Enforcer rule to work with partial dependency graph for reportOnlyReachable=true
I was testing the enforcer rule with Ray's grpc Java example https://github.com/saturnism/grpc-java-by-example/tree/master/chat-example/chat-vaadin-client . It failed to build dependency graph due to missing dependency:
```
[ERROR] Could not find artifact org.jboss.logging:jboss-logging:pom:3.0.0.Beta5-SNAPSHOT
[ERROR] Paths to the missing artifact:
[WARNING] Rule 0: com.google.cloud.tools.dependencies.enforcer.LinkageCheckerRule warned with message:
Unable to build a dependency graph: Could not resolve dependencies for project org.test:chat-vaadin-client:war:1.0-SNAPSHOT: Failed to collect dependencies at
com.vaadin:vaadin-server:jar:8.1.6
-> com.vaadin:vaadin-push:jar:8.1.6
-> com.vaadin.external.atmosphere:atmosphere-runtime:jar:2.4.11.vaadin2
-> org.atmosphere.jboss.as:jboss-as-websockets:jar:0.5
-> org.jboss.as:jboss-as-server:jar:7.1.1.Final
-> org.jboss.as:jboss-as-controller:jar:7.1.1.Final
-> org.jboss.msc:jboss-msc:jar:1.0.2.GA
-> org.jboss.logging:jboss-logging-processor:jar:1.0.0.Beta5
-> org.jboss.logging:jboss-logging:jar:3.0.0.Beta5-SNAPSHOT
```
This error prevents me to read any linkage error from partial dependency graph. The tool would be more informative if it continues to run Linkage Checker even when a dependency cannot be resolved.
- A dependency that's not supposed to publish in public Maven repository
Vaadin 8.1's buildhelper module is only needed during build time (and thus specified `provided`) (https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/834#issuecomment-519585027)
- Some artifacts are removed from Maven Central
`xerces:xerces-impl:jar:2.6.2` and `xml-apis:xml-apis:jar:2.6.2` are no longer found in Maven Central https://github.com/GoogleCloudPlatform/cloud-opensource-java/issues/792#issue-471246752

This enhancement idea would make sense especially when the enforcer rule is used with `reportOnlyReachable = true`. The missing dependency might be unreachable from users project.
Branch partial_deps.
Contributor guide
Assessment
This issue has not been assessed yet.