Skip to content

compiler lies about indirectly referenced type can not be resolved? #176

@sgo

Description

@sgo

Hi,
I have a project which builds fine using gradle and in intellij.
When I try to build the same project with the same dependency list in maven using the groovy-eclipse-compiler plugin I get the error message below:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project x: Compilation failure: Compilation failure: [ERROR] InRole.groovy:[1,1] 1. ERROR in InRole.groovy (at line 1) [ERROR] package thinkerit.fitnesse.accounts [ERROR] ^ [ERROR] The type thinkerit.platform.checkpoint.WithPermissionPredicateInteractor$Predicate$1 cannot be resolved. It is indirectly referenced from required .class files

My issue here is that from what I can tell there is nothing wrong.
I go to the InRole class which implements WithPredicateInteractor.Predicate which in turn extends WithPermissionPredicateInteractor.Predicate

Personally I would call this a very direct rather than indirect reference.
But it gets worse. When I rewrite the InRole class to no longer implement this interface the error message doesn't go away.
I find it extremely odd a compiler would insist it can't compile a class A which does not require class B because it can't resolve class B.

But it gets worse. Reading the error message I initially thought I had forgotten the dependency for the predicate but I didn't. It's already listed so it's not like it can't get to it.

So if anything is wrong it has:

  • nothing to do with the class InRole
  • nothing to do with the indirectly referenced type
  • nothing to do with missing dependencies on the class path

So basically I do what now?
I have no actionable information on the problem or how to solve it.
I can't imagine I'm supposed to start randomly rewriting parts of my code in the hopes the compiler will stop complaining about it's non issue?

This issue is extremely frustrating as I can happily code in IntelliJ only to find maven won't compile when I'm ready to commit and with no clue as to which of the many changes I made is to blame.

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