How to use custom gitlab repository in symfony

I develop custom symfony bundle and store it in gitlab repository. I want to use this bundle in my symfony project, but faced with an error when I try to install this bundle by composer.

Because it's custom private repo I added custom repository URL in my project composer.json

"repositories": [
        "type" : "vcs",
        "url"  : ""

but when I try to execute composer require custom-team/customn-symfony-bundle:dev-master I get the following error:

Could not find a matching version of package custom-team/custom-symfony-bundle. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (dev).

What is the error? What do I need to change in my symfony bundle repo?

1 answer

  • answered 2021-05-15 19:44 riki-tik

    Sorry, I found a solution by documentation:

    Created package:

    curl --data branch=MYBRANCH "<PACKAGE_ID>/packages/composer"

    And added in composer.json

    composer config<ID> '{"type": "composer", "url": "<ID>/-/packages/composer/packages.json"}'