I want to publish all Gradle modules to a single d...
# community-support
a
I want to publish all Gradle modules to a single directory, without the Maven repository directory layout. I've updated the Gradle Module Metadata so the relative file paths point to the correct location. I expected Gradle would be able to detect the modules based on the Gradle Module Metadata files, but it seems like Gradle is hardcoded to detect the module version from the directory, which fails because I'm not publishing it to a Maven directory https://github.com/gradle/gradle/blob/5bb3182cf38a901dbffbacc0cb9c8efec9f87e9a/platforms/software/dependency-management/src/main/java/org/gradle/api/internal/artifacts/repositories/resolver/M2ResourcePattern.java#L80 Is there a way of defining a
repository {}
that will only use Gradle module metadata to resolve artifacts, and not assume a Maven repository layout?
v
With an Ivy repository you should be pretty free to define whatever layout you want.
a
okay, I think I've managed to reproduce the problem. For some reason Gradle will correctly resolve files in local directories and rely only on GMM, but when the files are http hosted then suddenly Gradle requires the files are hosted using a Maven repository layout pattern. I'll make a reproducer and an issue...
👌 1
ohhhh okay, it's not related to remote/local files. I created a repro using included builds, and Gradle was substituting the project directory, but instead I wanted it to fetch files from a local dir. So basically it doesn't look like Gradle can resolve modules based purely on Gradle Module Metadata files.
v
I guess it is not about maven layout per-se. But typically you have multiple versions in a repository. How do you separate those if not by having the version number somewhere in the path or at least in the file name? It could well be, that Gradle does not cover the rare edge case that you have only one version in a repository and thus take the version from the GMM. 🤷‍♂️
a