Hello team, I have a question regarding transitiv...
# community-support
a
Hello team, I have a question regarding transitive dependencies. Currently, I am resolving the dependencies using artifact metasource, because there is an issue in the pom metadata file of the library I am using which has a snapshot in it, so it is giving inconsistent module metadata found. My question is there a way to ignore the inconsistency module metadata issue and use Maven Pom metadata source to include transitive dependencies of my-library, because from what I understood is that Maven pom metadata source will include transitive dependencies, or any other way to include transitive dependencies (keeping in mind I can’t do any changes to the library ex: creating a fatjar or fixing the metadata pom file)
Copy code
repositories {
    maven {
        url = uri("<https://xyz>")
        metadataSources {
            artifact() //Look directly for artifact instead of metadata file
        }
    }
}

dependencies {
   api("my-library")
}
c
what's the issue in the metadata that you're working around? (I'm guessing the answer to the direct question is no, but maybe there's a workaround for the original issue without monkey patching the jar)
a
It is inconsistency issue: inconsistent module metadata found add the metasource as artifact instead of metadata file (xxxx-SNAPSHOT). That is why I switched to use artifact metadata source.
Any thoughts about this issue πŸ™‚ ?
v
Iirc if the metadata file is broken in a way it cannot be parsed, there is not much you can do. If it were wrong content like wrong dependencies and so on, you could use a component metadata rule to fix it ad-hoc as work-around. But if the metadata is broken, there is probably not much you can do than ignoring it and maybe then use a component metadata rule to add the dependencies. If you have also other dependencies that are resolved from that repository and where the metadata should be used, you can probably just declare the repository twice and use a respository content filter or exclusive content configuration so that the one broken is resolved from the one where you disabled the metadata and the others are resolved normally with metadata. But this should really be fixed in that library.
πŸ‘ 1
a
I agree the library should be fixed, but since I have no control over the library then will probably check these workarounds! Thanks alot
πŸ‘Œ 1
Hi @Vampire sorry to open this up. But I tried to apply a component metadata rule to download dependencies, but I think the check of pom version is done first and I still get:
Copy code
inconsistent module metadata found. Descriptor: xxxxx:DEV-SNAPSHOT Errors: bad version: expected='1.2.0' found='DEV-SNAPSHOT'
Can I use a component metadata rule to fix the version? If not I would just need to download the transitive dependencies of the target dependency.
v
Please read my answer again. I already there said you cannot fix that with a component metadata rule and suggested different things
πŸ‘ 1