Installing JGit - archimatetool/archi-modelrepository-plugin GitHub Wiki

Intro

These are notes to me for updating the JGit libraries.

This uses JGit 6.1

Where to get them

Method 1 - Install JGit in Eclipse itself

Also get the JGit Source code from the update site:

https://download.eclipse.org/egit/updates/

Then in the Eclipse installation find the various "jgit" features and look for their dependent plug-in jars.

Method 2 - Download the artefacts

Download from here - https://wiki.eclipse.org/EGit/FAQ#Where_can_I_find_older_releases_of_EGit.3F

Choose "download p2 repository"

Unzip.

You can unpack the relevant jars in the "features" folder to look for the dependencies in the feature.xml files.

The plug-in jars are in the "plugins" folder.

coArchi requirements

These are the jars we need for coArchi:

javaewah_1.1.13.v20211029-0839.jar                      -- For JGit's Garbage Collection
net.i2p.crypto.eddsa_0.3.0.v20210923-1401.jar           -- Required by Apache SSHD
org.apache.sshd.osgi_2.8.0.v20211227-1750.jar           -- Apache SSH support
org.eclipse.jgit.ssh.apache_6.1.0.202203080745-r        -- JGit Apache SSH support
org.eclipse.jgit_6.1.0.202203080745-r.jar               -- JGit
org.slf4j.api_1.7.30.v20200204-2150.jar                 -- Logging
org.slf4j.binding.simple_1.7.30.v20200204-2150.jar      -- Simple Logging

These are the source jars which are useful for debugging:

org.apache.sshd.osgi.source_2.8.0.v20211227-1750.jar           -- Apache SSH
org.eclipse.jgit.source_6.1.0.202203080745-r.jar               -- JGit
org.eclipse.jgit.ssh.apache.source_6.1.0.202203080745-r.jar    -- JGit Apache SSH

Logging Issues

We need the following jar to stop slfj logging a message to the console:

org.slf4j.binding.simple_1.7.30.v20200204-2150.jar

This is the message that gets logged without it:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

But be careful when adding this jar to the MANIFEST.MF file's Runtime -> Classpath. When a jar is added to the Classpath section Eclipse also adds it to the compile time .classpath file:

<classpathentry exported="true" kind="lib" path="lib/slf4j-simple-1.7.30.jar"/>

Then we get this message error:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [bundleresource://58.fwk1725112103:9/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [bundleresource://58.fwk1725112103:18/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]

So remove this entry from the .classpath file:

<classpathentry exported="true" kind="lib" path="lib/slf4j-simple-1.7.30.jar"/>

Other jars not used

These jars from JGit are not used in coArchi:

org.apache.commons.compress_1.21.0.v20211103-2100.jar      -- Used by org.eclipse.jgit.archive
org.eclipse.jgit.archive_6.1.0.202203080745-r.jar          -- Used for compression in JGit's "ArchiveCommand"

Those two are not needed unless you use JGit's ArchiveCommand for creating archives of the git tree (example).

Links

https://www.eclipse.org/jgit/download/

https://wiki.eclipse.org/EGit/FAQ#Where_can_I_find_older_releases_of_EGit.3F