1
votes

I'm including a private git repository via composer, and it's loading as expected from bitbucket, however I have codeception defined as a public dependency in my private package.

My private package is loaded, but none of it's dependencies are added. I have read that composer does not support recursive loading of dependancies when using repositories: https://getcomposer.org/doc/faqs/why-can%27t-composer-load-repositories-recursively.md

However my understanding of this is that my private repository can't define another private repository, but should still be able to make use of public repositories defined on packagist.org

Private repositories composer.json:

{
    "name": "private/dependancy",
    "description": "Private git dependency",
    "type" : "library",
    "require-dev": {
        "codeception/codeception": "*"
    }
}

Project's composer.json (Trimmed down to relevant sections)

{
    "name": "primary/project",
    "description": "Main project including a vcs dependancy",
    "require": {
        "private/dependancy" : "0.0.*"
    },
    "repositories":[
        {
            "type"   : "vcs",
            "url"    : "some repo",
            "options": {
                "ssh2": "some crednetials"
            }
        }
    ]
}

Any guidance on this would be greatly appreciated.

1
After quite a bit of digging around, it would appear that only dependencies declared as "required" oppose to "require-dev" in my private packagae will actually be loaded when using composer installBeevee
Have filed an issue on the github repository: github.com/composer/composer/issues/3924Beevee

1 Answers

2
votes

Composer will not install dev-dependencies of the packages you require yourself.

Your primary/project requires private/dependency, which does not require anything else. Anything listed as require-dev is not installed, because that is considered to be used when developing private/dependency, not when using it.

Another thing that only get's evaluated when running Composer on the primary composer.json and not explicitly excluding dev dependencies is "autoload-dev".

composer install --no-dev

will not install ANY dev dependencies and not create autoloading for dev.

composer install

will install dev dependencies of the primary project, and create autoloading for dev - it will never install dev dependencies of any of the packages added via require or require-dev, and not add their autoload-dev.