Repository origin of resolved dependecy

Hi,

I have seen some question on the old forum touching this topic (and GRADLE-2789) I however can’t read a final answer it seems.

Here is what I try to accomplish. Legacy codebase reffers to checked in binaries. Gradle has no problem with that. We now want to move these into artifactory, and will use a special “toxic” repository for these, since they all miss valid poms. Since we want to move forward with cleansing our codebase from these toxins it would be nice if our builds would complain politely each time something from this repo is pulled.

Sort of like:

configurations.runtime {
    if ( incoming.resolutionResult.repo.name == "toxic" ) 
      logger.warn("Lazy developer refering to toxic library")
}

There is currently no public API for determining what repository a given artifact was resolved from. One thing you might try for your use case is an artifact resolution query to attempt to grab the POMs and report those components for which POM resolution fails.

Clarification, sort of half the “toxic” stuff has poms but they are broken (artifactory generated).

I guess I could resolve in two passes (using the fancy resolution query) once with only the toxic repo and every hit here will be “toxic”, and the regular resolve… Might lead to long build time I could guess.

A poor man approach would also be to warn if the “toxic” repo is even seen in the build.