I have project A, which requires package B. Package B does not contain the composer.json
file directly, but has this file named differently (it contains more than one). In the composer.json
file in project A, I have added package B to the repositories
section (VCS type). In the require
section, I have written the specific branch I want to install (also with the dev-
prefix). When I run composer update
, composer throws me the error
Root composer.json requires ...... but these do not match your constraint and are therefore not installable. Make sure you either fix the constraint or avoid updating this package to keep the one present in the lock file.
Also the composer show
command does not show me that branch.
Is the problem that package B does not contain composer.json
directly?
Is there any way to tell composer which composer file to use from package B?
Package B has 3 composer.json
files because it has a dependency on package C, which has 3 branches, production
, staging
and development
, where development
is the internal development/testing environment, staging
is the testing environment for our clients and production
is the production environment.
And likewise, package B has these three branches and therefore has 3 composer.json
files to use the correct version/branch from package C (which has only 1 composer.json
file, because it doesn't have that other dependency) for each environment. And likewise, application A has this and I need to be able to install package B in the appropriate version/branch.