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

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

Closed
sgo opened this issue Apr 14, 2016 · 3 comments
Closed

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

sgo opened this issue Apr 14, 2016 · 3 comments

Comments

@sgo
Copy link

sgo commented Apr 14, 2016

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.

@eric-milles
Copy link
Member

Is this still an issue with the latest snapshot builds? Can you provide a simple example that demonstrates the problem (i.e. code that can be run in a test to prove the issue exists and gets fixed)?

@sgo
Copy link
Author

sgo commented Feb 1, 2017

Quite frankly I have reverted back to using gradle with it's "working" groovy compiler because I just can't afford the time it takes to fix this issue. In that I never managed to find the code which caused this problem.

I'd love to give you an example bit of code but it's not like I know what construct caused the problem. And the code I was having the problem on is a rather large project which isn't open source.
If I run into it again with some open source code I can come back and point to a commit but no idea when that will be.

I'm not sure I will bother trying to use maven with the groovy-eclipse-compiler in the near future as the main reason I wanted to use it is because maven doesn't appear to generate deadlocks when resolving dependencies as soon as there are 3 concurrent builds running on the same build server.
This happens with gradle and it's quite annoying to see builds fail on dependency resolution.
However given the new popularity for docker based build servers means I don't have to care about that problem.

I'm sorry I can't be of more help.

@eric-milles
Copy link
Member

Thanks. I'll close this issue then.

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

No branches or pull requests

2 participants