GoogleCloudPlatform / GoogleCloudPlatform/cloud-opensource-java

Enforcer rule to work with partial dependency graph for reportOnlyReachable=true

未关闭
#833 0 条评论 0 个 reaction 已指派 1 人 已被 @suztomo 认领 在 GitHub 查看
enhancement p3
主要语言
Java
星标
163
派生
80
PR 合并指标
30 天内没有已合并 PR

描述

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

![image](https://user-images.githubusercontent.com/28604/62736194-d4859e80-b9fa-11e9-81bb-59b206022aaf.png)

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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。