我想根据其他本地项目设置一个主项目。这实际上很好。但是,当依赖项本身具有依赖关系时,composer update
存在错误。
设置:
我有三个包。
/home/programming/git
vendor.main
vendor.depA
vendor.depB
vendor/main
取决于vendor.depA
,vendor.depB
依赖于vendor/main
。
什么有用
vendor.depA
composer.json定义了对{
"name": "vendor/main",
"description": "main",
"repositories": [
{ "type": "vcs", "url": "/home/user/programming/git/vendor.depA/" },
{ "type": "vcs", "url": "/home/user/programming/git/vendor.depB/" }
],
"require": {
"vendor/depA": "dev-master"
}
}
的依赖关系:
vendor.depA
{
"description": ". . .",
"name": "vendor/depA"
}
没有其他依赖:
composer update
vendor/depA
按预期工作,并安装vendor.depA
。
什么不起作用
如果vendor/depB
定义了对composer update
{
"description": ". . .",
"name": "vendor/depA",
"require": {
"vendor/depB": "dev-master"
}
}
的依赖关系失败:
vendor.depA
将存储库添加到composer update
的composer.json无济于事。
vendor.main
的composer.json(因此,没有拼写错误或vendor/depB
的其他问题等), ~/composer.phar update Loading composer repositories with package
information Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of
packages.
Problem 1
- vendor/depA dev-master requires vendor/depB dev-master -> no matching package found.
- vendor/depA dev-master requires vendor/depB dev-master -> no matching package found.
- Installation request for vendor/depA dev-master -> satisfiable by vendor/depA[dev-master].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting see
<https://getcomposer.org/doc/04-schema.md#minimum-stability> for more
details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for
further common problems.
会一直运行。 ,但这并没有真正帮助,因为depA应该具有依赖性。
我在这里做错了什么?
编辑:错误消息
CompanyName City Address Contact
------------------------------------------------------------------------
Starbucks Seattle Null Pedram
Starbucks Seattle 44 East Ave Daniel
Starbucks Seattle 2701 Freedom way April
Starbucks Seattle 3500 E Destination Drive Steve
Starbucks Luxembourg N2915 Countrt Road AB Hans
Starbucks Orleans 2800 Rice St. Emily
Starbucks St. Paul 6500 Henri-Bourassa BE Casey
Starbucks St. Paul 6500 Henri-Bourassa BE Kathy
答案 0 :(得分:1)
我认为这不适合&#34; dev-master&#34;。在你没有意义的情况下,&#34; dev-master&#34;始终是您的主分支的最新版本。因此,您应该标记提交并使用标记并根据标记号设置您的需求。
如果您真的想在作曲家文件中定义包,可以使用以下示例来定义包。
"repositories": [
{
"type": "package",
"package": {
"name": "vendor/yourpackage",
"version": "v1.0.0",
"source": {
"url": "git@your.gitserver.com:vendor/project.git",
"type": "git",
"reference": "dd6ed3c8"
}
}
}
]
然后你创建了一个包含指定版本号&#34; 1.0.0&#34;并将该包设置为git提交。