问题
How can I reference a custom remote Maven repository which is hosted on Stash (aka. Bitbucket Server)? Here is what I tried in the root build.gradle
:
allprojects {
repositories {
jcenter()
maven {
// This Stash path does not work
url "https://stash.company.lan/projects/AP/repos/internal-repository"
}
maven {
// This GitHub path works fine
url "https://github.com/user/mvn-repo/tree/master"
}
}
}
I cannot figure out the correct path to the raw folder structure for Stash so Gradle understands. When I reference a library stored in the repository the following error is thrown:
Error:Cause: unable to find valid certification path to requested target
回答1:
I dont know why you want use Stash, because using SCM instead Nexus is not so good way...
But, if you want, check nebula plugin
for gradle, here is it. Maybe it will help you ;)
Just
回答2:
Jeroen Mols describes a setup in his article:
- Git as a secure private Maven repository (05.02.2016)
I have not tried it yet since I decided to install a local Nexus instance meanwhile. Please comment here if it worked for you.
来源:https://stackoverflow.com/questions/38747160/how-to-use-stash-as-a-maven-remote-repository-for-a-gradle-project