1

I'm following the Getting Started version 0.9. I can run the sample application with the full "java -Duser.lan..." command and the double-click on the foo.jar, but when I try the mvn exec:exec alternative it doesn't work.

Here the error in console:

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

Here the section of the pom file of the test-application module:

<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>
  • Please provide the following information: OS version, Java version (java -version) , Maven version (mvn -version). Are the environment variables set (JAVA_HOME, M2_HOME)? – Puce Mar 08 '17 at 15:36
  • And please also run the Maven command with the -X -e flags to get more log output. – Puce Mar 08 '17 at 15:37
  • Sure:
    - OS: MacOS X 10.12.3
    - Java: 1.8.0_121
    - Maven: 3.3.9
    - Env Vars: JAVA_HOME, M2_HOME and M2 are set.
    – Claudio Rosati Mar 08 '17 at 15:48
  • Sure: - OS: MacOS X 10.12.3 - Java: 1.8.0_121 - Maven: 3.3.9 - Env Vars: JAVA_HOME, M2_HOME and M2 are set. The execution log with -X produced a too long text to be included. Is there a possibility to attach a file? – Claudio Rosati Mar 08 '17 at 15:59
  • This looks strange: "Could not find or load main class Projects.drombler-test.drombler-test-application.target.deployment.standalone.conf.logging.properties". Can you post the exec configuration? – Puce Mar 08 '17 at 16:03
  • I've just double-checked on a Mac (OS X 10.10.5) and it works as expected. Please provide the configuration of the exec Plugin and the Dromber FX Plugin (edit your question). – Puce Mar 08 '17 at 23:17
  • I apologize for my ignorance, where I can find "the configuration of the exec Plugin and the Dromber FX Plugin"? Is it in the section of the pom file of test-application module? (This is what I've added to the question, but I'm not sure it is what you want) – Claudio Rosati Mar 09 '17 at 08:08
  • This looks OK. Can you double-check the Main-Class entry of the Manifest file of foo.jar? – Puce Mar 10 '17 at 00:51
  • Main-Class: org.drombler.fx.startup.main.DromblerFXApplication – Claudio Rosati Mar 13 '17 at 09:54
  • [Here](https://drive.google.com/open?id=0B17CjCA09a_wTE4taHhveko2LTg) what printed in console executing `mvn -X exec. – Claudio Rosati Mar 13 '17 at 10:11

1 Answers1

1

[DEBUG] Executing command line: [java, -Duser.language=en, -Duser.country=US, -Djavafx.verbose=true, -Dbinary.css=false, -Djava.util.logging.config.file=/Users/claudiorosati/Projects/NetBeans, Projects/drombler-test/drombler-test-application/target/deployment/standalone/conf/logging.properties, -jar, /Users/claudiorosati/Projects/NetBeans, Projects/drombler-test/drombler-test-application/target/deployment/standalone/bin/foo.jar, --userdir, /Users/claudiorosati/Projects/NetBeans, Projects/drombler-test/drombler-test-application/target/userdir] 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)

It looks like there is an issue with paths which have spaces.

Please try the following:

<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>
Puce
  • 37,247
  • 13
  • 80
  • 152
  • This solved the problem. Thank you. Can you add it on the next release? – Claudio Rosati Mar 16 '17 at 08:20
  • The default configuration of the exec plugin changed a bit for the upcoming release. I'm not sure if this fix is still needed, but I will double-check that paths with spaces are supported: https://github.com/Drombler/drombler-fx/blob/develop/drombler-fx-maven-archetype-application/src/main/resources/archetype-resources/__rootArtifactId__-application/pom.xml#L34 – Puce Mar 16 '17 at 23:05
  • I filed an issue here: https://github.com/Drombler/drombler-fx/issues/180 – Puce Mar 16 '17 at 23:08
  • This issue has been fixed with v0.10, which is now available: http://puces-blog.blogspot.ch/2017/07/drombler-fx-version-010-released.html – Puce Aug 02 '17 at 09:19