Ralph, Once you move test code to their own Maven module they become a top level module, that is, they have a life of their own as any other top level module.
In contrast -tests jars are not top level, but a “variant” (that’s why they have a classifier) of their owning top level module. Test jars must be published to a repository in order to be consumed, just like any other jar, variant or not. The only difference (at least that I can see) is that test jars may be downloaded using the coordinates of the owning module (plus test classifier) and their release cycle is tightly coupled with their owning module. But if you take away the owning relationship you’re left with, well, just another regular Maven module. Personally I prefer the use of explicit dependencies and modules, barely make use of test jar support, but I do recognize others feel differently about them and prefer the workflow enables by such jars and conventions Cheers Andres Sent from my primitive tricorder > On 22 Jun 2021, at 23:20, Ralph Goers <ralph.go...@dslextreme.com> wrote: > > > >> On Jun 22, 2021, at 11:16 AM, Robert Scholte <rfscho...@apache.org> wrote: >> >> If I understand correctly you want both log4j-core main classes and test >> classes be distributed as modularized jars. >> To me with JPMS you should move the modularized test-classes to a separate >> Maven module as a first citizen artifact. >> That should make it a lot easier. > > Robert, > > I have a question on the above. I am generating log4j-core-3.0.0-SNAPSHOT.jar > and log4j-core-3.0.0-SNAPSHOT-tests.jar. > If the source is left in log4j-core and I create a log4j-core-tests module > what would I specify in the pom to get it to create the > test jar as log4j-core-3.0.0-SNAPSHOT-tests.jar? I would not want it to be > log4j-core-tests-3.0.0-SNAPSHOT.jar as that > would not be understood to be a test jar. > > Ralph > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org > For additional commands, e-mail: dev-h...@maven.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org