Thanks Christian, Thanks to either a good night’s sleep or reading the messages in this thread I realized deleting the module-info.class file generated to create the test jar might fix the problem. It did. After deleting it the compiler only used the class path to run the annotation processor and it finally worked.
I am definitely going to have to blog about this ordeal when I finally get it working. I am really not sure modularization is really worth all the effort. While Bach looks interesting I don’t want to replace Maven. To me it makes more sense to have a single Maven plugin that compiles and packages the JMPS module in one step. Then the process would look like: 1. Build and package the main module source (i.e. compile, create source and binary jars). 2. Build and package the test module source - then delete the generated module-info.class. 3. Compile the unit test source. 4. Run the unit tests. 5. Install/Deploy the created jars. Doing it by invoking all the usual plugins one at time is definitely creating a convoluted build., so having a plugin to deal with this would definitely help. Ralph > On Apr 25, 2021, at 8:04 AM, Christian Stein <sormu...@gmail.com> wrote: > > On Sun, Apr 25, 2021 at 4:53 PM Apache <ralph.go...@dslextreme.com> wrote: > >> Thanks Christian. I’ve read that blog several times. It helped me >> immensely in getting anything to work. > > > You're welcome and glad to hear that it helped you! > > >> However, it doesn’t exactly cover my situation where some of the test >> classes need to be packaged into their own module for downstream maven >> modules. > > > Yeah. That's one reason I decided for Bach [0] that "javac + jar" is an > atomic action. And that goes for sources of main and test scope. That > simplifies a lot of cases, not only when testing in the modular world > (adding main/test MRJARs to the mix is easy here, for example). > > IIRC, using the Maven-Invoker-Plugin (or Maven-Exec-Plugin) with > hand-crafted mvn (java) calls was always a way to get things working again. > At least, as a last resort. > > [0]: https://github.com/sormuras/bach --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org