testcontainers / testcontainers-jooq-codegen-maven-plugin

jOOQ code generator using Testcontainers
Apache License 2.0
49 stars 10 forks source link

Duplication of ryuk containers #43

Open hlavavit opened 1 month ago

hlavavit commented 1 month ago

While using this plugin in eclipse, every maven refresh causes the ryuk container to start, but wont stop until eclipse itself shuts down. After a long day or doing multiple changes to project that require maven rebuild it can add up fast and end up with a lot if ryuk instances running at the same time. Sometimes even after eclipse restart id does not clean them all (probably because there is too many).

Sometimes it happens while saving but sure way to make it happen in eclipse is right click on project -> Maven -> Update Project... Prepared minimum example project with this plugin used here (replaced my old ugly solution. ) https://github.com/hlavavit/examples/blob/testcontainers-jooq-plugin/pom.xml -- repo has two branches this one with plugin master with old solution

I have this working without this plugin by combining the groovy+liquibase+jooq plugins together. But had a bad time getting it all to work together for the same reason. I suspect that in Eclipse IDE maven integration runs in the same jvm instance as eclipse itself by calling maven from java code. So Containers were not cleaning until eclipse was turned off. Managed to fix it by cleaning it manually in groovy (prepared minimum example here https://github.com/hlavavit/examples/blob/master/pom.xml) just check the groovy-maven-plugin it needs two executions, one to to prepare the container and second one in next phase to clear it and ryuk. Its kind of ugly code that uses private props etc... so I was really hoping this plugin will solve it for me.