Git repository at <url> did not contain a project publishing the specified dependency

Hi! I’m using the Source Dependency feature detailed here: https://blog.gradle.org/introducing-source-dependencies

//settings.gradle

include ':codegen'
sourceControl {
    gitRepository("https://github.com/twof/swagger-codegen.git") {
        producesModule("io.swagger:swagger-codegen")
    }
}
//build.gradle

implementation("io.swagger:swagger-codegen") {
    version {
        branch = "AdditionalPropertiesFix"
    }
}
// assemble command output

Could not determine the dependencies of task ':codegen:compileJava'.
> Could not resolve all task dependencies for configuration ':codegen:compileClasspath'.
   > Git repository at https://github.com/swagger-api/swagger-codegen.git did not contain a project publishing the specified dependency.
     Required by:
         project :codegen

Any idea what’s going wrong here? I’m rather new to gradle, so apologies if I’ve broken conventions.

Hi @twof! Welcome to the Gradle community. :slight_smile:

Unfortunately, the project (swagger) you are depending on is built with Maven. Source dependencies currently only work with projects that have a Gradle build.

You would need to build your modified version locally with Maven and then depend on it. You can do that, for example, by installing a snapshot with Maven to mavenLocal() and then depending on it in Gradle.
https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:case-for-maven-local