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

JGit from sbt shell doesn't work:Could not find or load main class org.eclipse.jgit.pgm.Main #147

Open
apple-corps opened this issue Oct 26, 2017 · 4 comments

Comments

@apple-corps
Copy link

From the documentation I did these things

addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.3") in plugins.sbt
enablePlugins(GitBranchPrompt) in build.sbt
enablePlugins(GitVersioning) in build.sbt
useJGit in git.sbt

Using the git command in the sbt shell

I get git status Error: Could not find or load main class org.eclipse.jgit.pgm.Main [error] Nonzero exit code (1) running JGit.

Looks related to the class loading.

@apple-corps
Copy link
Author

After removing useJGit I still get
git status
Error: Could not find or load main class org.eclipse.jgit.pgm.Main

Then the functionality seems completely broken.

@JessePelton
Copy link

Possible duplicate of #100, which has a possible fix but is awaiting a test case.

@kwalcock
Copy link

I'm seeing this error in 2019 not just in Windows, but also on Travis running Linux. JGitRunner is apparently not getting the classpath that it needs on line 77. It wouldn't work right for Windows for sure, but Travis should be OK. Perhaps sbt is not arranging the classpath as before. This seems not to work:

    getClass.getClassLoader match {
       case cl: java.net.URLClassLoader =>
         val cp = cl.getURLs map (_.getFile) mkString ":"

@kwalcock
Copy link

I think the problem on Linux is just with a transitive dependency, so see #100 for a correction to the code.

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

3 participants