Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » No class files when including jgit as dependency
No class files when including jgit as dependency [message #1782685] Tue, 27 February 2018 20:49 Go to next message
Stephen Ranger is currently offline Stephen RangerFriend
Messages: 9
Registered: November 2012
Junior Member
Hello,

I've been trying to use jgit in my maven project and it's been fine so far. However, when I package up my project to include in another non-maven project, jgit seems to break building of that project; no class files are generated when compiling it. If I remove jgit as a dependency on the first project and comment out anywhere it's used and recompile, everything works fine.

Anyone have any idea why?


Thanks!
Stephen
Re: No class files when including jgit as dependency [message #1782686 is a reply to message #1782685] Tue, 27 February 2018 21:06 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
no idea with that little information I don't know what you re trying
Re: No class files when including jgit as dependency [message #1782687 is a reply to message #1782685] Tue, 27 February 2018 21:09 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
Stephen Ranger wrote on Tue, 27 February 2018 20:49
Hello,
...However, when I package up my project to include in another non-maven project...

Probably you need to build a fat jar (your project plus all its dependencies). I guess when you try to build the second non-maven project, the transitive dependencies are not found.
Re: No class files when including jgit as dependency [message #1782688 is a reply to message #1782687] Tue, 27 February 2018 21:35 Go to previous messageGo to next message
Stephen Ranger is currently offline Stephen RangerFriend
Messages: 9
Registered: November 2012
Junior Member
The downstream project isn't using any of jgit so it shouldn't matter. However, I am making a fat jar for the second project with all of the necessary dependencies. One jgit is added into the fat jar it stop compiling.

What I'm doing is I have a maven project with a number of modules. One of those modules is using jgit. Each module is compiled into a jar, then they're all compiled into a fat jar along with all their dependencies. The second proejct is an ant project and the first project's fat jar is a dependency. When jgit is in the fat jar it stops compiling. Nothing is referencing the jgit classes.
Re: No class files when including jgit as dependency [message #1782689 is a reply to message #1782688] Tue, 27 February 2018 22:00 Go to previous messageGo to next message
Stephen Ranger is currently offline Stephen RangerFriend
Messages: 9
Registered: November 2012
Junior Member
So I tried putting together a little example but it seems to work fine with vanilla maven/ant dependency. The second project is from NetBeans (I wish it'd die...) so I'll try to put together an example using that for the second project and see what's going on from there. I'm guessing it's something happening between jgit and some netbeans library. But the ant verbose output doesn't show any errors; diffing the output of good vs bad just shows that after the warnings for supported source versions less than 1.8 javac just stops. In the good version it shows some non-claimed annotation warnings and a code warning before copying resources and making directories where in the bad version it skips straight into copying resources and making directories. So somewhere when javac starts trying to actually compile things it fails, stops silently, and exits.

But I'll try to get a reproduce-able test case using netbeans; maybe that will help figure this out.
Re: No class files when including jgit as dependency [message #1786111 is a reply to message #1782689] Wed, 25 April 2018 17:32 Go to previous messageGo to next message
Stephen Ranger is currently offline Stephen RangerFriend
Messages: 9
Registered: November 2012
Junior Member
So I believe I tracked the issue down to an odd interaction with another third party library which, when updated to its most recent version, fixed my issue. (The library was com.github.javaparser:java-symbol-solver-core:0.5.5 and upgraded it to 0.6.3). I'm not sure what exactly caused the issue so if anyone cares to look into it further you're welcome to do so!

Thanks to anyone that commented.
Re: No class files when including jgit as dependency [message #1786751 is a reply to message #1786111] Thu, 10 May 2018 15:05 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
Which Java version are you using ?
For JGit newer than 4.5 you need at least JDK 8 and use at least the Java 8 compiler.

For compiling your code the compiler needs the JGit libraries you need on the class path and all dependencies of that JGit library(s).
If you are using OSGi check the respective MANIFEST.MF files for required dependencies, if you are using Maven check the respective
pom.xml for dependencies. If you are using bazel check the respective BUILD and WORKSPACE files. If you are using any other build
technology refer to its documentation how to set class path for compiler.
Previous Topic:Unable to Save Resolved Conflicts in EGIT
Next Topic:Jgit can't check out the name contains @ branch
Goto Forum:
  


Current Time: Tue Apr 16 20:31:59 GMT 2024

Powered by FUDForum. Page generated in 0.13703 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top