[英]Add custom repository to composer
I have a gitlab repo: http://gitlabPerso/gitlab/PROJECTS/my-project.git 我有一个gitlab仓库: http://gitlabPerso/gitlab/PROJECTS/my-project.git
And I would like to add it to my current composer.json project. 我想将其添加到当前的composer.json项目中。
However it keeps saying me: 但是它一直在说我:
- The requested package project/MyProjectBundle could not be found in any version, there may be a typo in the package name. 找不到任何版本的请求的程序包项目/ MyProjectBundle,程序包名称中可能有错字。
This is what I tried: 这是我尝试的:
"repositories": [
{
"type": "package",
"package": {
"name": "project/MyProjectBundle",
"version": "dev-master",
"type": "package",
"source": {
"url": "http://gitlabPerso/gitlab/PROJECTS/my-project.git",
"type": "git",
"reference": "master"
}
}
}
],
"require": {
"project/MyProjectBundle": "*"
}
And the composer.json in this project looks like this: 这个项目中的composer.json看起来像这样:
{
"name" : "project/MyProjectBundle",
"description" : "some description",
"type" : "symfony-bundle",
"license": [
"MIT"
],
"require" : {
"php" : ">=5.3.0"
},
"minimum-stability": "dev",
"prefer-stable": true
}
I tried many other solutions I found on the net, I RTFM, but it still doesn't work. 我尝试了在网上找到的许多其他解决方案,即RTFM,但仍然无法正常工作。
Try with: 尝试:
"repositories": [
{
"type": "vcs",
"url": "http://gitlabPerso/gitlab/PROJECTS/my-project.git"
}
],
"require": {
"project/MyProjectBundle": "*"
}
I finally find this solution: 我终于找到了这个解决方案:
"repositories": [
{
"type": "git",
"url": "repogit.git"
}
],
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.