How to avoid dependency dependencies in Composer?

Asked

Viewed 30 times

2

I own a project A which has a dependency on project B which in turn has a dependency on project C.

So the dependency chart would look like this:

A -> B -> C

(ps: all projects are developed in-house).

However, in Project A Composer.json, I am required to require both dependencies:

{
    "require": {
        "B": "dev-master",
        "C": "dev-master"
    }
}

... whereas in Project B, I require only dependency C:

{
    "require": {
        "C": "dev-master"
    }
}

How do I make it in Project A I require only dependency B?

Thank you!

1 answer

0


I solved it. I can only do what I want by referencing a project tag, not by referencing dev-master:

{
    "require": {
        "C": "1.*"
    }
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.