KEMBAR78
build: update annotationProcessorPaths to include auto-service-annotations by BenWhitehead · Pull Request #53 · googleapis/java-firestore · GitHub
Skip to content

Conversation

@BenWhitehead
Copy link
Collaborator

With the recent bump to auto-value-annotations 1.7 IntelliJ is not longer
able to build the project due to a NoClassDefFoundError.

Here we manually pull in auto-service-annotations so that it is part of the
processor path because auto-value has it set to provided scope.

This dependency is needed due to the retention change in
google/auto@628df54
where the RetentionPolicy changed from SOURCE to CLASS.

Due to the RetentionPolicy change to CLASS we must have the
annotations available on the processor path otherwise the following
will error will be thrown. (This is a particular problem with the
annotation processor configuration in IntelliJ)

Error:java: java.lang.NoClassDefFoundError: com/google/auto/service/AutoService
com.google.auto.service.AutoService

…tions

With the recent bump to auto-value-annotations 1.7 IntelliJ is not longer
able to build the project due to a NoClassDefFoundError.

Here we manually pull in auto-service-annotations so that it is part of the
processor path because auto-value has it set to provided scope.

This dependency is needed due to the retention change in
google/auto@628df54
where the RetentionPolicy changed from SOURCE to CLASS.

Due to the RetentionPolicy change to CLASS we must have the
annotations available on the processor path otherwise the following
will error will be thrown. (This is a particular problem with the
annotation processor configuration in IntelliJ)

Error:java: java.lang.NoClassDefFoundError: com/google/auto/service/AutoService
com.google.auto.service.AutoService
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Dec 18, 2019
@BenWhitehead BenWhitehead requested a review from a team December 18, 2019 18:10
@codecov
Copy link

codecov bot commented Dec 18, 2019

Codecov Report

Merging #53 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #53   +/-   ##
=========================================
  Coverage     71.33%   71.33%           
  Complexity      988      988           
=========================================
  Files            62       62           
  Lines          5323     5323           
  Branches        599      599           
=========================================
  Hits           3797     3797           
  Misses         1339     1339           
  Partials        187      187

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce4c37b...a629e87. Read the comment docs.

Copy link
Contributor

@elharo elharo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Option 2: don't use autovalue.

<version>${auto-value.version}</version>
</path>
<!--
There is currently no available version of auto-service-annotations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Java 7 CI failed. Perhaps we should ask @netdpb to push one compiled for Java 7?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The java 7 build failed because of a timeout from maven central.

I don't know if we specifically need a release for Java 7 as we perform release builds with Java 8 and a 1.7 target.

@BenWhitehead BenWhitehead merged commit 368d98a into googleapis:master Dec 19, 2019
@BenWhitehead BenWhitehead deleted the auto-value-fix branch December 19, 2019 18:22
@netdpb
Copy link

netdpb commented Jan 7, 2020

IntelliJ gives no further information about that error, like a stacktrace? @AutoService has class retention; it shouldn't have to be on the classpath to load the AutoValue processor.

@BenWhitehead
Copy link
Collaborator Author

Correct @netdpb This is all that was printed by IntelliJ, even with -verbose added to the compiler args.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants