What's wrong with Jsch and Maven?

吃可爱长大的小学妹 提交于 2019-12-05 19:31:30

For some reason the jar file in the central repository seems to be broken. The solution is to add another repository for Jsch to the pom.xml.

<repository>
    <id>Jsch</id>
    <url>http://jsch.sf.net/maven2/</url>
</repository>

There are different possibilities:

  • You have used the correct Maven repository for jsch (seems to be this one: http://mvnrepository.com/artifact/com.jcraft/jsch/0.1.44-1), but the download stopped for whatever reason. This happens, and you have just to clear your local repository by deleting the directory for jsch or the the version only. It will be reloaded again.
  • Perhaps you has misconfigured your remote repository for jsch, and jsch is hold somewhere, but not the library, only the meta data. I do not know if it is possible to see from which location you got the wrong library.

You should look at your settings.xml (for Maven or your user) and see if the repository is specified correctly.

You should check if the command

mvn dependency:get -DrepositoryUrl=http://mvnrepository.com/artifact/ \
                   -DgroupId=com.jcraft -DartifactId=jsch -Dversion=0.1.44 \
                   -Dtransitive=false

works properly.

0.1.44 version is broken (it's only 3KB)

http://mvnrepository.com/artifact/com.jcraft/jsch/0.1.44

use http://mvnrepository.com/artifact/com.jcraft/jsch/0.1.44-1 Instead

update your POM to this:

<dependency>
  <groupId>com.jcraft</groupId>
  <artifactId>jsch</artifactId>
  <version>0.1.44-1</version>
</dependency>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!