Reputation: 63
I created a library on my gitolite server with a composer.json
{
"name": "package/package-name",
"type": "library",
"description": "Wine Extension for Wordpress",
"keywords": ["Page Management"],
"license": "MIT",
"authors": [
{
"name": "Author",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.3.2"
},
"autoload": {
"psr-4": { "Prefix\\PackageName\\": "src/" }
},
"extra": {
"branch-alias": {
"dev-master": "master"
}
}
}
And then I want to include them in other project, so I add on my repositories like this.
[
"repositories": [
{
"type": "vcs",
"url": "[email protected]:Library/PackageName"
}
],
"require": {
"package/package-name": "master",
},
]
I have exact the same composer.json file on another library on github. However on Github it works, but not on gitolite. I wonder if this has something to do with the Gitolite, if the Gitolite doesn't support it. Can someone explain to me? on github, the package also not available on Packagist. So I think this should not be the problem.
The error I got from Gitolite:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package package/package-name could not be found in any version, there may be a typo in the package name.
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.
both "dev-master" or "master" are not working.
but if I require the package like this, it works.
{
"type": "package",
"package": {
"name": "package/package-name",
"version": "dev",
"type": "package",
"source": {
"url": "[email protected]:Library/PackageName",
"type": "git",
"reference": "master"
},
"require": {
"php": ">=5.3.2",
"leafo/scssphp": "^0.3.2"
},
"autoload": {
"psr-0": { "Prefix\\PackageName\\": "src/" }
}
}
}
Has someone idea how to solve this? I would like to use vcs. It would be easier to manage. thank you!
I don't think that stable version the problem like most of them. Using private Composer VCS Git repo Composer VCS repository not loading dependancies Optimize multiple Composer VCS repository paths
Upvotes: 1
Views: 192
Reputation: 70913
If you want to use a branch, you have to prefix it's name with dev-
, so it's dev-master
, not master
.
Also note that you have to explicitly mention all the repositories where your software resides, otherwise indirect inclusions will not work.
Composer only knows about packages from packagist.org and from repositories in the root composer.json
file. Including a package that includes another package from your Gitolite would not work.
Upvotes: 0