Add Java dependency for SSH module to Gradle

Build 208 of ganymed-ssh2 is closest available version (Aug 2005)

⚠️ Modules were not tested after upgrade
This commit is contained in:
Tobi Schäfer 2021-04-05 10:37:02 +02:00
parent ac02b90699
commit 2f8160526c
5 changed files with 26 additions and 18 deletions

View file

@ -21,6 +21,11 @@ allprojects {
sourceCompatibility = JavaVersion.VERSION_11 sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11
} }
repositories {
mavenCentral()
jcenter()
}
} }
version = new Date().format("yyyyMMdd") version = new Date().format("yyyyMMdd")
@ -37,11 +42,6 @@ sourceSets {
} }
} }
repositories {
mavenCentral()
jcenter()
}
configurations { configurations {
// Wrapping implementation because it does not allow access to its files // Wrapping implementation because it does not allow access to its files
// (i.e. cannot be resolved) // (i.e. cannot be resolved)
@ -68,7 +68,6 @@ def rhinoJar = configurations.library.files.find { jar ->
jar.name.startsWith('rhino') jar.name.startsWith('rhino')
} }
startScripts { startScripts {
applicationName = 'helma' applicationName = 'helma'
classpath = files('../launcher.jar') classpath = files('../launcher.jar')

View file

@ -18,20 +18,20 @@
/** /**
* @fileoverview Fields and methods of the helma.Ssh class. * @fileoverview Fields and methods of the helma.Ssh class.
* <br /><br /> * <br /><br />
* To use this optional module, its repository needs to be added to the * To use this optional module, its repository needs to be added to the
* application, for example by calling app.addRepository('modules/helma/Ssh.js') * application, for example by calling app.addRepository('modules/helma/Ssh.js')
*/ */
// take care of any dependencies // take care of any dependencies
app.addRepository('modules/helma/File.js'); app.addRepository('modules/helma/File.js');
app.addRepository('modules/helma/ganymed-ssh2.jar'); app.addRepository('modules/helma/ganymed-ssh2-build208.jar');
// define the helma namespace, if not existing // define the helma namespace, if not existing
if (!global.helma) { if (!global.helma) {
global.helma = {}; global.helma = {};
} }
/** /**
* Creates a new instance of helma.Ssh * Creates a new instance of helma.Ssh
* @class This class provides methods for connecting to a remote * @class This class provides methods for connecting to a remote
* server via secure shell (ssh) and copying files from/to a remote * server via secure shell (ssh) and copying files from/to a remote
@ -43,7 +43,7 @@ if (!global.helma) {
* file. This argument is optional. * file. This argument is optional.
* @constructor * @constructor
* @returns A newly created instance of helma.Ssh * @returns A newly created instance of helma.Ssh
* @author Robert Gaggl <robert@nomatic.org> * @author Robert Gaggl <robert@nomatic.org>
*/ */
helma.Ssh = function(server, hosts) { helma.Ssh = function(server, hosts) {
var SSHPKG = Packages.ch.ethz.ssh2; var SSHPKG = Packages.ch.ethz.ssh2;
@ -61,11 +61,11 @@ helma.Ssh = function(server, hosts) {
} catch (e) { } catch (e) {
if (e instanceof TypeError == false) if (e instanceof TypeError == false)
throw(e); throw(e);
throw("helma.Ssh needs " + SSHPKGNAME + throw("helma.Ssh needs " + SSHPKGNAME +
" in lib/ext or application directory " + " in lib/ext or application directory " +
"[" + SSHPKGURL + "]"); "[" + SSHPKGURL + "]");
} }
/** /**
* A simple verifier for verifying host keys * A simple verifier for verifying host keys
* @private * @private
@ -96,7 +96,7 @@ helma.Ssh = function(server, hosts) {
return; return;
} }
}; };
/** /**
* Converts the argument into an instance of java.io.File * Converts the argument into an instance of java.io.File
* @param {helma.File|java.io.File|String} file Either a file * @param {helma.File|java.io.File|String} file Either a file
@ -131,7 +131,7 @@ helma.Ssh = function(server, hosts) {
} }
return false; return false;
}; };
/** /**
* Private helper method for debugging output using app.logger * Private helper method for debugging output using app.logger
* @param {String} methodName The name of the method * @param {String} methodName The name of the method
@ -175,7 +175,7 @@ helma.Ssh = function(server, hosts) {
} }
return false; return false;
}; };
/** /**
* Connects to a remote host using plain username/password authentication. * Connects to a remote host using plain username/password authentication.
* @param {String} username The username * @param {String} username The username
@ -217,7 +217,7 @@ helma.Ssh = function(server, hosts) {
} }
return false; return false;
}; };
/** /**
* Disconnects this client from the remote server. * Disconnects this client from the remote server.
*/ */
@ -325,7 +325,7 @@ helma.Ssh = function(server, hosts) {
} }
} }
}; };
/** /**
* Toggles paranoid mode. If set to true this client tries to * Toggles paranoid mode. If set to true this client tries to
* verify the host key against the its list of known hosts * verify the host key against the its list of known hosts
@ -346,7 +346,7 @@ helma.Ssh = function(server, hosts) {
this.isParanoid = function() { this.isParanoid = function() {
return paranoid; return paranoid;
}; };
/** /**
* main constructor body * main constructor body
*/ */

View file

@ -0,0 +1,8 @@
dependencies {
runtime 'ch.ethz.ganymed:ganymed-ssh2:build208'
}
task deps(type: Copy) {
from sourceSets.main.runtimeClasspath
into '.'
}

View file

@ -7,3 +7,4 @@ org.apache.tools.ant.DirectoryScanner.removeDefaultExclude('**/.git/**')
org.apache.tools.ant.DirectoryScanner.removeDefaultExclude('**/.gitignore') org.apache.tools.ant.DirectoryScanner.removeDefaultExclude('**/.gitignore')
include 'launcher' include 'launcher'
include 'modules:helma'