Closed michael-schnell closed 4 years ago
Thank you for the report. Since version 0.8.0 of this plugin you can now provide "workDir" parameter to any of this plugin's goals. Value of this parameter will be used as the working directory for docker-compose process so this should cover your use-case. Default value is Maven's "${project.basedir}".
Feel free to reopen or create a new issue if you have further problems with this feature.
Yes, it works.
I used version 0.7.0 and with 0.8.0 it is fixed.
Tnx.
The plugin fails in a multi module project if Docker Compose imports are used in the main compose file:
It seems that the current directory is not set to the module that is currently being executed.
Project structure
The "docker-compose.yml" has a relative import to another Docker Compose YAML file:
When you execute the build in the directory "myproject/mymodule", the plugin works fine. Executing the build in the parent directory "myproject" fails with above error.
I guess this is because the current directory is "myproject". The
<file>${project.basedir}/docker-compose.yml</file>
configuration picks up the main "docker-compose.yml" file, but then Docker Compose cannot resolve the relative file "src/main/compose/mariadb.yml" because it is started in the parent directory.The solution would be, to set the current directory for executing Docker Compose to the current directory of the Maven project that is currently build (which could be a module). Then it should work.