Hi Martin,

I am not aware of such problem. Did you create a Jira[1] issue for it?
There should be no reason to have a workaround, all the information is there so Maven is capable to divide jars properly over both paths. If you can add a project so I can reproduce the issue, I can have a look at it.


[1] https://issues.apache.org/jira/projects/MCOMPILER

On Wed, 11 Apr 2018 14:24:36 +0200, Martin Desruisseaux <martin.desruisse...@geomatys.com> wrote:

I also have the case where maven-compiler-plugin puts a dependency in
classpath while it should be in modulepath. Strangely, the plugin does
the correct thing when executed with "mvn _clean_ install" but not when
executing "mvn install" without clean. This issue happen only when the
useIncrementalCompilation option is set to false. In addition the
javadoc plugin also seems to sometime put dependencies in unexpected
classpath/modulepath option. A Maven option for specifying whether a
dependency should be in the classpath or modulepath would be convenient
as a workaround…


Le 11/04/2018 à 13:14, Roman Grigoriadi a écrit :

Thanks Robert,

I tried to add requires for name which is resolved by JPMS for my
non-modularised jar, and it *somehow* made compiler-plugin to put this jar
on module-path.

However if I don't want to reference this jar in my module descriptor, so I
let decision up to user if to put this dependency on CP or MP for app
runtime, would it make sense to add configuration parameter for
compiler-plugin which will force CP/MP for some of the dependencies during

The best solution I have found so far is to copy such dependencies
somewhere before compilation and pass --module-path, --add-modules and
--add-reads to javac.

To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to