You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refreshVersions is not able to find the latest versions of artifact in local maven repository.
To Reproduce
Publish any project/library that uses maven-publish plugin to local maven repository, e.g. via ./gradlew publishToMavenLocal
Use it as a dependency in another project with refreshVersions, specifying the local repository via repositories { mavenLocal() } block.
refreshVersions fails to find any published versions of this artifact in local maven repository.
Expected behavior
refreshVersions should find the latest version of the artifact.
Additional context
This happens due to the fact that publishing to local maven repository creates maven-metadata-local.xml and refreshVersions only checks for maven-metadata.xml (also after renaming of the metadata file, the versions could be found).
Proposed solution
It might be a good idea to use maven-metadata-local.xml as a fallback, if the maven-metadata.xml file is not found, or even better to use it as a primary location, if the repository is a local maven repository (recognizing it e.g. via repoUrl containing a file scheme and path (usually) containing .m2 substring/pattern).
Note: The generic metadata file format for non-remote repositories is maven-metadata-<repo-id>.xml for a repository with repo-id identifier, but this defaults almost always to 'local'.
The text was updated successfully, but these errors were encountered:
yokeru
changed the title
Support for local maven repository
Add support for local maven repository
Sep 11, 2020
Thanks for the report with the precise information!
That name difference explains my questioning when I didn't see the local version but it worked when adding it manually.
Describe the bug
refreshVersions is not able to find the latest versions of artifact in local maven repository.
To Reproduce
maven-publish
plugin to local maven repository, e.g. via./gradlew publishToMavenLocal
repositories { mavenLocal() }
block.Expected behavior
refreshVersions should find the latest version of the artifact.
Additional context
This happens due to the fact that publishing to local maven repository creates
maven-metadata-local.xml
and refreshVersions only checks formaven-metadata.xml
(also after renaming of the metadata file, the versions could be found).Proposed solution
It might be a good idea to use
maven-metadata-local.xml
as a fallback, if themaven-metadata.xml
file is not found, or even better to use it as a primary location, if the repository is a local maven repository (recognizing it e.g. via repoUrl containing a file scheme and path (usually) containing.m2
substring/pattern).Note: The generic metadata file format for non-remote repositories is
maven-metadata-<repo-id>.xml
for a repository withrepo-id
identifier, but this defaults almost always to 'local'.The text was updated successfully, but these errors were encountered: