Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scpOptions not working for Gradle Build #7

Closed
wemgl opened this issue Aug 20, 2017 · 3 comments
Closed

scpOptions not working for Gradle Build #7

wemgl opened this issue Aug 20, 2017 · 3 comments

Comments

@wemgl
Copy link
Contributor

wemgl commented Aug 20, 2017

Hi edvin,

I am trying to use FXLauncher to build a launcher for my JavaFX application using Gradle. My build.gradle file current looks like this (Note: The actual URLs and domain names have been removed):

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'no.tornado:fxlauncher-gradle-plugin:1.0.17'
    }
}

plugins {
    id 'io.franzbecker.gradle-lombok' version '1.10'
    id 'java'
}

group 'com.example.admin'
version '1.0.0'

apply plugin: 'java'
apply plugin: 'no.tornado.fxlauncher'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

fxlauncher {
    applicationUrl = 'https://adminapp.example.com/'
    applicationMainClass = 'com.example.admin.Main'
    applicationVendor = 'Example Vendor'
    applicationVersion = '1.0.0'
    acceptDowngrade = false
    deployTarget = '[email protected]:adminapp'
    scpOptions = ["-v"]
}

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    compile 'org.slf4j:slf4j-api:1.7.25'
    compile 'org.slf4j:slf4j-simple:1.7.25'
    compile 'org.xerial:sqlite-jdbc:3.19.3'
    compile 'org.apache.commons:commons-lang3:3.6'
}

Unfortunately, I am running into an issue when I try to run the Gradle deployApp task, which I do as follows:

./gradlew clean deployApp

That task actually runs fine because a build/fxlauncher directory is generated with all the artifacts and dependencies for the application inside of it, but when fxlauncher attempts to perform the SCP I see this error:

Execution failed for task ':deployApp'.
> scp exited with status 1

To verify that SCP was installed and working on my machine I copied a test file to the folder on my server and that worked without any issues. I then tried adding the scpOptions option to the build.gradle file, but no "verbose" output is displayed. I think if you can help me get that working, then I should be able to figure out the rest on my own. Thank you in advance.

@edvin
Copy link
Owner

edvin commented Aug 21, 2017

I have uploaded a new snapshot that should output the actual scp command it runs. Can you try with '1.0.18-SNAPSHOT'? Snapshots are published to sonatype:

https://oss.sonatype.org/content/repositories/snapshots/

@wemgl
Copy link
Contributor Author

wemgl commented Aug 22, 2017

Thanks @edvin. That updated artifact, this other issue here edvin/fxlauncher#23, and running this command ssh-add ~/.ssh/id_rsa before performing the deployApp Gradle task fixed the issue I was having. Everything gets copied to my server successfully.

@wemgl wemgl closed this as completed Aug 22, 2017
@edvin
Copy link
Owner

edvin commented Aug 22, 2017

This would be much smoother if we used an integrated ssh library. Will look into that when time permits :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants