[jira] [Updated] (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:all-tabpanel ] Robert Scholte updated MCOMPILER-343: - Description: 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 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: 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.compiler.TestCompilerMojo.preparePaths(TestCompilerMojo.java:285) at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:762) at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:176) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) ... 21 more Caused by: java.io.IOException: Invalid path to module descriptor: D:\projects\DCM\dcm-nct-tcp-connector-c.v-SNAPSHOT\target\classes at org.codehaus.plexus.languages.java.jpms.LocationManager.resolvePaths(LocationManager.java:87) at org.apache.maven.plugin.compiler.TestCompilerMojo.preparePaths(TestCompilerMojo.java:281) ... 24 more {noformat} was: When running a maven build on a maven project that has a
[jira] [Updated] (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:all-tabpanel ] Guy Mahieu updated MCOMPILER-343: - Description: 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: 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.compiler.TestCompilerMojo.preparePaths(TestCompilerMojo.java:285)}} \{{ at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:762)}} \{{ at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:176)}} \{{ at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)}} \{{ ... 21 more}} {{Caused by: java.io.IOException: Invalid path to module descriptor: D:\projects\DCM\dcm-nct-tcp-connector-c.v-SNAPSHOT\target\classes}} \{{ at
[jira] [Updated] (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:all-tabpanel ] Guy Mahieu updated MCOMPILER-343: - Description: 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-versioned jars: {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: 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.compiler.TestCompilerMojo.preparePaths(TestCompilerMojo.java:285)}} \{{ at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:762)}} \{{ at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:176)}} \{{ at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)}} \{{ ... 21 more}} {{Caused by: java.io.IOException: Invalid path to module descriptor: D:\projects\DCM\dcm-nct-tcp-connector-c.v-SNAPSHOT\target\classes}} \{{ at org.codehaus.plexus.languages.java.jpms.LocationManager.resolvePaths(LocationManager.java:87)}}