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

Dependency downloaded but module not found #569

Closed
3 of 5 tasks
LingkKang opened this issue Dec 13, 2023 · 3 comments
Closed
3 of 5 tasks

Dependency downloaded but module not found #569

LingkKang opened this issue Dec 13, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@LingkKang
Copy link

Description

To simply put, Maven have downloaded dependencies, but failed at compiling, saying that it can not find module.

I'm using GSON on my project, it runs well locally, but on GitHub action, Maven keeps reporting the error.

Error:  COMPILATION ERROR : 
Error:  /home/runner/work/gson-ci/gson-ci/src/main/java/module-info.java:[3,24] module not found: com.google.gson

Although accroding to the log, it have downloaded dependencies successfully.

Reproduce

I've abstracted away irrelevant things, left this small repo: LingkKang/gson-ci, and the action still failed to run:

Expected behavior:

Pass the CI.

Actual behavior:

CI failed at Maven compiling.

Task version

uses: actions/setup-java@v4
      with:
        java-version: '21'
        distribution: 'zulu'
        cache: maven
        java-package: jdk+fx

Never tried other distributions because I'm going to use JavaFX.

Platform

  • Ubuntu
  • macOS (not tested
  • Windows

Runner type

  • Hosted
  • Self-hosted

I'm not sure is this really a bug of setup-java, it might due to different Maven version or GSON, but as it can build on local machine, I suspect it was caused by setup-java. 😢

@LingkKang LingkKang added bug Something isn't working needs triage labels Dec 13, 2023
@IvanZosimov
Copy link
Contributor

Hi, @LingkKang 👋 Thanks for the bug report, we will investigate the issue and get back to you with updates.

@LingkKang
Copy link
Author

This is probably because of too old Maven version.

I tried to set up JDK and Maven (using 3.9.6, the latest stable version) manually, and the workflow successed.

A naive demo can be found here:

Additionally, answer of this StackOverflow question 👇 suggested that newer version of Maven compiler plugin can fix it. I suspect they are somehow related.

java - Maven dependency module not found - Stack Overflow

Hope this can help :D

@aparnajyothi-y aparnajyothi-y self-assigned this Oct 3, 2024
@aparnajyothi-y
Copy link
Contributor

Hello @LingkKang, I apologize for the delayed response. Thank you for confirming that the issue was resolved with the latest Maven versions. We have also tested it with the latest stable version, 3.12.1, and the run was successful. Please find the screenshots for reference.
We will proceed to close the issue, as it has been resolved and confirmed.
Please feel free to reach us to reopen the issue in case of any concerns.
Screenshot 2024-11-04 at 6 28 02 PM
Screenshot 2024-11-04 at 6 30 20 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants