How to use Stash as a Maven remote repository for a Gradle project?

吃可爱长大的小学妹 提交于 2019-12-13 21:35:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!