Cannot fetch a module with a version range with Gradle #70527
Replies: 2 comments 1 reply
-
The error message indicates that the Gradle build is failing due to a missing resource when trying to resolve a dependency from the GitHub Package Registry. Specifically, it's failing to find a version of the com.microej:lib dependency within the specified range [0.1.1,0.1.2] in the GitHub Package Registry. Here's what you can do to resolve this issue: 1). Check the Dependency Coordinates: First, double-check that the dependency coordinates in your project's Gradle build file (usually build.gradle) are correctly specified. Ensure that you are using the correct group, name, and version for the com.microej:lib dependency. 2). Verify GitHub Package Registry URL: Make sure that the GitHub Package Registry URL, in this case, https://maven.pkg.github.com/OWNER/REPOSITORY/com/example/foo/, is accurate. Replace OWNER and REPOSITORY with the actual owner and repository names. 3). Check Permissions and Authentication: Verify that you have the necessary permissions to access the GitHub Package Registry. If the repository is private, you may need to configure authentication or provide access credentials in your Gradle build script. 4). Ensure the Package is Published: Confirm that the com.microej:lib package with versions within the specified range [0.1.1,0.1.2] is actually published in the GitHub Package Registry at the provided location. If it's not published or if there are no versions in that range, you'll need to publish it or use a different version. 5). Double-check Gradle Configuration: Ensure that your project's Gradle settings, including repositories, are correctly configured to access the GitHub Package Registry. You should have a repository configuration in your build.gradle file or in your Gradle settings file that points to GitHub Package Registry. 6). Network and Proxy Settings: Check your network connection and ensure that there are no proxy-related issues that might prevent Gradle from accessing the internet and the GitHub Package Registry. Once you've reviewed and addressed these points, you should be able to resolve the issue and successfully build your project. |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
Hello,
I have published a snapshot version of a module
com.example.foo
with version like0.1.1-RC202310131432
on the Gihub Packages of my organization. The package has private visibility and I can see it on the Packages page on Github.I can fetch this module in a
build.gradle.kts
file of a project withimplementation("com.example:foo:0.1.1-RC202310131432")
.I am using a Personal Access Token with
repo
,workflow
,read:packages
andwrite:packages
.Now the issue is that I cannot fetch the same module when using
implementation("com.example:foo:0.1.1-RC+")
instead. Gradle supports this kind of syntax as stated in Gradle user guide. This syntax also works with another artifact repository that we are using.The debug logs of Gradle show the following:
It seems to me that the operation
List
is not successful.I tried with
curl
:it returns a 404 and the message
maven package "com.example" does not exist under owner "OWNER"
When using the exact file address, it is found using this command:
My understanding is that one cannot list the content of a folder. However, I assume that Gradle relies on listing the folders to get the available versions when using ranges.
Is it the expected behavior with version ranges and Github Packages? Is it a limitation? I could not find any documentation on this.
Supporting version ranges seems like a basic feature so I guess I may missed something. For example, could it be also related to the fact that my package is private?
Edit:
Same behavior with version ranges like
[0.1.1,0.1.2]
:Thank you for any help :)
Beta Was this translation helpful? Give feedback.
All reactions