For the installation of a module during development in Oxid 6.2 I followed the best practices described here: https://docs.oxid-esales.com/developer/en/6.2/development/modules_components_themes/module/tutorials/module_setup.html
As the module is in development, using a repository is not a viable solution for every single change.
Thus, I manually copied the module to the Oxid modules’ folder: <shop_directory>/source/modules/<my-vendor>/<my-module>
Then from the Console, being inside the <shop_directory>
, I ran the followings:
# <my-module-path> = /source/modules/<my-vendor>/<my-module>
# <my-package-name> = the name value from /source/modules/<my-vendor>/<my-module>/composer.json
vendor/bin/oe-console oe:module:install-configuration <my-module-path>
# Output: Module configuration has been installed.
composer config repositories.<my-package-name> path <my-module-path>
# <shop_directory>/composer.json gets updated as expected with the new repository
composer require <my-package-name>:*
# Output:
/*
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package <my-package-name> could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, reverting ./composer.json to its original content.
*/
I went through the list of potential causes, however none of them seems to be the case.
As a workaround I had to manually add the Composer namespaces for autoloading inside the <shop_directory>/composer.json
file:
"autoload": {
"psr-4": {
"MyVendor\\CustomModule1\\": "./source/modules/myvendor/custommodule1",
"MyVendor\\CustomModule2\\": "./source/modules/myvendor/custommodule2"
}
}
Isn’t it possible to avoid this workaround for a Module installation during development without having an actual repository?