I have a library (my own) in a private maven repo. I ship it there with javadoc and sources:
In my app I've declared this repo:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url = uri("https://jitpack.io")
}
maven { // <- This is my private repo
credentials {
username = extra["mavenUser"] as String
password = extra["mavenPassword"] as String
}
url = uri(extra["mavenUrl"] as String)
}
}
}
It downloads the aar without any problems, but doesn't download sources, and when I'm trying to force it by clicking «Download sources» it fails:
Execution failed for task ':app:DownloadSources'.
> Could not resolve all files for configuration ':app:downloadSources_36c7b334-04c2-4099-b66c-2adc137cc95c'.
> Could not find com.example.path:common-core:0.0.1@aar.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/example/path/common-core/0.0.1@aar/[email protected]
- https://repo.maven.apache.org/maven2/com/example/path/common-core/0.0.1@aar/[email protected]
- https://jitpack.io/com/example/path/common-core/0.0.1@aar/[email protected]
- https://repo.replaced-domain.com/mvn/replaced/replaced/com/example/path/common-core/0.0.1@aar/[email protected] <-- This is my private repo
Required by:
project :app
UPD 1: If I click «Choose sources» and specify my local sources jar, it just does nothing.
How to fix it?
build.gradle.kts
->dependencies
->api("com.example.path:common-core:0.0.1")
– Sump--debug
key? What exact URL it's trying (and failing) to access? – Latvian--debug
I see the following:[INFO] [org.gradle.internal.resource.transport.http.HttpClientHelper] Resource missing. [HTTP GET: repo.replaced-domain.com/mvn/replaced/replaced/com/example/path/common-core/0.0.1@aar/[email protected]]
. If I remove@aar
it becomes a valid URL for the POM. – SumpDownloadSources
task come from? – LatvianmetadataSources { artifact() }
to your maven repo declaration (it should disable search for pom files, orienting on artifacts layout)? Or it will try to fetch[email protected]
in this case? – LatvianmetadataSources { artifact() }
, it fails to resolve the dependency.DownloadSources
is the (probably synthetic) name of the task when that is launched when I click «Download Sources» in Idea. It doesn't work for any module from command line, like./gradlew :core:DownloadSources
– Sumpextra
is unknown, therefore this is missing debug information; tryproject.ext
- or try substituting these variable with strings for a test. In every case, the repository isn't properly set up. – Valverde