diff --git a/.github/workflows/publish-site.yml b/.github/workflows/publish-site.yml index 2a311df..ab86690 100644 --- a/.github/workflows/publish-site.yml +++ b/.github/workflows/publish-site.yml @@ -27,7 +27,7 @@ jobs: - name: Install Node.js uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' - name: Install Java uses: actions/setup-java@v4 with: @@ -49,8 +49,8 @@ jobs: # must set ANTORA_CACHE_DIR so Maven will put jetty home where Antora Collector won't delete it ANTORA_CACHE_DIR: ${{ github.workspace }}/.cache/antora run: | - npm --audit=false --fund=false --omit=optional --package-lock=false i - npx --offline antora --stacktrace --extension @antora/collector-extension --extension @antora/lunr-extension --html-url-extension-style=indexify --log-failure-level=error antora-playbook.yml + npm --audit false --fund false --omit optional --package-lock false i + npx --offline antora --stacktrace --extension @antora/collector-extension --extension @antora/lunr-extension --extension jetty-downloads --html-url-extension-style indexify --log-failure-level error antora-playbook.yml - name: Upload Artifact uses: actions/upload-pages-artifact@v3 - name: Deploy Artifact to GitHub Pages diff --git a/antora-playbook.yml b/antora-playbook.yml index ba224d3..50ed3f5 100644 --- a/antora-playbook.yml +++ b/antora-playbook.yml @@ -8,15 +8,19 @@ # # to run the full production build, start by installing all the required dependencies: # -# npm i --package-lock=false +# npm i --package-lock false # # then use: # -# ANTORA_CACHE_DIR=$PWD/.cache/antora npx --offline antora --extension @antora/collector-extension --extension @antora/lunr-extension antora-playbook.yml +# ANTORA_CACHE_DIR=$PWD/.cache/antora npx --offline antora --extension @antora/collector-extension --extension @antora/lunr-extension --extension jetty-downloads-extension antora-playbook.yml antora: extensions: - ./lib/register-asciidoctor-kroki-extension.js - ./lib/component-url-prefix-extension.js + - id: jetty-downloads-extension + require: ./lib/jetty-downloads-extension.js + enabled: false + last_eol_version: 11 site: title: Eclipse Jetty url: https://jetty.org diff --git a/home/modules/ROOT/pages/download.adoc b/home/modules/ROOT/pages/download.adoc index b5a953c..a5a3108 100644 --- a/home/modules/ROOT/pages/download.adoc +++ b/home/modules/ROOT/pages/download.adoc @@ -1,4 +1,192 @@ = Jetty Downloads The latest releases of Eclipse Jetty are listed below. -You can find earlier releases in Maven Central. +You can find earlier releases by browsing https://repo1.maven.org/maven2/org/eclipse/jetty[Maven Central]. + +[%header,grid=rows] +|=== +|Release 2+|Assets |Links +ifdef::site-gen-antora[] + +include::partial$jetty-downloads.adoc[] +endif::[] +|=== + +NOTE: Release notes can be found in the [.path]_VERSION.txt_ file included with the distribution and on the https://github.com/jetty/jetty.project/releases[GitHub Releases] page for the Jetty project. + +Release notes are also made available on the jetty-announce@eclipse.org mailing list. + +== What Version Do I Use? + +Jetty 12 is the only community supported versions of Jetty at this point in time, and has a great many improvements over previous releases. + +While many people continue to use older versions of Jetty like 11/10/9 for a variety of reasons, we recommend using Jetty 12 + +Note that Jetty 12 is the only version that will receive support for the open source community, and represents the version of Jetty that we will actively maintain and improve over the next few years. + +January 1st, 2024 marks the end of community support for the Jetty 11 and older releases. + +== Version History + +[cols=1;1;1;1;1;1;1;3] +|=== +|Version |Years |Home |Min{nbsp}JVM |Servlet |JSP |Status |Protocols + +|12 +|2023- +|Eclipse +|17 footnote:jpms[JPMS module support is optional.] +|3.1 4.0 5.0 6.0 +|2.3 3.0 3.1 +|*Stable* +|HTTP/1.1 (RFC 7230), HTTP/2 (RFC 7540), WebSocket (RFC 6455, JSR 356), FastCGI, *JakartaEE Namespace* footnote:jakarta[Due to Oracle's ownership of the "`Java`" trademark, usage of the javax.{asterisk} namespace has been restricted and the jakarta.{asterisk} namespace was adopted by the Eclipse Foundation.], JavaEE Namespace footnote:javaee[Only for Java EE 8 (Servlet 4.0, JSP 2.3) support, using the javax.{asterisk} namespace.] + +|11 +|2020- +|Eclipse +|11 footnote:jpms[] +|5.0 +|3.0 +|*Stable https://github.com/jetty/jetty.project/issues/10485[(Notice)]* +|HTTP/1.1 (RFC 7230), HTTP/2 (RFC 7540), WebSocket (RFC 6455, JSR 356), FastCGI, *JakartaEE Namespace* footnote:jakarta[] + +|10 +|2020- +|Eclipse +|11 footnote:jpms[] +|4.0 +|2.3 +|*Stable https://github.com/jetty/jetty.project/issues/10485[(Notice)]* +|HTTP/1.1 (RFC 7230), HTTP/2 (RFC 7540), WebSocket (RFC 6455, JSR 356), FastCGI + +|9.4 +|2016- +|Eclipse +|1.8 +|3.1 +|2.3 +|Stable https://github.com/jetty/jetty.project/issues/7958[(Notice)] +|HTTP/1.1 (RFC 7230), HTTP/2 (RFC 7540), WebSocket (RFC 6455, JSR 356), FastCGI + +|9.3 +|2015-2020 +|Eclipse +|1.8 footnote:jdk9[JDK9 and newer is not supported if using MultiRelease JAR Files, or Bytecode / Annotation scanning.] +|3.1 +|2.3 +|Deprecated +|HTTP/1.1 (RFC 7230), HTTP/2 (RFC 7540), WebSocket (RFC 6455, JSR 356), FastCGI + +|9.2 +|2014-2018 +|Eclipse +|1.7 footnote:jdk9[] +|3.1 +|2.3 +|Deprecated +|HTTP/1.1 (RFC 2616), javax.websocket, SPDY v3 + +|9.1 +|2013-2014 +|Eclipse +|1.7 footnote:jdk9[] +|3.1 +|2.3 +|Deprecated +|HTTP/1.1 (RFC 2616) + +|9.0 +|2013-2013 +|Eclipse +|1.7 footnote:jdk9[] +|3.1-beta +|2.3 +|Deprecated +|HTTP/1.1 (RFC 2616) + +|8 +|2009-2014 +|Eclipse / Codehaus +|1.6 footnote:jdk9[] +|3.0 +|2.2 +|Venerable +|HTTP/1.1 (RFC 2616), WebSocket RFC 6455, SPDY v3 + +|7 +|2008-2014 +|Eclipse / Codehaus +|1.5 +|2.5 +|2.1 +|Venerable +|HTTP/1.1 (RFC 2616), WebSocket RFC 6455, SPDY v3 + +|6 +|2006-2010 +|Codehaus +|1.4-1.5 +|2.5 +|2.0 +|Antique +|HTTP/1.1 (RFC 2616) + +|5 +|2003-2009 +|Sourceforge +|1.2-1.5 +|2.4 +|2.0 +|Relic +|HTTP/1.1 (RFC 2616) + +|4 +|2001-2006 +|Sourceforge +|1.2, J2ME +|2.3 +|1.2 +|Ancient +|HTTP/1.1 (RFC 2616) + +|3 +|1999-2002 +|Sourceforge +|1.2 +|2.2 +|1.1 +|Fossilized +|HTTP/1.1 (RFC 2068) + +|2 +|1998-2000 +|Mortbay +|1.1 +|2.1 +|1.0 +|Legendary +|HTTP/1.0 (RFC 1945) + +|1 +|1995-1998 +|Mortbay +|1.0 +|- +|- +|Mythical +|HTTP/1.0 (RFC 1945) +|=== + +== Prior Versions + +//The most recent versions of prior Jetty releases can be found here, with their associated documentation. + +The canonical repository for Jetty is Maven Central. +//All releases are always available there first and this download page may lag a bit update wise as post release resources are put into place. +You can browse for all Jetty releases https://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution[here]. + +== Jetty P2 Provisioning + +This provisioning address is not for general use and are provided strictly for OSGI users. + +* Composite Jetty 9 P2 Provisioning: http://download.eclipse.org/jetty/updates/jetty-bundles-9.x diff --git a/home/modules/ROOT/partials/jetty-downloads.adoc b/home/modules/ROOT/partials/jetty-downloads.adoc new file mode 100644 index 0000000..e69de29 diff --git a/lib/jetty-downloads-extension.js b/lib/jetty-downloads-extension.js new file mode 100644 index 0000000..136e4e4 --- /dev/null +++ b/lib/jetty-downloads-extension.js @@ -0,0 +1,72 @@ +'use strict' + +const MAVEN_REPO_URL = 'https://repo1.maven.org/maven2' +const JAVADOC_ROOT_URL = 'https://eclipse.dev/jetty/javadoc' +const REPOSITORY = 'jetty/jetty.project' +const GROUP_ID = 'org.eclipse.jetty' +const ARTIFACT_ID = 'jetty-home' + +module.exports.register = function ({ config }) { + const { firstMajorVersion = 9, lastEolVersion, lastMajorVersion } = config + this.once('contentClassified', async ({ contentCatalog }) => { + const { Octokit } = this.require('@octokit/rest') + const octokit = new Octokit() + const [owner, repo] = REPOSITORY.split('/') + const releases = await collectLatestReleases({ octokit, owner, repo, firstMajorVersion, lastMajorVersion }) + const majorVersions = Object.keys(releases).sort((a, b) => b.localeCompare(a, 'en', { numeric: true })).map(Number) + const rows = [] + for (const majorVersion of majorVersions) { + const release = releases[majorVersion] + const cells = [] + cells.push(lastEolVersion && majorVersion <= lastEolVersion ? `${release.version} (EOL)` : release.version) + cells.push(`${release.zip}[.zip${release.zipHash ? ',title=' + release.zipHash + ' (sha1)' : ''}]`) + cells.push(`${release.tgz}[.tgz${release.tgzHash ? ',title=' + release.tgzHash + ' (sha1)' : ''}]`) + cells.push(`${release.url}[Release Notes] / ${release.api}[API Docs]`) + rows.push(cells.map((it) => '|' + it).join(' ')) + } + const partial = contentCatalog.resolveResource('ROOT::partial$jetty-downloads.adoc') + partial.contents = Buffer.from(rows.map((it) => '\n\n' + it).join('')) + }) +} + +function collectLatestReleases ({ octokit, owner, repo, firstMajorVersion, lastMajorVersion, page = 1, accum = {} }) { + return octokit.repos.listReleases({ owner, repo, page, per_page: 50 }).then(async (result) => { + for (const release of result.data) { + if (release.draft || release.prerelease) continue + const version = release.name + const majorVersion = Number(version.split('.')[0]) + if (majorVersion in accum || majorVersion < firstMajorVersion) continue + const groupId = GROUP_ID + const artifactId = majorVersion < 10 ? 'jetty-distribution' : ARTIFACT_ID + const distBaseUrl = `${MAVEN_REPO_URL}/${groupId.replace(/[.]/g, '/')}/${artifactId}/${version}/${artifactId}-${version}` + const tgz = `${distBaseUrl}.tar.gz` + const tgzHash = await fetch(`${tgz}.sha1`).then((response) => response.text(), () => undefined) + if (!tgzHash) continue // not yet available in the Maven repo + const zip = `${distBaseUrl}.zip` + const zipHash = await fetch(`${zip}.sha1`).then((response) => response.text(), () => undefined) + if (!zipHash) continue // not yet available in the Maven repo + accum[majorVersion] = { + version: release.name, + date: release.created_at, + tgz, + tgzHash, + zip, + zipHash, + url: release.html_url, + api: `${JAVADOC_ROOT_URL}/jetty-${majorVersion}/index.html?overview-summary.html`, + } + } + if (lastMajorVersion && createRange(firstMajorVersion, lastMajorVersion).every((it) => it in accum)) return accum + const links = result.headers.link + if (links && links.includes('; rel="next"')) { + return collectLatestReleases({ octokit, owner, repo, firstMajorVersion, lastMajorVersion, page: page + 1, accum }) + } + return accum + }) +} + +function createRange (from, to) { + const result = [] + for (let i = from; i <= to; i++) result.push(i) + return result +} diff --git a/package.json b/package.json index b00ca0b..f91347a 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,8 @@ "antora": "latest", "@antora/collector-extension": "latest", "@antora/lunr-extension": "latest", - "asciidoctor-kroki": "latest" + "asciidoctor-kroki": "latest", + "@octokit/rest": "~20.0" }, "overrides": { "vinyl-fs": {