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

Version.getVersion #98

Closed
thomasrunge opened this issue Dec 3, 2021 · 6 comments · Fixed by #100
Closed

Version.getVersion #98

thomasrunge opened this issue Dec 3, 2021 · 6 comments · Fixed by #100
Labels
api bug Something isn't working

Comments

@thomasrunge
Copy link

Any chance to make com.jcraft.jsch.Version.getVersion public? I find it very helpful to ask (and log!) all currently used versions of third party libs.

@mwiede
Copy link
Owner

mwiede commented Dec 6, 2021

You could get meta-information from the jar by getting the version also: com.jcraft.jsch.JSch.class.getPackage().getImplementationVersion()

@norrisjeremy
Copy link
Contributor

You could get meta-information from the jar by getting the version also: com.jcraft.jsch.JSch.class.getPackage().getImplementationVersion()

FYI, I think that only works as long as the original jar-file is used. If you shade the Jsch library into another jar-file (for example using the maven-shade-plugin), I don't think that will work, since the original MANIFEST.MF from the JSch jar-file may not be present. This is ultimately why I created this Version class a few releases ago, since internally we have an application in which we shade the JSch library and I discovered that the version number wasn't getting set correctly in the SSH connection exchange with a server.

I'm not sure if we should make the Version class public, or perhaps just provide a wrapper method in the JSch class itself that returns Version.getVersion()?

@thomasrunge
Copy link
Author

Well, the original JSch had JSch.VERSION, you removed that.

norrisjeremy referenced this issue in norrisjeremy/jsch Dec 7, 2021
@norrisjeremy norrisjeremy mentioned this issue Dec 7, 2021
@norrisjeremy
Copy link
Contributor

Hi @thomasrunge,

Would restoring JSch.VERSION (as proposed in #100) suffice for your use case?

Thanks,
Jeremy

@thomasrunge
Copy link
Author

That would be perfect, as I'm currently using the old JSch version and switching over to your version would minimize trouble.

@mwiede
Copy link
Owner

mwiede commented Dec 8, 2021

@mwiede mwiede closed this as completed Dec 8, 2021
@mwiede mwiede linked a pull request Dec 8, 2021 that will close this issue
@mwiede mwiede added api bug Something isn't working labels Dec 8, 2021
@norrisjeremy norrisjeremy mentioned this issue Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants