Я пытаюсь начать использовать новую систему модулей Java, а также jlink, для которой я использую плагин ModiTect Maven. Я создаю module-info.java
файлы для каждой из моих зависимостей, которые еще не определяют их, чтобы jlink могла правильно выполнять свою работу.
Один из необходимых мне модулей - spring.core
из org.springframework:spring-core:5.0.7.RELEASE
. Я создал module-info.java
, выглядящий так:
module spring.core {
exports org.springframework;
}
при наличии этой конфигурации ModiTect:
<module>
<artifact>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
</artifact>
<moduleInfoSource>
module spring.core {
exports org.springframework;
}
</moduleInfoSource>
</module>
Но когда я запускаю jlink, с помощью этой команды:
C:\Program Files\Java\jdk-10.0.1\bin\jlink --add-modules tech.flexpoint.dashmanserver --module-path c:\Users\pupeno\.m2\repository\tech\flexpoint\dashmancommon\1.0.0-beta.11;C:\Users\pupeno\Documents\Dashman\code\dashmanserver\target\modules;C:\Program Files\Java\jdk-10.0.1\jmods;C:\Users\pupeno\Documents\Dashman\code\dashmanse
rver \ target \ classes --output C: \ Users \ pupeno \ Documents \ Dashman \ code \ dashmanserver \ target \ jlink-image --launcher dashmanserver = tech.flexpoint.dashmanserver / tech.flexpoint.dashmanserver.DashmanServerApplication - -ignore подписывания-информация
Я получаю эту ошибку:
[ERROR] Error: Error reading module: C:\Users\pupeno\Documents\Dashman\code\dashmanserver\target\modules\spring-core-5.0.7.RELEASE.jar
И это почти вся информация, которую я получаю. Что не так с модулем? Есть идеи?
Полная трассировка стека выглядит следующим образом, но я не думаю, что это полезно:
[INFO] --- moditect-maven-plugin:1.0.0-SNAPSHOT:create-runtime-image (create-runtime-image) @ dashmanserver ---
[DEBUG] Configuring mojo org.moditect:moditect-maven-plugin:1.0.0-SNAPSHOT:create-runtime-image from plugin realm ClassRealm[plugin>org.moditect:moditect-maven-plugin:1.0.0-SNAPSHOT, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@5ef04b5]
[DEBUG] Configuring mojo 'org.moditect:moditect-maven-plugin:1.0.0-SNAPSHOT:create-runtime-image' with basic configurator -->
[DEBUG] (f) ignoreSigningInformation = true
[DEBUG] (s) name = dashmanserver
[DEBUG] (s) module = tech.flexpoint.dashmanserver/tech.flexpoint.dashmanserver.DashmanServerApplication
[DEBUG] (f) launcher = org.moditect.mavenplugin.image.model.Launcher@46cb800b
[DEBUG] (f) mavenSession = org.apache.maven.execution.MavenSession@74d3b638
[DEBUG] (f) modulePath = [C:\Users\pupeno\Documents\Dashman\code\dashmanserver\target\classes, C:\Users\pupeno\Documents\Dashman\code\dashmanserver\target\modules, c:\Users\pupeno\.m2\repository\tech\flexpoint\dashmancommon\1.0.0-beta.11]
[DEBUG] (f) modules = [tech.flexpoint.dashmanserver]
[DEBUG] (f) outputDirectory = C:\Users\pupeno\Documents\Dashman\code\dashmanserver\target\jlink-image
[DEBUG] (f) stripDebug = false
[DEBUG] -- end configuration --
[DEBUG] Running jlink: C:\Program Files\Java\jdk-10.0.1\bin\jlink --add-modules tech.flexpoint.dashmanserver --module-path c:\Users\pupeno\.m2\repository\tech\flexpoint\dashmancommon\1.0.0-beta.11;C:\Users\pupeno\Documents\Dashman\code\dashmanserver\target\modules;C:\Program Files\Java\jdk-10.0.1\jmods;C:\Users\pupeno\Documents\Dashman\code\dashmanse
rver\target\classes --output C:\Users\pupeno\Documents\Dashman\code\dashmanserver\target\jlink-image --launcher dashmanserver=tech.flexpoint.dashmanserver/tech.flexpoint.dashmanserver.DashmanServerApplication --ignore-signing-information
[DEBUG] Error: Error reading module: C:\Users\pupeno\Documents\Dashman\code\dashmanserver\target\modules\spring-core-5.0.7.RELEASE.jar
[ERROR] Error: Error reading module: C:\Users\pupeno\Documents\Dashman\code\dashmanserver\target\modules\spring-core-5.0.7.RELEASE.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 16.310 s
[INFO] Finished at: 2018-07-05T20:15:12+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.moditect:moditect-maven-plugin:1.0.0-SNAPSHOT:create-runtime-image (create-runtime-image) on project dashmanserver: Execution create-runtime-image of goal org.moditect:moditect-maven-plugin:1.0.0-SNAPSHOT:create-runtime-image failed: Execution of jlink failed -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.moditect:moditect-maven-plugin:1.0.0-SNAPSHOT:create-runtime-image (create-runtime-image) on project dashmanserver: Execution create-runtime-image of goal org.moditect:moditect-maven-plugin:1.0.0-SNAPSHOT:create-runtime-image failed: Execution of jlink failed
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:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
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 create-runtime-image of goal org.moditect:moditect-maven-plugin:1.0.0-SNAPSHOT:create-runtime-image failed: Execution of jlink failed
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
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:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
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: java.lang.RuntimeException: Execution of jlink failed
at org.moditect.internal.command.ProcessExecutor.run (ProcessExecutor.java:68)
at org.moditect.commands.CreateRuntimeImage.runJlink (CreateRuntimeImage.java:114)
at org.moditect.commands.CreateRuntimeImage.run (CreateRuntimeImage.java:68)
at org.moditect.mavenplugin.image.CreateRuntimeImageMojo.execute (CreateRuntimeImageMojo.java:114)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
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:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:564)
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)
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException