Skip to content
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

checkUnusedDependencies could improve compileOnly dependencies #747

Closed
schlosna opened this issue Aug 8, 2019 · 0 comments · Fixed by #783
Closed

checkUnusedDependencies could improve compileOnly dependencies #747

schlosna opened this issue Aug 8, 2019 · 0 comments · Fixed by #783
Labels

Comments

@schlosna
Copy link
Contributor

schlosna commented Aug 8, 2019

What happened?

I've been testing out checkUnusedDependencies on tritium (see palantir/tritium#200) and encounter the following error for a compileOnly dependency on auto-service

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':tritium-registry:checkUnusedDependencies'.
> Found 1 dependencies unused during compilation, please delete them from 'tritium-registry/build.gradle' or choose one of the suggested fixes:
        com.google.auto.service:auto-service

Currently the dependencies are defined as:

    annotationProcessor 'com.google.auto.service:auto-service'
    compileOnly 'com.google.auto.service:auto-service'

If I remove the compileOnly 'com.google.auto.service:auto-service' from tritium-registry/build.gradle then compilation fails as DefaultTaggedMetricRegistry because we import com.google.auto.service.AutoService.

Compiling with JDK Java compiler API.
/Volumes/git/tritium/tritium-registry/src/main/java/com/palantir/tritium/metrics/registry/DefaultTaggedMetricRegistry.java:20: error: package com.google.auto.service does not exist
import com.google.auto.service.AutoService;
                              ^
/Volumes/git/tritium/tritium-registry/src/main/java/com/palantir/tritium/metrics/registry/DefaultTaggedMetricRegistry.java:22: error: cannot find symbol
@AutoService(TaggedMetricRegistry.class)
 ^
  symbol: class AutoService
2 errors

> Task :tritium-registry:compileJava FAILED

What did you want to happen?

A clear mechanism to properly handle compileOnly dependencies with checkUnusedDependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants