How do I access POM files of dependencies in a con...
# community-support
s
How do I access POM files of dependencies in a configuration? I tried something like the following but got an empty collection:
Copy code
def files = configurations.myConfig.incoming.artifactView {
            attributes.attribute(ArtifactTypeDefinition.ARTIFACT_TYPE_ATTRIBUTE, "pom")
        }.files.files
        println("Files: $files")
v
There is no such variant you try to resolve. The question also is what you try to achieve. There is the artifact resolution query with which you can get a pom for a dependency but it is not variant aware and thus might not get the intended result, but afaik there is also no variant-aware replacement yet which afaik is the sole reason the ARQ is not deprecated yet. You could probably use a component metadata rule to add a variant that resolves to the POM and then use the artifact view to get the poms. But still the question is what your use-case is. You for example will also only get the direct POM, not any parent POMs for example, neither with the variant approach nor with the ARQ. So it might anyway be questionable what you try to do with the POM.
s
I need to examine the downloaded POM, get provided dependencies from it, and copy them to the POM for the current project. Basically a hack. I know the POM is going to be a simple one so I’m not worried about this thing not working in the general case.
I’ll use ARQ then