簡體   English   中英

使用“mvn exec:exec”運行示例應用程序不起作用

[英]Running the sample application using "mvn exec:exec" doesn't work

我正在關注入門版本 0.9。 我可以使用完整的“java -Duser.lan...”命令並雙擊 foo.jar 來運行示例應用程序,但是當我嘗試 mvn exec:exec 替代方法時,它不起作用。

這是控制台中的錯誤:

CI0011766:drombler-test-application claudiorosati$ mvn exec:exec
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building drombler-test-application 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- exec-maven-plugin:1.5.0:exec (default-cli) @ drombler-test-application ---
Error: Could not find or load main class Projects.drombler-test.drombler-test-application.target.deployment.standalone.conf.logging.properties
[ERROR] Command execution failed.
org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
        at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
        at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
        at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:764)
        at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:711)
        at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:289)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        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:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
        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:498)
        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)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.809 s
[INFO] Finished at: 2017-03-08T11:46:48+01:00
[INFO] Final Memory: 24M/981M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.5.0:exec (default-cli) on project drombler-test-application: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/MojoExecutionException

這里是 test-application 模塊的 pom 文件部分:

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <executions> 
                    <execution>
                        <id>default-cli</id>
                        <goals>
                            <goal>exec</goal>
                        </goals>
                        <configuration>
                            <commandlineArgs>${additionalExecArgs} -Duser.language=en -Duser.country=US -Djavafx.verbose=true -Dbinary.css=false -Djava.util.logging.config.file=${project.build.directory}/deployment/standalone/conf/logging.properties -jar ${project.build.directory}/deployment/standalone/bin/foo.jar --userdir ${project.build.directory}/userdir</commandlineArgs>
                            <executable>java</executable>
                            <classpathScope>runtime</classpathScope>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </pluginManagement>
    <plugins>
        <plugin>  
            <groupId>org.drombler.fx</groupId>
            <artifactId>drombler-fx-maven-plugin</artifactId>
            <extensions>true</extensions>
            <configuration>
                <brandingId>foo</brandingId>
                <title>MyApplication ${project.version}</title>
                <width>1500</width>
                <height>1000</height>
                <!--Uncomment the following line and specifcy an unused port to create a single instance application -->
                <!--<defaultSingleInstancePort>some unused port</defaultSingleInstancePort>-->
            </configuration>
        </plugin>
    </plugins>
</build>

[DEBUG] 執行命令行:[java, -Duser.language=en, -Duser.country=US, -Djavafx.verbose=true, -Dbinary.css=false, -Djava.util.logging.config.file=/用戶/claudiorosati/Projects/NetBeans、項目/dromler-test/dromler-test-application/target/deployment/standalone/conf/logging.properties、-jar、/Users/claudiorosati/Projects/NetBeans、Projects/dromler-test/ drombler-test-application/target/deployment/standalone/bin/foo.jar, --userdir, /Users/claudiorosati/Projects/NetBeans, Projects/drombler-test/drombler-test-application/target/userdir] 錯誤:可以未找到或加載主類 Projects.dromler-test.dromler-test-application.target.deployment.standalone.conf.logging.properties [ERROR] 命令執行失敗。 org.apache.commons.exec.ExecuteException:進程退出並出現錯誤:1(退出值:1)

看起來有空格的路徑有問題。

請嘗試以下操作:

<commandlineArgs>${additionalExecArgs} -Duser.language=en -Duser.country=US -Djavafx.verbose=true -Dbinary.css=false -Djava.util.logging.config.file="${project.build.directory}/deployment/standalone/conf/logging.properties" -jar "${project.build.directory}/deployment/standalone/bin/foo.jar" --userdir "${project.build.directory}/userdir"</commandlineArgs>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM