Skip to content

NoClassDefFoundError in IntelliJ because AutoService has class retention #1032

Closed

Description

@netdpb

Maven projects using AutoValue have to explicitly depend on AutoService as well in order to avoid errors when using IDEs like IntelliJ.

For example see https://github.com/googleapis/java-shared-config/blob/393ba5669675afb44740fdc45c8110feccf0b3b6/pom.xml#L773-L786.

Can we change AutoService's retention back to source? Alternatively, can we change AutoValue's dependency on AutoService to have the normal compile scope instead of provided?

Activity

  1. cpovirk commented on Mar 25, 2021

    @cpovirk
    Member

    I am always happy to see annotation deps promoted from provided to compile :)

    Our dependency on auto-service...

    <scope>provided</scope>

    ...may well just predate our current advice to use annotationProcessorPaths plus a dep on auto-service-annotations. (Maybe auto-service-annotations didn't even exist as a separate package back then?)

  2. added and removed on Mar 25, 2021
  3. imtdeepak commented on Mar 25, 2021

    @imtdeepak

    We also faced the same issue and had to set the annotation processor in Intellij to obtain processors from the project classpath whenever we want to run or debug.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址