使用私人Composer VCS Git回购 [英] Using private Composer VCS Git repo

查看:266
本文介绍了使用私人Composer VCS Git回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用作曲家的回购。获取它作为类型包等工作良好,但我想用它作为VCS。

所以,我添加了一个composer.json到我的资源库看起来像这样:

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

在这个项目中,我喜欢使用这个库中的库,我添加了这个composer.json:

 repositories:[
{
type:vcs,
url:git@gitlab.my.domain.com: gkm / storage.git

],
require:{
gkm / storage:*
}
}

$现在,当我执行作曲家更新时,它会返回一个错误:

问题1
- 请求的软件包gkm / storage在任何版本中都找不到,软件包名称中可能会有拼写错误。



不幸的是,我没有找到关于此的非常详细的信息。将它与第三方库进行比较,它们是相同的,但是通过packagist.org发布而不是定制的repo服务器,它看起来是一样的。



希望有人在这里将会看到最新的错误。 解决方案

您是否标记了一个版本?如果不是,Composer无法将*解析为某个版本,并且您不允许该已安装软件包的开发稳定性。


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.

解决方案

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.

这篇关于使用私人Composer VCS Git回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆