Hi Martin,

Thanks for your response. please see inline:


> Which approach did you choose for the tests? One approach is to
> duplicate the module-info.java file in the test directory [1], but this
> is not the only way.
>

Yes, that is the approach I took. Basically, the test code is put in its
own module and namespace (package name) with dependencies on the main
module and junit etc.

>
>
> > I see during the test-compile phase the plugin is putting all the
> > dependencies on the module-path whereas during the main compilation it
> > only puts those dependencies on the module-path that are declared in
> > module-info.java; the rest are on the classpath (which is the correct
> > behavior).
> >
> Indeed this is the correct behaviour in a lot of cases, but not always.
> Sometime we really want non-modular dependencies to nevertheless be on
> the module-path. So we need a way to give control to developers about
> which dependencies to put on the module-path versus class-path. This is
> the topic of JIRA issue MNG-7855 [2]. We had a little bit of discussion
> about that during the "Community Over Code" meeting (formerly
> "ApacheCon") that just finished two days ago. A proposal was to create a
> wiki page for designing a short-term fix.
>

IIUC, this is a separate issue. At minimum we need to make the behavior of
compile vs. testCompile consistent. Currently it is not. To repeat: I see
during the test-compile phase the plugin is putting all the dependencies on
the module-path whereas during the main compilation it only puts those
dependencies on the module-path that are declared in module-info.java; the
rest are on the classpath (which is the correct behavior).

>
>
> > Is this a known issue? Is there any fix? Without it, how can we use JPMS?
> >
> I think that MNG-7855 is a blocker issue. Without a fix, doing gradual
> migration to JPMS with Maven (i.e. being in a situation where we have a
> mix of JPMS and non-JPMS modules) is difficult except in some special
> cases.
>
>      Martin
>
> [1]
> https://maven.apache.org/surefire/maven-surefire-plugin/examples/jpms.html
> [2]https://issues.apache.org/jira/browse/MNG-7855
>

Reply via email to