edvin / fxlauncher

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

Cannot run program "scp" #110

Open iBouce opened 6 years ago

iBouce commented 6 years ago

when Executing --> mvn exec:exec@deploy-app

""" Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (deploy-app) on project Maven-Example: Command execution failed.: Cannot run program "scp" (in directory "C:\Users\iBouce\IdeaProjects\Maven_Demo"): CreateProcess error=2, The specified file can not be found -> [Help 1] """

Output : [INFO] Scanning for projects... [WARNING] [WARNING] Some problems were encountered while building the effective model for jetbrains:Maven-Example:jar:1.0-SNAPSHOT [WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-compiler-plugin @ line 234, column 21 [WARNING] [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] [WARNING] For this reason, future Maven versions might no longer support building such malformed projects. [WARNING] [INFO] [INFO] ----------------------< jetbrains:Maven-Example >----------------------- [INFO] Building Maven-Example 1.0-SNAPSHOT [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- exec-maven-plugin:1.4.0:exec (deploy-app) @ Maven-Example --- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.169 s [INFO] Finished at: 2018-04-20T14:59:11+02:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:exec (deploy-app) on project Maven-Example: Command execution failed.: Cannot run program "scp" (in directory "C:\Users\iBouce\IdeaProjects\Maven_Demo"): CreateProcess error=2, The specified file can not be found -> [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

POM File : <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>jetbrains</groupId>
<artifactId>Maven-Example</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>
    <dependency>
        <groupId>no.tornado</groupId>
        <artifactId>fxlauncher</artifactId>
        <version>1.0.20-SNAPSHOT</version>
    </dependency>
    <!-- JAXB-API  -->
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>com.sun.xml.bind</groupId>
        <artifactId>jaxb-impl</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jaxb</groupId>
        <artifactId>jaxb-runtime</artifactId>
        <version>2.3.0</version>
    </dependency>
    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1.1</version>
    </dependency>

</dependencies>

<properties>
    <!-- Installer Filename without suffix -->
    <app.filename>AppExemple</app.filename>

    <!-- The JavaFX Application class name -->
    <app.mainClass>AppExemple</app.mainClass>

    <!-- Optional override to specify where the cached files are stored. Default is current working directory -->
    <app.cacheDir>USERLIB/AppExemple</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>Pinfo Company</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>https://www.ibouce.ml/wp-content/themes/robistrone/javafx/</app.url>

    <!-- Optional scp target for application artifacts hosted at the above url -->
    <app.deploy.target>iboucenda@demo.exemple:exemple</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>
</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.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.4.0</version>
            <!-- Generate app.xml manifest -->
            <executions>
                <!-- Show what's new dialog
                <execution>
                    <id>copy-whatsnewfile</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}/src/main/resources</argument>
                            <argument>whatsnew.html</argument>
                        </arguments>
                    </configuration>
                </execution>-->
                <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>
                <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>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <fork>true</fork>
                <executable>C:\Program Files\Java\jdk-10.0.1\bin\java.exe</executable>
            </configuration>
        </plugin>

    </plugins>
</build>

edvin commented 6 years ago

You need to make sure that scp is available on your PATH.

TurekBot commented 5 years ago

Here's a pro tip I learned recently.

If you've got Git Bash installed (you'll know that you do if you can see these options when you right click in any directory image) then you've already got SCP on your computer.

It's located at C:\Program Files\Git\usr\bin so just add that to your path, and you should be good to go.