Skip to content

Derive4J annotations scoped "provided" produce compiler warnings in Gradle project #42

@dmolesUC

Description

@dmolesUC

When I include HalBuilder 5 in a Gradle project, I get warnings like these on compilation:

warning: unknown enum constant Flavour.Vavr
  reason: class file for org.derive4j.Flavour not found
warning: unknown enum constant ArgOption.checkedNotNull
  reason: class file for org.derive4j.ArgOption not found
warning: unknown enum constant Make.constructors
  reason: class file for org.derive4j.Make not found
warning: unknown enum constant Make.getters
warning: unknown enum constant Make.casesMatching

My workaround was to include derive4j-annotation as a compile-only dependency (loosely equivalent to Maven provided scope):

  compile 'com.theoryinpractise:halbuilder5:5.1.2'
  compileOnly 'org.derive4j:derive4j-annotation:0.12.3' // avoid HalBuilder-related compile warnings

(The down side of this is I'm hypothetically passing the problem along to anybody that depends on my code, but this particular project is an application rather than a library so that's not likely. In a library, I'd probably have to just make it an explicit compile dependency.)

I don't know what happens in straight Maven, but it seems to me provided might be the wrong scope for the Derive4J libraries, since it doesn't seem likely that it's going to be literally provided by a JDK or container.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions