Skip to content

Update jgit from 7.2.0 to 7.6.0#8892

Open
mbien wants to merge 3 commits intoapache:masterfrom
mbien:jgit740
Open

Update jgit from 7.2.0 to 7.6.0#8892
mbien wants to merge 3 commits intoapache:masterfrom
mbien:jgit740

Conversation

@mbien
Copy link
Copy Markdown
Member

@mbien mbien commented Oct 6, 2025

This updates jgit to latest (7.6) and its dependencies to the resolved version.

current jgit releases are not on maven central yet but the jgit team is working on it (eclipse-jgit/jgit#210). This adds the eclipse repo temporarily. done

classpath diffs
$ mvn eu.maveniverse.maven.plugins:toolbox:gav-classpath-diff -Dunified\
 -Dgav1=org.eclipse.jgit:org.eclipse.jgit:7.2.0.202503040940-r -Dgav2=org.eclipse.jgit:org.eclipse.jgit:7.4.0.202509020913-r 

*** org.eclipse.jgit:org.eclipse.jgit:jar 7.2.0.202503040940-r -> 7.4.0.202509020913-r
    com.googlecode.javaewah:JavaEWAH:jar:1.2.3
    org.slf4j:slf4j-api:jar:1.7.36
*** commons-codec:commons-codec:jar 1.18.0 -> 1.19.0

$ mvn eu.maveniverse.maven.plugins:toolbox:gav-classpath-diff -Dunified\
 -Dgav1=org.eclipse.jgit:org.eclipse.jgit.gpg.bc:7.2.0.202503040940-r -Dgav2=org.eclipse.jgit:org.eclipse.jgit.gpg.bc:7.4.0.202509020913-r

*** org.eclipse.jgit:org.eclipse.jgit.gpg.bc:jar 7.2.0.202503040940-r -> 7.4.0.202509020913-r
*** org.eclipse.jgit:org.eclipse.jgit:jar 7.2.0.202503040940-r -> 7.4.0.202509020913-r
    com.googlecode.javaewah:JavaEWAH:jar:1.2.3
*** commons-codec:commons-codec:jar 1.18.0 -> 1.19.0
*** org.bouncycastle:bcpg-jdk18on:jar 1.80 -> 1.81
*** org.bouncycastle:bcprov-jdk18on:jar 1.80 -> 1.81
*** org.bouncycastle:bcutil-jdk18on:jar 1.80 -> 1.81
*** org.bouncycastle:bcpkix-jdk18on:jar 1.80 -> 1.81
    org.slf4j:slf4j-api:jar:1.7.36

$ mvn eu.maveniverse.maven.plugins:toolbox:gav-classpath-diff -Dunified\
 -Dgav1=org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:7.2.0.202503040940-r -Dgav2=org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:7.4.0.202509020913-r

*** org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:jar 7.2.0.202503040940-r -> 7.4.0.202509020913-r
*** org.eclipse.jgit:org.eclipse.jgit:jar 7.2.0.202503040940-r -> 7.4.0.202509020913-r
    com.googlecode.javaewah:JavaEWAH:jar:1.2.3
*** commons-codec:commons-codec:jar 1.18.0 -> 1.19.0
    com.jcraft:jsch:jar:0.1.55
    com.jcraft:jzlib:jar:1.1.3
    org.slf4j:slf4j-api:jar:1.7.36

$ mvn eu.maveniverse.maven.plugins:toolbox:gav-classpath-diff -Dunified\
 -Dgav1=org.eclipse.jgit:org.eclipse.jgit.lfs:7.2.0.202503040940-r -Dgav2=org.eclipse.jgit:org.eclipse.jgit.lfs:7.4.0.202509020913-r

*** org.eclipse.jgit:org.eclipse.jgit.lfs:jar 7.2.0.202503040940-r -> 7.4.0.202509020913-r
*** org.eclipse.jgit:org.eclipse.jgit:jar 7.2.0.202503040940-r -> 7.4.0.202509020913-r
    com.googlecode.javaewah:JavaEWAH:jar:1.2.3
    org.slf4j:slf4j-api:jar:1.7.36
*** commons-codec:commons-codec:jar 1.18.0 -> 1.19.0
*** com.google.code.gson:gson:jar 2.12.1 -> 2.13.1
*** com.google.errorprone:error_prone_annotations:jar 2.36.0 -> 2.38.0

thanks to @cstamas for the awesome classpath diff tool. This made this much easier than in past.

last update for reference #8383

@mbien mbien added this to the NB28 milestone Oct 6, 2025
@mbien mbien added Upgrade Library Library (Dependency) Upgrade git [ci] enable versioning job ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Oct 6, 2025
@mbien
Copy link
Copy Markdown
Member Author

mbien commented Oct 6, 2025

oh right I forgot about that (#7569). bouncycaste can't be updated still

    [junit] WARNING [org.netbeans.core.netigso.Netigso]: Cannot fake bcprov
    [junit] org.osgi.framework.BundleException: Invalid manifest header Import-Package: "java.io;resolution:="optional"" : Cannot specify java.* packages in Import/Export headers "java.io"
    [junit] 	at org.eclipse.osgi.internal.resolver.StateBuilder.checkImportExportSyntax(StateBuilder.java:824)
    [junit] 	at org.eclipse.osgi.internal.resolver.StateBuilder.validateHeaders(StateBuilder.java:212)

edit: reverted it here and parked the bouncycastle commit in a branch https://github.com/mbien/netbeans/commits/bc182/
edit2: opened issue #8894

@mbien mbien marked this pull request as draft October 6, 2025 23:45
@mbien mbien force-pushed the jgit740 branch 2 times, most recently from 055f839 to 66bed4e Compare October 7, 2025 00:48
@mbien mbien marked this pull request as ready for review October 7, 2025 01:13
@mbien mbien added the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Oct 8, 2025
@mbien
Copy link
Copy Markdown
Member Author

mbien commented Oct 8, 2025

jgit update is likely not possible with the bouncycastle dependency locked to 1.77.

I ran jgit tests locally with downgraded dependency:

diff --git a/pom.xml b/pom.xml
index 14cfa2405..f1a8b742c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -137,7 +137,7 @@
     <slf4j-version>1.7.36</slf4j-version>
     <maven-javadoc-plugin-version>3.11.2</maven-javadoc-plugin-version>
     <gson-version>2.13.1</gson-version>
-    <bouncycastle-version>1.81</bouncycastle-version>
+    <bouncycastle-version>1.77</bouncycastle-version>
     <spotbugs-maven-plugin-version>4.9.3.0</spotbugs-maven-plugin-version>
     <maven-project-info-reports-plugin-version>3.9.0</maven-project-info-reports-plugin-version>
     <maven-jxr-plugin-version>3.6.0</maven-jxr-plugin-version>
git checkout v7.4.0.202509020913-r
mvn clean verify

failed with

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.0:compile (default-compile) on project org.eclipse.jgit.gpg.bc: Compilation failure: Compilation failure:
[ERROR] /home/mbien/NetBeansProjects/jgit/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/BouncyCastleGpgSigner.java:[105,47] The constructor org.bouncycastle.openpgp.PGPSignatureGenerator(org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentSignerBuilder, org.bouncycastle.openpgp.PGPPublicKey) is undefined
[ERROR] /home/mbien/NetBeansProjects/jgit/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeys.java:[149,22] ProtectionFormatTypeTags cannot be resolved or is not a field
[ERROR] /home/mbien/NetBeansProjects/jgit/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/SecretKeys.java:[150,6] The method getProtectionType(java.lang.String) is undefined for the type org.bouncycastle.gpg.SExprParser

converting to draft, dropping milestone

@mbien mbien marked this pull request as draft October 8, 2025 19:42
@mbien mbien removed this from the NB28 milestone Oct 8, 2025
@mbien
Copy link
Copy Markdown
Member Author

mbien commented Apr 11, 2026

edit: smoke test worked, modules loaded + tested basic git workflow

@matthiasblaesing
Copy link
Copy Markdown
Contributor

Just built this together with #9329 merged and signing seems to work and both lfs and gpg.bc are reported as being resolved.

@mbien
Copy link
Copy Markdown
Member Author

mbien commented Apr 12, 2026

dependency tree is now:

+- org.eclipse.jgit:org.eclipse.jgit.gpg.bc:jar:7.6.0.202603022253-r [compile] (origin: central)
|  +- org.bouncycastle:bcpg-jdk18on:jar:1.83 [compile] (origin: central,jgit-repository)
|  +- org.bouncycastle:bcprov-jdk18on:jar:1.83 [compile] (origin: central,jgit-repository)
|  +- org.bouncycastle:bcutil-jdk18on:jar:1.83 [compile] (origin: central,jgit-repository)
|  +- org.bouncycastle:bcpkix-jdk18on:jar:1.83 [compile] (origin: central,jgit-repository)
|  \- org.slf4j:slf4j-api:jar:2.0.17 [compile] (origin: central,jgit-repository)
+- org.eclipse.jgit:org.eclipse.jgit.lfs:jar:7.6.0.202603022253-r [compile] (origin: central)
|  \- com.google.code.gson:gson:jar:2.13.2 [compile] (origin: central,jgit-repository)
|     \- com.google.errorprone:error_prone_annotations:jar:2.41.0 [compile] (origin: central,jgit-repository)
+- org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:jar:7.6.0.202603022253-r [compile] (origin: central)
|  +- com.jcraft:jsch:jar:0.1.55 [compile] (origin: central,jgit-repository)
|  \- com.jcraft:jzlib:jar:1.1.3 [compile] (origin: central,jgit-repository)
\- org.eclipse.jgit:org.eclipse.jgit:jar:7.6.0.202603022253-r [compile] (origin: central)
   +- com.googlecode.javaewah:JavaEWAH:jar:1.2.3 [compile] (origin: central,jgit-repository)
   \- commons-codec:commons-codec:jar:1.21.0 [compile] (origin: central,jgit-repository)

will bump commons-codec to the stated version. But other than that we are good i believe.

slf4j-api we ship is at 1.7.36, but it seems to work fine with it. Bumping the major version there might be risky - lets keep it a while longer.

@mbien mbien changed the title Update jgit from 7.2.0 to 7.4.0 Update jgit from 7.2.0 to 7.6.0 Apr 12, 2026
@mbien mbien marked this pull request as ready for review April 12, 2026 20:16
@mbien mbien removed the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Apr 12, 2026
@mbien mbien modified the milestone: NB30 Apr 12, 2026
@mbien mbien added the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Apr 12, 2026
@mbien
Copy link
Copy Markdown
Member Author

mbien commented Apr 12, 2026

opening history for some repos, e.g the netbeans repo doesn't work

Details
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.git.ui.history.SearchExecutor
java.lang.IllegalArgumentException: 23 flags already created.
	at org.eclipse.jgit.revwalk.RevWalk.allocFlag(RevWalk.java:1418)
	at org.eclipse.jgit.revwalk.RevWalk.newFlag(RevWalk.java:1412)
	at org.netbeans.libs.git.jgit.commands.LogCommand.run(LogCommand.java:124)
	at org.netbeans.libs.git.jgit.commands.GitCommand.execute(GitCommand.java:49)
	at org.netbeans.libs.git.GitClient.log(GitClient.java:982)
	at org.netbeans.modules.git.client.GitClient$39.call(GitClient.java:614)
	at org.netbeans.modules.git.client.GitClient$39.call(GitClient.java:610)
	at org.netbeans.modules.git.client.GitClient$CommandInvoker$1$1.call(GitClient.java:945)
	at org.netbeans.modules.git.client.GitClient$CommandInvoker$1.call(GitClient.java:968)
	at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethodIntern(GitClient.java:980)
	at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethod(GitClient.java:909)
	at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethod(GitClient.java:887)
	at org.netbeans.modules.git.client.GitClient.log(GitClient.java:610)
	at org.netbeans.modules.git.ui.history.SearchExecutor.search(SearchExecutor.java:185)
	at org.netbeans.modules.git.ui.history.SearchExecutor.perform(SearchExecutor.java:166)
	at org.netbeans.modules.git.client.GitProgressSupport.performIntern(GitProgressSupport.java:92)
	at org.netbeans.modules.git.client.GitProgressSupport.run(GitProgressSupport.java:85)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2012)
Caused: org.openide.util.RequestProcessor$SlowItem
	at org.openide.util.RequestProcessor.post(RequestProcessor.java:395)
	at org.netbeans.modules.git.client.GitProgressSupport.start(GitProgressSupport.java:78)
	at org.netbeans.modules.git.ui.history.SearchHistoryPanel.executeSearch(SearchHistoryPanel.java:375)
	at org.netbeans.modules.git.ui.history.SearchHistoryTopComponent.search(SearchHistoryTopComponent.java:55)
	at org.netbeans.modules.git.ui.history.SearchHistoryAction.lambda$openSearch$0(SearchHistoryAction.java:79)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:323)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:714)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
[catch] at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

dejavu #6594

eclipse-jgit/jgit@a5a1c87 seems to have reduced the available flags by one without updating the doc at https://github.com/eclipse-jgit/jgit/blame/9bcb91c0106bf96e1d9bdd04eb0ff4b8be612b13/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevWalk.java#L1401?

edit: can confirm that reducing the flag limit by one in LogCommand does fix it again.
edi2: adjusted value + added tripwire test

mbien added 3 commits April 12, 2026 23:39
adjusted RevWalk max flags constant since it diverges from javadoc and
added tripwire test in case it changes again in future.
@mbien mbien removed the do not merge Don't merge this PR, it is not ready or just demonstration purposes. label Apr 12, 2026
@mbien mbien added this to the NB30 milestone Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) git [ci] enable versioning job Upgrade Library Library (Dependency) Upgrade

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants