Re: module resource loading - opens {package} when {package} only holds resources

2021-09-21 Thread Alan Bateman
On 20/09/2021 23:15, Rob Bygrave wrote: /:/ In case it's interesting, one thing that I hit when migrating to module-info was that a number of the modules are only used in maven test scope - as such they don't get a /requires/ clause in src/main/java/module-info. Currently when running tests

Re: module resource loading - opens {package} when {package} only holds resources

2021-09-20 Thread Rob Bygrave
*> is that you expect code outside of your module to locate these resources* That's right, the external module reading the resources is not application specific but a library (its job is to "run database migrations" - open source, published to maven central etc). The background is that I have an

Re: module resource loading - opens {package} when {package} only holds resources

2021-09-20 Thread Alan Bateman
On 20/09/2021 11:13, Rob Bygrave wrote: Well ok, silly me really because I think it is now clear that the "proper answer" is that the module really needs to open the subdirectories. opens dbmigration.postgres; opens dbmigration.mysql; So thanks and apologies Alan. It's all making sense to me

Re: module resource loading - opens {package} when {package} only holds resources

2021-09-20 Thread Rob Bygrave
Well ok, silly me really because I think it is now clear that the "proper answer" is that the module really needs to open the subdirectories. opens dbmigration.postgres; opens dbmigration.mysql; So thanks and apologies Alan. It's all making sense to me now, unfortunately I got muddled by that

Re: module resource loading - opens {package} when {package} only holds resources

2021-09-20 Thread Rob Bygrave
*> "dbmigration" resources have not been copied into target/classes?* target/classes/dbmigration exists *BUT* ... now I noticed that dbmigration only contained other sub-directories (which then contain the resources). So putting an empty junk.txt file into dbmigration fixes the problem. So if

Re: module resource loading - opens {package} when {package} only holds resources

2021-09-20 Thread Alan Bateman
On 20/09/2021 09:55, Rob Bygrave wrote: Hi, I have a case where I believe I have a module where I would like to use: opens {package}; ... *where {package} only contains resources*, there are no .class files in {package}. Currently when {package} only contains resources, we get an

module resource loading - opens {package} when {package} only holds resources

2021-09-20 Thread Rob Bygrave
Hi, I have a case where I believe I have a module where I would like to use: opens {package}; ... *where {package} only contains resources*, there are no .class files in {package}. Currently when {package} only contains resources, we get an InvalidModuleDescriptorException error: Error occurred