I want to create a new bundle my-bundle that I can use withing many other Symfony 3 apps that I have, such as my-app with the flowing dir structure.
projects
my-app
composer.json
my-bundle
composer.json
my-app/composer.json
"require": {
"my-bundle": "*"
...
"repositories": [
{
"type": "path",
"url": "../my-bundle",
"options": {
"symlink": false
}
},
...
my-bundle/composer.json
"require": {
"symfony/cache": "^3.*"
...
When I run the application it throws a ServiceNotFoundException:
The service "mybundle.some_service" has a dependency on a non-existent service "cache.app".
My 1st question is: why the service is not found although the dependency was installed by my-bundle inside vendor/my/bundle/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Resources/config/cache.xml
Second question: why composer install didn't install the required symfony/cache bundle inside of my-app?