question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vscode-java reports "cannot be resolved" errors in Gradle plugin project with mix of Groovy and Java

See original GitHub issue

In Gradle plugins implemented with a mix of Java and Groovy, vscode-java reports “cannot be resolved” errors in .java files that reference classes defined in .groovy files. Gradle can compile and build the plugin successfully.

Environment
  • Operating System: macOS 10.15.4
  • JDK version:
    openjdk version "13.0.2" 2020-01-14
    OpenJDK Runtime Environment (build 13.0.2+8)
    OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
    
  • Visual Studio Code version:
    Version: 1.45.0-insider
    Commit: abb4a35cfc26102f93fd00df7b59ce1a19c2017a
    Date: 2020-04-28T05:34:21.109Z (20 hrs ago)
    
  • Java extension version: 0.60.0
Steps To Reproduce
  1. Clone https://github.com/a01fe/gradle-groovy-java-plugin
  2. cd gradle-groovy-java-plugin/test; ./gradlew javaTask This builds the plugin and runs a task in the plugin to verify it compiles and builds successfully
  3. Open the project in vscode and open src/main/groovy/foo/task/JavaTask.java, vscode-java reports errors on all the references to JavaTaskSpec.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

2reactions
tekleayelecommented, Oct 11, 2021

Has there been any updates since the last convo on this issue/blocker ?

1reaction
eric-millescommented, Apr 30, 2020

Joint compilation for Groovy and Java for LSP has been discussed. Also, there may be Groovy LSP implementations already, but I am unsure about their support for joint compilation (inter-dependency) of Groovy and Java sources.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"Unresolved dependency" / "import cannot be resolved" in VS ...
The issue is that VSCode Language Support for Java does not recognize the dependencies / imports in build.gradle or in our Java source...
Read more >
Gradle 7.0.1 Release Notes
This release enables file system watching by default to make your incremental builds faster, expands support for building projects with Java 16, and...
Read more >
Groovy Language Documentation
2.5. groovydoc, the Groovy & Java documentation generator ... In particular, it is possible to combine the not operator with the Groovy truth:....
Read more >
VS Code Java September 2021 Update | Foojay.io Today
Error reporting. The Gradle language server will use Groovy compile engine to analyze the Gradle build file and report syntax errors if exist....
Read more >
redhat-developer - Bountysource
I've tried both Gradle and Maven. VS Code p shows me a bunch of "cannot be resolved" errors for any classes called out...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found