jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

org.eclipse.jetty:jetty-server:12.0.10 Not able to build from source

Open dhruvi897 opened this issue 1 year ago • 2 comments
trafficstars

Jetty version(s) 12.0.10

Java version/vendor 17.0.8

Description Hi Team,

I am trying to build org.eclipse.jetty:jetty-server:12.0.10 from source but it is failing as there is a difference in the number of Files in the jar built (298) and Files present in web jar (294)

Files present in our_jar but not in web_jar: /tmp/jar_comparisons/our/jetty-server-12.0.10/org/eclipse/jetty/server/ProxyConnectionFactory$1.class /tmp/jar_comparisons/our/jetty-server-12.0.10/org/eclipse/jetty/server/handler/ContextHandler$1.class /tmp/jar_comparisons/our/jetty-server-12.0.10/org/eclipse/jetty/server/handler/gzip/GzipResponseAndCallback$1.class /tmp/jar_comparisons/our/jetty-server-12.0.10/org/eclipse/jetty/server/internal/HttpChannelState$1.class

Build command: mvn clean install -DskipTests -q -e

dhruvi897 avatar Aug 05 '24 13:08 dhruvi897

What is web_jar ? As that's not an official build, and I'll show you why.

First, lets grab the official build.

$ curl -O https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-server/12.0.10/jetty-server-12.0.10.jar
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  594k  100  594k    0     0  3099k      0 --:--:-- --:--:-- --:--:-- 3112k
$ curl -O https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-server/12.0.10/jetty-server-12.0.10.jar.sha1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    40  100    40    0     0    298      0 --:--:-- --:--:-- --:--:--   300
$ cat jetty-server-12.0.10.jar.sha1 
0dcdef1c9ead5040e6b637512ab1794191058a22
$ sha1sum jetty-server-12.0.10.jar
0dcdef1c9ead5040e6b637512ab1794191058a22  jetty-server-12.0.10.jar

Now lets see what's in the official build

$ jar -tvf jetty-server-12.0.10.jar | grep ProxyConnectionFactory
  5936 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/ProxyConnectionFactory$ProxyEndPoint.class
  7972 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/ProxyConnectionFactory$ProxyV1ConnectionFactory$ProxyProtocolV1Connection.class
  3400 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/ProxyConnectionFactory$ProxyV1ConnectionFactory.class
  1724 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/ProxyConnectionFactory$ProxyV2ConnectionFactory$Family.class
 12508 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/ProxyConnectionFactory$ProxyV2ConnectionFactory$ProxyProtocolV2Connection.class
  1700 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/ProxyConnectionFactory$ProxyV2ConnectionFactory$Transport.class
  4445 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/ProxyConnectionFactory$ProxyV2ConnectionFactory.class
  4344 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/ProxyConnectionFactory.class
$ jar -tvf jetty-server-12.0.10.jar | grep ContextHandler
  1523 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandler$Availability.class
   793 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandler$ContextScopeListener.class
  1454 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandler$ProtectedTargetType.class
  8714 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandler$ScopedContext.class
  3039 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandler$VHost.class
 32468 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandler.class
  1720 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandlerCollection$1.class
  1726 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandlerCollection$2.class
  2569 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandlerCollection$Branch.class
  3321 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandlerCollection$Mapping.class
  9546 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/ContextHandlerCollection.class
  3340 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/MovedContextHandler$Redirector.class
  3010 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/MovedContextHandler.class
  3456 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/handler/jmx/ContextHandlerMBean.class
$ jar -tvf jetty-server-12.0.10.jar | grep HttpChannelState
  8756 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState$ChannelCallback.class
 14414 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState$ChannelRequest.class
 15799 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState$ChannelResponse.class
  6111 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState$ErrorCallback.class
  3564 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState$ErrorResponse.class
 10640 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState$HandlerInvoker.class
  1927 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState$HttpChannelSerializedInvoker.class
  3878 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState$InitializedCompositeComplianceViolationListener.class
  1971 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState$InterimCallback.class
  1517 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState$StreamSendState.class
 20772 Mon Jun 05 23:12:48 CDT 2023 org/eclipse/jetty/server/internal/HttpChannelState.class

Notice that none of the files you listed are part of the official build? (esp the lack of $1 in the official jar) Either the web_jar is bad, or the build you made is bad.

The official builds of Jetty are made on Linux, with the Temurin 22.0.1, and Maven 3.9.6. The profile is called eclipse-release and can be found in our pom. https://github.com/jetty/jetty.project/blob/jetty-12.0.10/pom.xml#L2175-L2267

The build script can be found at https://github.com/jetty/jetty.project/blob/jetty-12.0.10/build/scripts/release-jetty.sh

To replicate the official builds you must use JDK 22 (or newer), and Maven 3.9.6 (or newer, but not Maven 4.x), and the eclipse-release profile, and the same compile command line found in the build/scripts/release-jetty.sh.

joakime avatar Aug 05 '24 15:08 joakime

Thank you @joakime , it looks like pipeline is adding this $ values in our build... Web jar is the jar picked from maven central and Ourjar is the one we build it from source.

benson0303 avatar Aug 12 '24 11:08 benson0303