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

Fail nicely if dependency-submission and setup-gradle are used together in the same Job #14

Closed
Bert-R opened this issue Feb 3, 2024 · 4 comments · Fixed by #37
Closed
Labels
bug Something isn't working

Comments

@Bert-R
Copy link

Bert-R commented Feb 3, 2024

I'm trying to get dependency submission to work through the PR yonadev/yona-server#1289, but it fails with this error:

FAILURE: Build failed with an exception.

* What went wrong:
Task 'ForceDependencyResolutionPlugin_resolveAllDependencies' not found in root project 'yona-server'.

The dependency submission task is defined as follows:

      - name: Publish Gradle dependencies
        uses: gradle/actions/dependency-submission@v3
        with:
          build-root-directory: yona-server

The action to build the project is successful and is defined straight before the dependency submission. That looks as follows:

      - name: Build and analyze
        uses: gradle/actions/setup-gradle@v3
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}  # Needed to get PR information, if any
          SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
        with:
          build-root-directory: yona-server
          add-job-summary-as-pr-comment: on-failure
          arguments: |
            check
            sonarqube
            --info

We are running Gradle 7.5.1

Your help is appreciated!

@jeff-tyl
Copy link

jeff-tyl commented Feb 5, 2024

I had this error with Gradle 8.2 as well and found by moving the dependency review submission to a separate job it worked. The submission action does not depend on any build steps, so it can run in parallel with the build. I started with the sample job definition provided and had to add the proper Java version setup as well as making gradlew executable.

@Bert-R
Copy link
Author

Bert-R commented Feb 7, 2024

That indeed fixes it. Thanks for the tip! Still, I feel it i's a bug: it makes sense to combine the two in one workflow and the documentation does not state you cannot.

@bigdaz bigdaz changed the title Task 'ForceDependencyResolutionPlugin_resolveAllDependencies' not found in root project Cannot use dependency-submission and setup-gradle steps together in the same Job Feb 9, 2024
@bigdaz
Copy link
Member

bigdaz commented Feb 9, 2024

Thanks for the report. We should certainly make this work, or improve error reporting when you attempt to use setup-gradle and dependency-submission in the same Job.

@bigdaz bigdaz added the bug Something isn't working label Feb 9, 2024
@bigdaz bigdaz changed the title Cannot use dependency-submission and setup-gradle steps together in the same Job Fail if dependency-submission and setup-gradle are used together in the same Job Feb 9, 2024
@bigdaz bigdaz changed the title Fail if dependency-submission and setup-gradle are used together in the same Job Fail nicely if dependency-submission and setup-gradle are used together in the same Job Feb 9, 2024
@bigdaz bigdaz closed this as completed in #37 Feb 9, 2024
bigdaz added a commit that referenced this issue Feb 9, 2024
…the same Job (#37)

Previously, this would fail with a hard-to-diagnose error message.

Fixes #14
@Bert-R
Copy link
Author

Bert-R commented Feb 9, 2024

Thanks for the quick and thorough follow-up!

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

Successfully merging a pull request may close this issue.

3 participants