This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 84677 - [SSH2] export jsch.jar to allow other plug-ins to access SSH2 functions
Summary: [SSH2] export jsch.jar to allow other plug-ins to access SSH2 functions
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: CVS (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.2 M5   Edit
Assignee: platform-cvs-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-08 09:08 EST by Jean-Michel Lemieux CLA
Modified: 2006-02-23 11:54 EST (History)
8 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jean-Michel Lemieux CLA 2005-02-08 09:08:19 EST
JSch would be beneficial for reuse by other groups building on top of the base
Eclipse platform.  Would you approve exporting the JSch interfaces for reuse in
the Eclipse 3.1 timeframe?
Comment 1 Jean-Michel Lemieux CLA 2005-02-08 09:10:21 EST
If it is exported we (e.g. the Team/CVS component) can't guarantee support of
it. Our only interest is that it works with CVS, and as a result won't consider
any bugs that don't affect CVS as blocking our release schedule.

Another option would be to create a separete plug-in: org.eclipse.ssh2. 
Comment 2 Rob Cecco CLA 2005-02-08 09:27:38 EST
If splitting jsch.jar out into its own plugin will help with the support issue 
then I agree with this approach.  If splitting out is to difficult in the 3.1 
timeframe...I suggest we export for 3.1 and then split out in the next release.
Comment 3 Atsuhiko Yamanaka CLA 2005-02-08 20:41:30 EST
Hi,

I agree with following comments from Jean-Michel Lemieux and I think they are 
reasonable from Team/CVS component point of view.
>If it is exported we (e.g. the Team/CVS component) can't guarantee support of
>it. Our only interest is that it works with CVS, and as a result won't consider
>any bugs that don't affect CVS as blocking our release schedule.

I had planed to write a plug-in based on jsch for other plug-ins
to allow them to enjoy ssh2 functionality; remote exec, login session, scp, 
sftp, port forwardings, etc.  Of course, I had not expected that it will be
included in Eclipse 3. It is just for fun.  As a first step,
I have been keeping in my mind that 
org.eclipse.team.internal.ccvs.ssh2.CVSSSH2Preference.java does not depend on
CVS/Team plug-in.
Comment 4 Michael Valenta CLA 2005-03-30 10:46:57 EST
Not for 3.1
Comment 5 Rob Cecco CLA 2005-03-30 11:00:19 EST
Hi...is there a reason why this was removed for 3.1?  Our product was depending 
on this being in 3.1.
Comment 6 Jean-Michel Lemieux CLA 2005-03-30 11:17:21 EST
It's not that important and the workaround is trivial - just include the jar in
your product.
Comment 7 Rob Cecco CLA 2005-03-30 11:22:03 EST
The problem here is not so much technical (although duplicating code is not a 
good thing for product footprint) rather legal.  For every product that needs 
to include this they have to go through a lengthy legal and open source 
review.  This would have saved countless hours of this effort.
Comment 8 Michael Valenta CLA 2005-03-30 11:41:43 EST
Your point is well taken. However, exporting the jar from the CVS SSH2 plugin 
is something we cannot do because we cannot gaurantee 100% backwards 
compatibility in future releases. The proper solution is to create a separate 
plugin for the SSH2 support. The decision to do this needs to come from YMNK 
since he supports the jar. I would suggest you discuss this with him. Perhaps 
if you were willing to commit resources to help him maintain such a plugin, he 
would be willing to be involved.
Comment 9 Jean-Michel Lemieux CLA 2005-03-30 23:46:23 EST
The re-iterate, the Platform PMC was consulted regarding this request and they
didn't support that the platform would be exposing SSH APIs (which is essentialy
what exporting jsch.jar means). We don't want to be in this business now. 

The enhancement request will remain open - because I think it's still a valid
request that may see the light at some point in the future - just not for 3.1.
Comment 10 Michael Valenta CLA 2005-11-03 13:03:13 EST
We are going to investigate the possibility of doing this in 3.2.
Comment 11 Michael Valenta CLA 2006-01-12 10:03:21 EST
There are a couple of ways we can make the SSH2 support a separate plugin:

1) Create a new dev.eclipse.org project that contains the Jsch.jar. This would be similar to how Ant and other libraries are included in Eclipse.

2) Have the library owner (JCraft) pre-build a JARed plugin and make it available on their site at a publiched location. A JARed plugin would be almost the same as a regular JAR but must contain an OSGI bundle manifest (and possibly a legal-related file). We would provide JCraft with the initial manifest file for them to insert in their jar. The Eclipse plaform build would obtain the JAR from JCraft when Eclipse was built (although it should be possible to configure the build process to cache the locally sothat it doesn't need to be re-obtained each build). 

We would prefer option 2 if possible since it is a cleaner story from our standpoint (and uses new technology;-). We are still in the process of modifying our build process to accomodate this but it should be possible soon. I wanted to send this out to see if JCraft was interested in this approach.
Comment 12 Jeff McAffer CLA 2006-01-12 11:03:54 EST
Option 2 is strongly urged.  Creating a bundle is as simple as including some informationin the JAR manifest.  We would indeed cache the provided bundle and ther ewould be no other adverse impact on JCraft.  The added benefit is that this bundle would then be directly useful in other OSGi implementations etc.
Comment 13 Eugene Kuleshov CLA 2006-01-12 11:38:30 EST
By the way, I've seen number of complains about jsch library. Several projects (including JavaSVN) switched from it to Ganymed library which is also released under BSD license. According to various sources it has cleaner design and it is more stable then jsch. http://www.ganymed.ethz.ch/ssh2/
Comment 14 Michael Valenta CLA 2006-01-12 11:49:37 EST
There are a couple of issues with switching to another SSH2 client:

1) We would need to rewrite the SSH2 plugin which is quite a bit or work to get right.
2) The client you mention does not use the JCE which means it contains cryto code. I suspect it would be problematic for Eclipse to ship with this plugin.

Having said that, there is nothing to stop the providers of the client from also packaging their JAR as an OSGI bundle and making it available for people.
Comment 15 Eugene Kuleshov CLA 2006-01-12 12:01:51 EST
(In reply to comment #14)
> There are a couple of issues with switching to another SSH2 client:
> 
> 1) We would need to rewrite the SSH2 plugin which is quite a bit or work to get
> right.

Isn't it another sign of the design issues in jsch?

Anyway it will also require PMC approval for using another library for ssh.

> 2) The client you mention does not use the JCE which means it contains cryto
> code. I suspect it would be problematic for Eclipse to ship with this plugin.

It may be possible to convince Ganymed guys to use JCE. Ganymed project seems more alive then jsch in its current stage.

> Having said that, there is nothing to stop the providers of the client from
> also packaging their JAR as an OSGI bundle and making it available for people.
 
By the way, I just faced the issue that OSGi does not allow to have multiple versions of the same bundle in the runtime. Which will cause whole bunch of incompatibilities and migration issues, especially if you'll stick to particular version of jsch and other plugins will use it.
Comment 16 Jeff McAffer CLA 2006-01-12 21:29:37 EST
(In reply to comment #15)
> By the way, I just faced the issue that OSGi does not allow to have multiple
> versions of the same bundle in the runtime. Which will cause whole bunch of
> incompatibilities and migration issues, especially if you'll stick to
> particular version of jsch and other plugins will use it.

Off topic but since you mention it...  The runtime definitely supports multiple versions of the same plugin active at the same time.  There must be something else at play.  If you have a usecase that cuases a problem, please enter a bug in Equinox/Framework.
Comment 17 Eugene Kuleshov CLA 2006-01-12 21:50:04 EST
(In reply to comment #16)
> > By the way, I just faced the issue that OSGi does not allow to have multiple
> > versions of the same bundle in the runtime. Which will cause whole bunch of
> > incompatibilities and migration issues, especially if you'll stick to
> > particular version of jsch and other plugins will use it.
> 
> Off topic but since you mention it...  The runtime definitely supports multiple
> versions of the same plugin active at the same time.  There must be something
> else at play.  If you have a usecase that cuases a problem, please enter a bug
> in Equinox/Framework.

That is really good to hear. Perhaps it was an issue with the update manager, which is disabling older version for the platform...
Comment 18 Atsuhiko Yamanaka CLA 2006-01-13 01:43:54 EST
Hi,

(In reply to comment #11)
> 2) Have the library owner (JCraft) pre-build a JARed plugin and make it
> available on their site at a publiched location. A JARed plugin would be almost
> the same as a regular JAR but must contain an OSGI bundle manifest (and
> possibly a legal-related file). We would provide JCraft with the initial
> manifest file for them to insert in their jar. The Eclipse plaform build would
> obtain the JAR from JCraft when Eclipse was built (although it should be
> possible to configure the build process to cache the locally sothat it doesn't
> need to be re-obtained each build). 
> We would prefer option 2 if possible since it is a cleaner story from our
> standpoint (and uses new technology;-). We are still in the process of
> modifying our build process to accomodate this but it should be possible soon.
> I wanted to send this out to see if JCraft was interested in this approach.

Yes, I'm interested in that approach. May I ask you to send me a manifest file
and also suggest me what kind of configuration will be need in my side?

Comment 19 Jeff McAffer CLA 2006-01-14 09:31:21 EST
Here is a first kick at a manifest...  This text should go in the META-INF/MANIFEST.MF file of the jar and the jar should be called com.jcraft.jsch_0.1.18.jar.

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Jsch Plug-in
Bundle-SymbolicName: com.jcraft.jsch
Bundle-Version: 0.1.18
Bundle-ClassPath: .
Bundle-Vendor: JCraft
Bundle-Localization: plugin
Export-Package: com.jcraft.jsch;x-internal:=true,
 com.jcraft.jsch.jce;x-internal:=true,
 com.jcraft.jsch.jcraft;x-internal:=true


Issues to think about:
- in the Export-Package statement remove the ;x-internal:=true for each package that you want to have be externally visible.

- If we currently ship source for this plugin then it would be great if you could also supply a separate source zip that contains the source packages at the root of the archive.

Perhaps Michael you could try this out and give some further guidance?  

Comment 20 Michael Valenta CLA 2006-01-16 11:58:52 EST
We only use the com.jcraft.jsch package so the following is the manifest that works for the SSH2 plugin:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Jsch Plug-in
Bundle-SymbolicName: com.jcraft.jsch
Bundle-Version: 0.1.18
Bundle-ClassPath: .
Bundle-Vendor: JCraft
Bundle-Localization: plugin
Export-Package: com.jcraft.jsch,
 com.jcraft.jsch.jce;x-internal:=true,
 com.jcraft.jsch.jcraft;x-internal:=true

Of course, it is up to JCraft to decide if other clients may need access to the other packages.

I have tried this manifest with a jar named com.jcraft.jsch_0.1.18.jar and a reconfigured SSH2 plugin and it worked with no problems. There are still a couple of questions we need to resolve:

1) Should we switch to using the latest Jsch version? I'm OK with the current jar but other clients may want the latest version. If we switch, we would need to do some testing on the Eclipse end to make sure there are no problems.

2) How should JCraft make it available. Jeff, is a URL from JCraft all we need? Perhaps JCraft can make both version 0.1.18 and the latest version available so we can get it working with the current version and then switch to the latest version (which would be a good test for our upgrade process).
Comment 21 Eugene Kuleshov CLA 2006-01-16 12:13:43 EST
Please reconsile if there are classes needed for proxy support. I've put a patch to another bug report some time ago. So, there could be some other classes that should be exported.
Comment 22 Jeff McAffer CLA 2006-01-16 22:24:30 EST
Re supplying the JAR.  We are looking at how to set this up for real.  Ultimately we will have to version manage such JARs so that we have reproducable builds.  We also don't want to burden our suppliers with serving up the bytes everytime we care to do a build.  So the best best is to get the JAR by whatever means and then give it to the Releng team as part of the base.  They will put it somewhere safe and ensure it is part of the build.

Adding Sonia to the list since I just volunteered her (or Kim) for something...
Comment 23 Atsuhiko Yamanaka CLA 2006-01-17 01:21:40 EST
Hi,

(In reply to comment #20)
> We only use the com.jcraft.jsch package so the following is the manifest that
> works for the SSH2 plugin:
...
> Of course, it is up to JCraft to decide if other clients may need access to the
> other packages.

I agree that com.jcraft.jsch package must be enough.

> 1) Should we switch to using the latest Jsch version? I'm OK with the current
> jar but other clients may want the latest version. If we switch, we would need
> to do some testing on the Eclipse end to make sure there are no problems.

IMHO, it is preferable to use the latest version, but some testing must be done on Eclipse before switching.  Is it allowed such a change before 3.2
release? If it is, I'll try some testing.

> 2) How should JCraft make it available. Jeff, is a URL from JCraft all we need?
> Perhaps JCraft can make both version 0.1.18 and the latest version available so
> we can get it working with the current version and then switch to the latest
> version (which would be a good test for our upgrade process).

Of course, we can host them on our web site.
Comment 24 Michael Valenta CLA 2006-02-10 14:49:59 EST
The Jsch JAR is now in the build as a separate plugin named com.jcraft.jsch. We are still hosting the JAR in the SSH2 plugin and the build fetches it from there because we don't have the build infrastructure to obtain it from another site yet.
Comment 25 Eugene Kuleshov CLA 2006-02-10 15:10:14 EST
What is the exact url for this new plugin? Also is there are any plans to move to 0.1.24 ?
Comment 26 Michael Valenta CLA 2006-02-10 15:25:31 EST
The url is:

http://dev.eclipse.org/viewcvs/index.cgi/*checkout*/org.eclipse.team.cvs.ssh2/com.jcraft.jsch_0.1.18.jar?rev=HEAD&only_with_tag=v20060209&content-type=text/plain

As for moving to 0.1.24, I'm not against it but its up to Yamanaka to decide if and when this would happen. Yamanaka, if you want me to try out the new version for a while, you can upload it to the repository (in the SSH2 plugin).
I'll modify to be a stand alone plugin and run with it for a while to see if there are any problems. Based on how that goes, we can then decide what the best coarse of action is.
Comment 27 Atsuhiko Yamanaka CLA 2006-02-13 12:30:47 EST
(In reply to comment #26)
> Yamanaka, if you want me to try out the new version
> for a while, you can upload it to the repository (in the SSH2 plugin).
> I'll modify to be a stand alone plugin and run with it for a while to see if
> there are any problems. Based on how that goes, we can then decide what the
> best coarse of action is.

Thank you for suggestion.  I have been trying to use new jsch version 
in SSH2 plug-in and I have not encountered the problem yet in my usage.  
If jsch-0.1.25-rc5 is accepted on Bug 102654, I'll upload it.
Comment 28 Atsuhiko Yamanaka CLA 2006-02-20 10:45:24 EST
(In reply to comment #26)
>Yamanaka, if you want me to try out the new version
> for a while, you can upload it to the repository (in the SSH2 plugin).
> I'll modify to be a stand alone plugin and run with it for a while to see if
> there are any problems. Based on how that goes, we can then decide what the
> best coarse of action is.
 
I have uploaded it as com.jcraft.jsch_0.1.25.jar to the repository.
Are there any problems?
Comment 29 Michael Valenta CLA 2006-02-20 10:59:21 EST
Thanks. I will do some initial testing today and, if all goes well, I will put it in tomorrows integration build. I have logged bug 128668 to track the conversion to the new JAR.