私有存储库无法识别标签版本

时间:2018-11-20 12:28:39

标签: composer-php

主项目中的composer.json

"require": {"namth/my-core": "1.7.1"},
"repositories": {
  "namth-my-core": {
    "type": "git",
    "url": "my-core ssh"
}  
},

my-core具有1个标记版本:1.7.1

可以正确地转到my-core composer.json中的my-core私人仓库

"require": {"namth/my-something": "^1.7.0"},
"repositories": { 
  "namth-my-mysomething": {
    "type": "git",
    "url": "my-something ssh"
}

我的东西有1个标签版本:1.7.1

问题是当我运行“ composer update”时,它返回如下错误:

namth/my-core 1.7.1 requires namth/my-something ^1.7.0 -> no matching package found.

我的私有存储库存储在Atlatssian Stash中。 我想念什么吗?谢谢

1 个答案:

答案 0 :(得分:0)

repositories配置仅适用于根软件包-只有您的主项目才能添加自定义存储库。在依赖项中配置的存储库将被忽略。

  

存储库仅可用于根软件包,并且不会加载依赖项中定义的存储库。如果您想了解原因,请阅读FAQ entry

     

https://getcomposer.org/doc/05-repositories.md#repository

您需要将两个存储库都添加到项目的composer.json中,以使其正常工作:

"repositories": {
    "namth-my-core": {
        "type": "git",
        "url": "my-core ssh"
    },
    "namth-my-mysomething": {
        "type": "git",
        "url": "my-something ssh"
    }
},
相关问题