gradle/github-dependency-graph-gradle-plugin

DependencyExtractorBuildService$Inject cannot be cast to class org.gradle.dependencygraph.extractor.DependencyExtractor

Closed this issue · 3 comments

I am attempting to use version 3.3.0 in a multi-module project and receive the following exception:

1: Task failed with an exception.

  • What went wrong:
    class org.gradle.dependencygraph.extractor.DependencyExtractorBuildService$Inject cannot be cast to class org.gradle.dependencygraph.extractor.DependencyExtractor (org.gradle.dependencygraph.extractor.DependencyExtractorBuildService$Inject is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @6fc31064; org.gradle.dependencygraph.extractor.DependencyExtractor is in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader$InstrumentingVisitableURLClassLoader @3822aaed)

Please let me know if you need more information.

How are you applying the plugin?
What java version is being used to run?

This issue looks similar to this one for dependency-submission: I don't have a good explanation for why this leads to the exception reported.

name: Dependency Submission
on:
  workflow_dispatch:
  push:
    branches:
      - master
jobs:
  build:
    runs-on: [ self-hosted ]
    permissions:
      contents: write
    steps:
      - uses: actions/checkout@v4
      - name: setup java
        uses: actions/setup-java@v3
        with:
          distribution: 'temurin'
          java-version: '21'
      - name: Generate and submit dependency graph
        uses: gradle/actions/dependency-submission@v3.3.0

@joeedelman Did you work out what the problem was? Was it related to something in your self-hosted runner?

I'd like to try to reproduce and at least document the conditions that can lead to this error message.