Bug 571932 - JGit incompatible to Eclipse 4.20 platform / Jetty 10
Summary: JGit incompatible to Eclipse 4.20 platform / Jetty 10
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.11   Edit
Hardware: PC All
: P3 major (vote)
Target Milestone: 6.0   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-13 04:21 EST by Andrey Loskutov CLA
Modified: 2021-11-22 17:55 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Loskutov CLA 2021-03-13 04:21:38 EST
With the update to Jetty 10.0.1 in 4.20 Eclipse (see bug 569804) I see multiple bundle dependencies errors in JGit, and even after relaxing the version constraints on few javax packages still compilation errors in jgit tests. 

Below patch that fixes the bundle dependencies, but compilation errors in org.eclipse.jgit.junit.http are not fixed.


diff --git a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
index a4bbfd9..ae1cbc0 100644
--- a/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.http.server/META-INF/MANIFEST.MF
@@ -16,8 +16,8 @@
    javax.servlet.http"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: javax.servlet;version="[2.5.0,3.2.0)",
- javax.servlet.http;version="[2.5.0,3.2.0)",
+Import-Package: javax.servlet;version="[2.5.0,4.1.0)",
+ javax.servlet.http;version="[2.5.0,4.1.0)",
  org.eclipse.jgit.annotations;version="[5.12.0,5.13.0)",
  org.eclipse.jgit.errors;version="[5.12.0,5.13.0)",
  org.eclipse.jgit.internal.storage.dfs;version="[5.12.0,5.13.0)",
diff --git a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
index a170764..4060f1a 100644
--- a/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.junit.http/META-INF/MANIFEST.MF
@@ -8,20 +8,19 @@
 Bundle-Vendor: %Bundle-Vendor
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: javax.servlet;version="[2.5.0,3.2.0)",
- javax.servlet.http;version="[2.5.0,3.2.0)",
+Import-Package: javax.servlet;version="[2.5.0,4.1.0)",
+ javax.servlet.http;version="[2.5.0,4.1.0)",
  org.apache.commons.logging;version="[1.1.1,2.0.0)",
- org.eclipse.jetty.http;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.security;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.security.authentication;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.server;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.server.handler;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.server.nio;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.servlet;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.util.component;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.util.log;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.util.security;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.util.ssl;version="[9.4.5,10.0.0)",
+ org.eclipse.jetty.http;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.security;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.security.authentication;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.server;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.server.handler;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.servlet;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.util.component;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.util.log;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.util.security;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.util.ssl;version="[9.4.5,10.1.0)",
  org.eclipse.jgit.errors;version="[5.12.0,5.13.0)",
  org.eclipse.jgit.http.server;version="[5.12.0,5.13.0)",
  org.eclipse.jgit.internal.storage.file;version="[5.12.0,5.13.0)",
diff --git a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
index 2bf113b..37896b2 100644
--- a/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.lfs.server/META-INF/MANIFEST.MF
@@ -20,9 +20,9 @@
    org.eclipse.jgit.lfs.lib"
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
 Import-Package: com.google.gson;version="[2.8.0,3.0.0)",
- javax.servlet;version="[3.1.0,4.0.0)",
- javax.servlet.annotation;version="[3.1.0,4.0.0)",
- javax.servlet.http;version="[3.1.0,4.0.0)",
+ javax.servlet;version="[3.1.0,4.1.0)",
+ javax.servlet.annotation;version="[3.1.0,4.1.0)",
+ javax.servlet.http;version="[3.1.0,4.1.0)",
  org.apache.http;version="[4.3.0,5.0.0)",
  org.eclipse.jgit.annotations;version="[5.12.0,5.13.0)",
  org.eclipse.jgit.internal;version="[5.12.0,5.13.0)",
diff --git a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
index fe1b42b..9e3acee 100644
--- a/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
+++ b/org.eclipse.jgit.pgm/META-INF/MANIFEST.MF
@@ -7,13 +7,13 @@
 Bundle-Vendor: %Bundle-Vendor
 Bundle-Localization: plugin
 Bundle-RequiredExecutionEnvironment: JavaSE-1.8
-Import-Package: javax.servlet;version="[3.1.0,4.0.0)",
+Import-Package: javax.servlet;version="[3.1.0,4.1.0)",
  org.apache.commons.logging;version="[1.2,2.0)",
- org.eclipse.jetty.server;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.server.handler;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.servlet;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.util;version="[9.4.5,10.0.0)",
- org.eclipse.jetty.util.component;version="[9.4.5,10.0.0)",
+ org.eclipse.jetty.server;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.server.handler;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.servlet;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.util;version="[9.4.5,10.1.0)",
+ org.eclipse.jetty.util.component;version="[9.4.5,10.1.0)",
  org.eclipse.jgit.api;version="[5.12.0,5.13.0)",
  org.eclipse.jgit.api.errors;version="[5.12.0,5.13.0)",
  org.eclipse.jgit.archive;version="[5.12.0,5.13.0)",
Comment 1 Eclipse Genie CLA 2021-03-15 04:11:49 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/177717
Comment 2 Matthias Sohn CLA 2021-03-15 04:36:50 EDT
Jetty 10.x has a minimum Java requirement of Java 11 [1].
JGit 5.x has a minimum Java requirement of Java 8 [2].
The bump to Java 11 was proposed to be done only in JGit 6.x [3] in order to avoid disrupting users of older Eclipse versions using a recent EGit version.

The proposed change neither works on Java 8 nor Java 11.

[1] https://www.eclipse.org/lists/jetty-announce/msg00149.html
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=569917
[3] https://wiki.eclipse.org/JGit/Planning#Ideas_for_JGit_6.0
Comment 3 Andrey Loskutov CLA 2021-03-15 04:44:23 EDT
(In reply to Matthias Sohn from comment #2)
> The proposed change neither works on Java 8 nor Java 11.

Could you provide more details, what would be broken? Compilation in the IDE seem to succeed (beside I can't understand how to configure maven / target to compile it with maven).

> The bump to Java 11 was proposed to be done only in JGit 6.x [3] in order to
> avoid disrupting users of older Eclipse versions using a recent EGit version.

So what would be the plan, how do we want support 4.20 release? Update to Jetty 10 on JGit 6.x branch and release that with 4.20?
Comment 4 Alexander Kurtakov CLA 2021-03-15 04:56:06 EDT
It might be possible for jgit to support servlet 3.x and 4.x simultaneously. Equinox part supported servlet 4.x but didn't require it while platform was at Jetty 9.
Comment 5 Thomas Wolf CLA 2021-03-15 06:41:29 EDT
(In reply to Andrey Loskutov from comment #3)
> So what would be the plan, how do we want support 4.20 release? Update to
> Jetty 10 on JGit 6.x branch and release that with 4.20?

The Jetty dependency is only in bundles that you don't need to install in Eclipse, and that should not be pulled in when you install EGit. You might see errors when trying to build JGit against a 4.20 target platform, if you imported all bundles into the workspace, and the http tests might not work.

If you just want to install EGit, you don't need http.server, nor junit.http, nor lfs.server, nor jgit.pgm. (Why does jgit.pgm even have a jetty dependency? Looks like this is only because someone put in a little LFS server for testing purposes.)

But long-term we need to do something about it. Does Gerrit use lfs.server? If so, a change of the javax.servlet-api version range might need to be coordinated with Gerrit?

When JGit goes to BREE Java 11, EGit's baseline will need to be bumped to Eclipse 2020-09. Moving only the bundles depending on javax.servlet-api or jetty to Java 11 will leave us with a mixed Java8/Java 11 build. Not sure how that would work out... 

JGit also has different builds: besides the plain maven build there's a maven-tycho build for the p2 repository, and there's a completely separate bazel build that Gerrit uses.
Comment 6 Matthias Sohn CLA 2021-11-22 17:55:32 EST
jetty was updated to 10.0.6 for jgit 6.0 in
https://git.eclipse.org/r/c/jgit/jgit/+/187918