edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
715 stars 107 forks source link

Required goal not found #130

Closed sandeshnaroju closed 6 years ago

sandeshnaroju commented 6 years ago

I am trying FXlauncher for auto-updating my application. I have followed the steps mentioned in fxdemo. I can do mvn package successfully. It is generating jar files for my project. But I wanted them to host in my server so I have run mvn exec:exec@deploy-app -e But is throwing below error. I am new to Maven. Help me

+ Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Required goal not found: exec:exec@deploy-app in org.codehaus.mojo:exec-maven-plugin:1.4.0 [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.BuildFailureException: Required goal not found: exec:exec@deploy-app in org.codehaus.mojo:exec-maven-plugin:1.4.0 at org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1867) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) 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.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [INFO] ------------------------------------------------------------------------ [INFO] Total time: < 1 second [INFO] Finished at: Mon Jul 30 18:11:09 IST 2018 [INFO] Final Memory: 6M/150M [INFO] ------------------------------------------------------------------------

Here is my pom.xml file `

    <groupId>in.xxxxx</groupId>
    <artifactId>wpos</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <dependencies>
    <dependency>
        <groupId>no.tornado</groupId>
        <artifactId>fxlauncher</artifactId>
        <version>1.0.20</version>
    </dependency>
    <dependency>
        <groupId>com.jfoenix</groupId>
        <artifactId>jfoenix</artifactId>
        <version>8.0.4</version>
    </dependency>
    <dependency>
        <groupId>org.xerial</groupId>
        <artifactId>sqlite-jdbc</artifactId>
        <version>3.7.2</version>
    </dependency>
    <dependency>
        <groupId>com.j256.ormlite</groupId>
        <artifactId>ormlite-core</artifactId>
        <version>5.1</version>
    </dependency>
    <dependency>
        <groupId>com.j256.ormlite</groupId>
        <artifactId>ormlite-jdbc</artifactId>
        <version>5.1</version>
    </dependency>
</dependencies>
<properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <app.filename>Wpos</app.filename>

    <!-- The JavaFX Application class name -->
    <app.mainClass>in.xxxxx.Login</app.mainClass>

    <!-- Optional override to specify where the cached files are stored. Default is current working directory -->
    <app.cacheDir>USERLIB/Wpos</app.cacheDir>

    <!-- Optional parameters to the application, will be embedded in the launcher and can be overriden on the command line -->
    <app.parameters>--myOption=myValue --myOtherOption=myOtherValue</app.parameters>

    <!-- The Application vendor used by javapackager -->
    <app.vendor>xxxxx xxxxx xxxxx xxxxx</app.vendor>

    <!-- The Application version used by javapackager -->
    <app.version>1.0</app.version>

    <!-- Base URL where you will host the application artifacts -->
    <app.url>http://xxxxx.com/</app.url>

    <!-- Optional scp target for application artifacts hosted at the above url -->
    <app.deploy.target>xxxxx.xxxxx.com:xxxxx</app.deploy.target>

    <!-- The app and launcher will be assembled in this folder -->
    <app.dir>${project.build.directory}/app</app.dir>

    <!-- Native installers will be built in this folder -->
    <app.installerdir>${project.build.directory}/installer</app.installerdir>

    <!-- Should the client downgrade if the server version is older than the local version? -->
    <app.acceptDowngrade>false</app.acceptDowngrade>

    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <!-- Application Name -->
</properties>

<build>

    <plugins>
        <!-- Compile project jar to appdir -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <outputDirectory>${app.dir}</outputDirectory>
            </configuration>
        </plugin>
        <!-- Copy dependencies to appdir -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.10</version>
            <configuration>
                <excludeScope>provided</excludeScope>
                <outputDirectory>${app.dir}</outputDirectory>
                <stripVersion>true</stripVersion>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>copy-dependencies</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.4.0</version>
            <!-- Generate app.xml manifest -->
            <executions>
                <execution>
                    <id>create-manifest</id>
                    <phase>package</phase>
                    <goals>
                        <goal>java</goal>
                    </goals>
                    <configuration>
                        <mainClass>fxlauncher.CreateManifest</mainClass>
                        <arguments>
                            <argument>${app.url}</argument>
                            <argument>${app.mainClass}</argument>
                            <argument>${app.dir}</argument>
                            <argument>--cache-dir=${app.cacheDir}</argument>
                            <argument>--accept-downgrade=${app.acceptDowngrade}</argument>
                            <argument>--include-extensions=jpg</argument>
                            <argument>${app.parameters}</argument>
                        </arguments>
                    </configuration>
                </execution>
                <!-- Embed app.xml inside fxlauncher.xml so we don't need to reference app.xml to start the app -->
                <execution>
                    <id>embed-manifest-in-launcher</id>
                    <phase>package</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>jar</executable>
                        <workingDirectory>${app.dir}</workingDirectory>
                        <arguments>
                            <argument>uf</argument>
                            <argument>fxlauncher.jar</argument>
                            <argument>app.xml</argument>
                        </arguments>
                    </configuration>
                </execution>
                <!-- Optional step to include custom UI, see https://github.com/edvin/fxlauncher-custom-ui -->
                <!--<execution>-->
                <!--<id>embed-custom-ui-in-launcher</id>-->
                <!--<phase>package</phase>-->
                <!--<goals>-->
                <!--<goal>exec</goal>-->
                <!--</goals>-->
                <!--<configuration>-->
                <!--<executable>jar</executable>-->
                <!--<workingDirectory>${app.dir}</workingDirectory>-->
                <!--<arguments>-->
                <!--<argument>uf</argument>-->
                <!--<argument>fxlauncher.jar</argument>-->
                <!--<argument>-C</argument>-->
                <!--<argument>${project.basedir}/../fxlauncher-custom-ui/target/classes</argument>-->
                <!--<argument>.</argument>-->
                <!--</arguments>-->
                <!--</configuration>-->
                <!--</execution>-->
                <!-- Create native installer. Feel free to add more arguments as needed.
                 https://docs.oracle.com/javase/8/docs/technotes/tools/windows/javapackager.html
                 -->
                <execution>
                    <id>installer</id>
                    <phase>install</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>javapackager</executable>

                        <arguments>
                            <argument>-deploy</argument>
                            <argument>-native</argument>
                            <argument>-outdir</argument>
                            <argument>${app.installerdir}</argument>
                            <argument>-outfile</argument>
                            <argument>${app.filename}</argument>
                            <argument>-srcdir</argument>
                            <argument>${app.dir}</argument>
                            <argument>-srcfiles</argument>
                            <argument>fxlauncher.jar</argument>
                            <argument>-appclass</argument>
                            <argument>fxlauncher.Launcher</argument>
                            <argument>-name</argument>
                            <argument>${project.name}</argument>
                            <argument>-title</argument>
                            <argument>${project.name}</argument>
                            <argument>-vendor</argument>
                            <argument>${app.vendor}</argument>
                            <argument>-BappVersion=${app.version}</argument>
                            <argument>-Bidentifier=${project.groupId}.${project.artifactId}</argument>
                        </arguments>
                    </configuration>
                </execution>
                <!-- Copy application artifacts to remote site using scp (optional) -->
                <execution>
                    <id>deploy-app</id>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                    <configuration>
                        <executable>scp</executable>
                        <arguments>
                            <argument>-r</argument>
                            <argument>target/app/.</argument>
                            <argument>${app.deploy.target}</argument>
                        </arguments>
                    </configuration>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>
</build>

`

sandeshnaroju commented 6 years ago

Someone look into the issue please. What could be the problem?

edvin commented 6 years ago

Please post the complete pom or even better, link to your project if it's publicly available.

sandeshnaroju commented 6 years ago

Sorry for the late reply. Since the project contains lot of files I cannot upload them public. Instead What I did was I have created a new helloworld javafx application. This helloworld project also showing the same error "Required Goal Not Found". Please look into the issue here https://github.com/sandeshnaroju/helloworld
and I have added outputs for mvn clean package and mvn exec:exec@deploy-app in two txt files in the directory of the project.

edvin commented 6 years ago

I just tested your project and it finds the goal no problem. I still got an error message because it can't connect to the host you have specified but I guess that's a firewall or DNS issue, I didn't look into it. Either you're writing the command wrong, or something is wonky with your maven installation I think.

Here is the command I ran:

mvn exec:exec@deploy-app

And this is the output, showing that it executes the goal just fine.

C:\Users\es\Downloads\helloworld>mvn exec:exec@deploy-app
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.6.0/exec-maven-plugin-1.6.0.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.6.0/exec-maven-plugin-1.6.0.pom (13 KB at 11.4 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/mojo-parent/40/mojo-parent-40.pom
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/mojo-parent/40/mojo-parent-40.pom (33 KB at 608.0 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.6.0/exec-maven-plugin-1.6.0.jar
Downloaded: https://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.6.0/exec-maven-plugin-1.6.0.jar (57 KB at 1085.0 KB/sec)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building helloworld 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/no/tornado/fxlauncher/1.0.20/fxlauncher-1.0.20.pom
Downloaded: https://repo.maven.apache.org/maven2/no/tornado/fxlauncher/1.0.20/fxlauncher-1.0.20.pom (6 KB at 19.9 KB/sec)
Downloading: https://repo.maven.apache.org/maven2/no/tornado/fxlauncher/1.0.20/fxlauncher-1.0.20.jar
Downloaded: https://repo.maven.apache.org/maven2/no/tornado/fxlauncher/1.0.20/fxlauncher-1.0.20.jar (38 KB at 654.0 KB/sec)
[INFO]
[INFO] --- exec-maven-plugin:1.6.0:exec (deploy-app) @ helloworld ---
ssh: connect to host helloworld.wpos.com port 22: Connection timed out
lost connection
[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:804)
        at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:751)
        at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:313)
        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: 23.914 s
[INFO] Finished at: 2018-07-31T11:25:01+02:00
[INFO] Final Memory: 10M/190M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.6.0:exec (deploy-app) on project helloworld: 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

C:\Users\es\Downloads\helloworld>
sandeshnaroju commented 6 years ago

This is my Maven Version Apache Maven 2.2.1 (rdebian-14) Java version: 1.8.0_131 Java home: /usr/lib/jvm/java-8-oracle/jre Default locale: en_IN, platform encoding: UTF-8 OS name: "linux" version: "4.4.0-92-generic" arch: "amd64" Family: "unix" Is it the version problem?

sandeshnaroju commented 6 years ago

Thank you for taking time to answer. The issue is because of the maven version. I had to update the version to 3.3.9. Solved Thank you friend.

edvin commented 6 years ago

Wow, I wasn’t aware. I guess the exec plugin requires a newer version. Thanks for getting back to me :)