Skip to content

webjars/webjars-classic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebJars Classic

This is the configuration repository for Classic WebJars. Classic WebJars are created from GitHub releases or NPM packages.

For more information about WebJars visit the website: https://www.webjars.org

Format

Each WebJar is defined by a .properties file. There are two types of configurations:

GitHub-based WebJars

Field Required Description
name Yes Display name of the WebJar
repo Yes GitHub repository in owner/repo format
download No Custom download URL (supports ${version} placeholder). If not specified, uses GitHub release archives.
base.dir No Base directory within the archive to extract (e.g., */dist, package/build/)
requirejs.main No Main file for RequireJS configuration
license.name No License name override. Use this when GitHub's License API can't classify the project's LICENSE file (e.g. it returns NOASSERTION) and you need to publish a specific license name in the POM.
license.url No License URL override. Pairs with license.name; either or both may be set.

Example:

name=Swagger UI
repo=swagger-api/swagger-ui
requirejs.main=swagger-ui
base.dir=*/dist

With custom download URL:

name=Vega-Embed
repo=vega/vega-embed
download=https://registry.npmjs.org/vega-embed/-/vega-embed-${version}.tgz
base.dir=package/build/

NPM-based WebJars

Field Required Description
npm Yes NPM package name
repo No GitHub repository in owner/repo format. Use this when the published package.json lacks a repository field (or when its NPM scope name doesn't match the GitHub org) so the POM gets the correct source URL instead of a 404.
base.dir No Base directory within the NPM tarball to extract (e.g. */dist). Defaults to */ (the whole tarball minus the top-level package/ directory).
license.name No License name (if not auto-detected)
license.url No License URL

Example:

npm=some-npm-package
license.name=MIT
license.url=https://opensource.org/licenses/MIT

Example with repo and base.dir overrides (used when the package.json omits a repository field and only the dist/ directory is wanted):

npm=@tabby_ai/hijri-converter
repo=tabby-ai/hijri-converter
base.dir=*/dist

Testing

Test a WebJar configuration by POSTing the properties file content to the WebJars API:

POST https://www.webjars.org/create/classic?nameOrUrlish=<name>&version=<version>
Content-Type: text/plain

<properties file content>

Parameters

  • <name> - the properties file name without the .properties extension
  • <version> - a valid version from the source (GitHub release tag or NPM version)

Response

  • Success: HTTP 200 with Content-Type: application/java-archive (binary JAR file)
  • Failure: HTTP 400 with Content-Type: text/plain containing an error message

curl Examples

Test Swagger UI (version must match GitHub release tag, e.g., v5.31.0):

curl -X POST "https://www.webjars.org/create/classic?nameOrUrlish=swagger-ui&version=v5.31.0" \
  -H "Content-Type: text/plain" \
  --data-binary @swagger-ui.properties \
  -o swagger-ui.jar

Test HAL Explorer:

curl -X POST "https://www.webjars.org/create/classic?nameOrUrlish=hal-explorer&version=2.2.1" \
  -H "Content-Type: text/plain" \
  --data-binary @hal-explorer.properties \
  -o hal-explorer.jar

AI Agent Validation

To programmatically validate a new properties file:

# Test the configuration
response_code=$(curl -s -X POST \
  "https://www.webjars.org/create/classic?nameOrUrlish=<name>&version=<version>" \
  -H "Content-Type: text/plain" \
  --data-binary @<name>.properties \
  -o /tmp/test.jar \
  -w "%{http_code}")

if [ "$response_code" = "200" ]; then
  echo "Success: WebJar built successfully"
  unzip -l /tmp/test.jar | head -20  # Verify JAR contents
else
  echo "Error: $(cat /tmp/test.jar)"  # Show error message
fi

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors