testcontainers-java
testcontainers-java copied to clipboard
Java 9: Please add Automatic-Module-Name attribute to META-INF/MANIFEST.MF
I'm using org.testcontainers:postgresql:1.11.3 dependency and it has no Automatic-Module-Name manifest attribute. It leads to module name conflict, as module name for the dependency is just postgres.
Please add this attribute to all published artifacts. For postgresql it can be smth like testcontainers.postgresql.
Thanks @remal, you are 100% right that this is a PITA and we should fix this soon!
This is really needed, there's a conflict between org.testcontainers:postgresql and org.postgresql:postgresql which inhibits the use of both modules!
Agreed. We'd happily accept a PR for this, if anyone wants to speed this up.
I think that #1524 is much more important. Modules names will be useless if projects can't be compiled.
@rnorth would the testcontainers.-prefix be acceptable? So modules will have names like:
testcontainers.jdbctestcontainers.mysqltestcontainers.postgresql
@rnorth I've issued the PR to speed this up, hope the module names are fine otherwise I'll change them!
BTW @remal it totally right, fixing module names still does permit to use them since different modules share the same package name org.testcontainers.containers which is not permitted by the spec:
Non-interference — The Java compiler, virtual machine, and run-time system must ensure that modules that contain packages of the same name do not interfere with each other. If two distinct modules contain packages of the same name then, from the perspective of each module, all of the types and members in that package are defined only by that module. Code in that package in one module must not be able to access package-private types or members in that package in the other module.
— http://openjdk.java.net/projects/jigsaw/spec/reqs/#non-interference
So also #1524 should be fixed as soon as possible.
I'm wondering about the status of this since it is a blocker for any modular project.
The two problems seem to be that testcontainers contains split packages and does not declare a stable module name. Declaring a module name is not very useful without resolving the split packages, of course. Renaming this issue might be useful since it is not merely adding an automatic module name.
By the way, there are a number of duplicates of this issue. Maybe you would like to consolidate them:
- https://github.com/testcontainers/testcontainers-java/issues/521
- https://github.com/testcontainers/testcontainers-java/issues/1524
- https://github.com/testcontainers/testcontainers-java/issues/1917
Agreed. We'd happily accept a PR for this, if anyone wants to speed this up.
As I understand it, fixing the split packages will require API changes. Is the 2.0 version already in development?
Is there any news about this issue? As it is currently not possible to use testcontainers in a modular project, which is a real shame. Has anyone worked on this? I'd be happy to help
The outlined issues are still valid, mostly the split package problem. Do you have any experience on mitigating this, without breaking changes?