Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manually downloading JAR from Google Maven

Tags:

android

maven

I'm trying to manually download some JAR files from Google Maven. Following official documentation doesn't seem to work. For example:

  • I'm able to download POM from URL: https://dl.google.com/dl/android/maven2/androidx/test/rules/1.1.0/rules-1.1.0.pom
  • But I get 404 when trying to download JAR from URL: https://dl.google.com/dl/android/maven2/androidx/test/rules/1.1.0/rules-1.1.0.jar

Am I doing something wrong?

like image 509
FlyingPumba Avatar asked Oct 27 '25 14:10

FlyingPumba


1 Answers

This is because the library is not a jar but an aar (Android Archive). Try

https://dl.google.com/dl/android/maven2/androidx/test/rules/1.1.0/rules-1.1.0.aar

And it will work.

Edit: You can determine this from the <packaging> tag in the pom file:

<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
    xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <groupId>androidx.test</groupId>
  <artifactId>rules</artifactId>
  <version>1.1.0</version>
  <packaging>aar</packaging>
like image 163
Twometer Avatar answered Oct 30 '25 04:10

Twometer