Using private Composer VCS Git repo

耗尽温柔 提交于 2020-01-05 10:27:13

问题


I am trying to use my repo with composer. Fetching it as type package etc. worked well, but I would like to use it as a VCS.

So, I added a composer.json to my repository looking like this:

{
    "name": "gkm/storage",
    "authors": [
        {
            "name": "David Schunke",
            "email": "my@email.me"
        }
    ],
    "require": {
        "php": ">=5.3.0"
    },
    "autoload": {
        "psr-0": {
            "Gkm\\storage\\": ""
        }
    }
}

In the project, where I woult like to use the library from this repository, I added this composer.json:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "git@gitlab.my.domain.com:gkm/storage.git"
        }
    ],
    "require": {
        "gkm/storage": "*"
    }
}

Now, when I perform a composer update, it returns an error:

Problem 1 - The requested package gkm/storage could not be found in any version, there may be a typo in the package name.

Unfortunately, I do not find very detailed information about this. Comparing it to third party libraries which do the same, but are just published via packagist.org instead of a custom repo server, it looks the very same.

Hope someone here will see whats wrong.


回答1:


Did you tag a version? If not, Composer is unable to resolve "*" to a version, and you didn't allow development stability for that installed package.



来源:https://stackoverflow.com/questions/28065395/using-private-composer-vcs-git-repo

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