[jira] [Commented] (MCOMPILER-343) Tests fail to compile in modularized project due to wrong module descriptor path being passed to plexus-java
[ https://issues.apache.org/jira/browse/MCOMPILER-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16484523#comment-16484523 ] Robert Scholte commented on MCOMPILER-343: -- I think I know what's happening here. The plexus-java is still in its 0.9-phase and we've decided that the MainModuleDescriptor must point to the actual file, not anymore to the directory containing the module descriptor. Conclusion, you either have to path the compiler-plugin yourself or have to wait a little bit for the next release. And I cannot give you a date for it, just the hope it'll be in June. > Tests fail to compile in modularized project due to wrong module descriptor > path being passed to plexus-java > > > Key: MCOMPILER-343 > URL: https://issues.apache.org/jira/browse/MCOMPILER-343 > Project: Maven Compiler Plugin > Issue Type: Bug >Affects Versions: 3.7.0 >Reporter: Guy Mahieu >Priority: Major > > When running a maven build on a maven project that has a module-info file and > that has tests to compile, the build fails with the following message: > {noformat}Execution default-testCompile of goal > org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile failed: > java.io.IOException: Invalid path to module descriptor: > D:\projects\DCM\dcm-nct-tcp-connector-c.v-SNAPSHOT\target\classes > {noformat} > And I see that in the TestCompilerMojo class (line 273), the absolute output > directory is passed in as the module descriptor, while in the compile of the > production sources, the full path to the module-info.java file is passed in: > {code} > ResolvePathsRequest request = > ResolvePathsRequest.withStrings( testPath ) > .setMainModuleDescriptor( *mainOutputDirectory.getAbsolutePath()* ); > {code} > > For completeness I should maybe also add that I have changed my dependencies > for the compiler plugin to be able to use java 10 and depend on multi-release > jars (like log4j2 2.11): > {code:xml} > > > org.ow2.asm > asm > 6.1.1 > > > org.codehaus.plexus > plexus-java > 0.9.4 > > > {code} > > Full stacktrace: > {noformat} > org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile > (default-testCompile) on project dcm-nct-tcp-connector: Execution > default-testCompile of goal > org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile failed: > java.io.IOException: Invalid path to module descriptor: > D:\projects\DCM\dcm-nct-tcp-connector-c.v-SNAPSHOT\target\classes > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213) > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) > at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146) > at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) > at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) > at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) > at > org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309) > at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194) > at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107) > at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993) > at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345) > at org.apache.maven.cli.MavenCli.main(MavenCli.java:191) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:497) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) > at > org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) > at > org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) > at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) > Caused by: org.apache.maven.plugin.PluginExecutionException: Execution > default-testCompile of goal > org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile failed: > java.io.IOException: Invalid path to module descriptor: > D:\projects\DCM\dcm-nct-tcp-connector-c.v-SNAPSHOT\target\classes > at >
[jira] [Commented] (MCOMPILER-343) Tests fail to compile in modularized project due to wrong module descriptor path being passed to plexus-java
[ https://issues.apache.org/jira/browse/MCOMPILER-343?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16484315#comment-16484315 ] Robert Scholte commented on MCOMPILER-343: -- Can you try {{plexus-java 0.9.8}} (it currently the most recent version) > Tests fail to compile in modularized project due to wrong module descriptor > path being passed to plexus-java > > > Key: MCOMPILER-343 > URL: https://issues.apache.org/jira/browse/MCOMPILER-343 > Project: Maven Compiler Plugin > Issue Type: Bug >Affects Versions: 3.7.0 >Reporter: Guy Mahieu >Priority: Major > > When running a maven build on a maven project that has a module-info file and > that has tests to compile, the build fails with the following message: > {quote}{{Execution default-testCompile of goal > org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile failed: > java.io.IOException: Invalid path to modu}} > {{le descriptor: > D:\projects\DCM\dcm-nct-tcp-connector-c.v-SNAPSHOT\target\classes}} > {quote} > And I see that in the TestCompilerMojo class (line 273), the absolute output > directory is passed in as the module descriptor, while in the compile of the > production sources, the full path to the module-info.java file is passed in: > ResolvePathsRequest request = > ResolvePathsRequest.withStrings( testPath ) > .setMainModuleDescriptor( *mainOutputDirectory.getAbsolutePath()* ); > > For completeness I should maybe also add that I have changed my dependencies > for the compiler plugin to be able to use java 10 and depend on multi-release > jars (like log4j2 2.11): > {quote}{{}} > \{{ }} > \{{ org.ow2.asm}} > \{{ asm}} > \{{ 6.1.1 }} > \{{ }} > \{{ }} > \{{ org.codehaus.plexus}} > \{{ plexus-java}} > \{{ 0.9.4 }} > \{{ }} > {{}} > {quote} > > Full stacktrace: > {{org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute > goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile > (default-testCompile) on project dcm-nct-tcp-connector: Execution > default-testCompile of goal > org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile failed: > java.io.IOException: Invalid path to modu}} > {{le descriptor: > D:\projects\DCM\dcm-nct-tcp-connector-c.v-SNAPSHOT\target\classes}} > \{{ at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)}} > \{{ at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)}} > \{{ at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)}} > \{{ at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)}} > \{{ at > org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)}} > \{{ at > org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)}} > \{{ at > org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)}} > \{{ at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)}} > \{{ at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)}} > \{{ at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)}} > \{{ at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)}} > \{{ at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)}} > \{{ at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)}} > \{{ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)}} > \{{ at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)}} > \{{ at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)}} > \{{ at java.lang.reflect.Method.invoke(Method.java:497)}} > \{{ at > org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)}} > \{{ at > org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)}} > \{{ at > org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)}} > \{{ at > org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)}} > {{Caused by: org.apache.maven.plugin.PluginExecutionException: Execution > default-testCompile of goal > org.apache.maven.plugins:maven-compiler-plugin:3.7.0:testCompile failed: > java.io.IOException: Invalid path to module descriptor: > D:\projects\DCM\dcm-nct-tcp-connector-c.v-SNAPSHOT\target\classes}} > \{{ at > org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)}} > \{{ at > org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)}} > \{{ ... 20 more}} > {{Caused by: java.lang.RuntimeException: