This file provides guidance to agents when working with code in this repository.
This is the Kaoto Camel Catalog Generator - a hybrid Java/TypeScript project that generates comprehensive Apache Camel catalogs for the Kaoto visual integration editor. The project uses Maven to build a Java-based catalog generator JAR, then uses Node.js/Yarn scripts to execute the generator and produce TypeScript type definitions from JSON schemas.
Relationship to Kaoto: This project generates the catalog data consumed by the Kaoto visual editor. When Camel versions are updated here, the Kaoto UI can discover and use new components, EIPs, and Kamelets.
AI agents are welcome contributors to Kaoto Camel Catalog. When contributing code via AI assistance:
- AI agents cannot submit PRs independently
- A human must review, approve, and sign all AI-generated code
- The human reviewer is responsible for:
- Code quality and correctness
- Responding to maintainer feedback
- Following up on PR comments
- Never push to branches you didn't create - If a contributor's PR needs changes, suggest them via review comments, but do not push to their branch without explicit permission
- Use forks - Prefer pushing branches to your fork rather than the main repository to avoid cluttering the branch list with uncleaned branches
- Branch naming - Use descriptive names with issue numbers when possible:
fix/issue-123-catalog-generationorfeat/camel-4.16-support - Branch cleanup - Delete branches after the PR is merged or rejected
- Volume limit - Do not open more than 10 PRs per day per operator to ensure human reviewers can keep up
- Quality over quantity - Fewer well-tested PRs are better than many shallow ones
- Active follow-up required - PRs without response after 2 weeks will be closed
- If you need more time, communicate with maintainers
Before submitting AI-generated PRs:
yarn lint
yarn lint:fix
./mvnw test
yarn build # Ensure full catalog generation works- Ensure all tests pass
- Fix any linter errors
- Verify catalog generation completes successfully
- Test TypeScript type generation works
- Avoid introducing new static code analysis issues: code smells, maintainability regressions, security flows, deprecated code usage
- Changes should aim to preserve or improve overall code quality
- Disclosing AI tool usage is optional but recommended
- Mentioning your AI tool helps us improve AGENTS.md
- If you discover gaps in our agent documentation, please suggest improvements
For complete contribution guidelines, see CONTRIBUTING.md (if available).
# Install dependencies
yarn install
# Full build (Maven JAR + catalog generation + TypeScript types)
yarn build
# Before committing
yarn lint
./mvnw test
yarn build # Verify catalog generation works- Java: 17+
- Node.js: >= 18.x
- Maven: 3.8+ (or use included
./mvnw) - Yarn: 4.x
Verify your setup:
java -version
node -version
./mvnw -version| Task | Command |
|---|---|
| Full build | yarn build |
| Java JAR only | yarn build:mvn or ./mvnw clean package |
| Catalog generation | yarn build:catalog |
| TypeScript types | yarn build:ts |
| Run all tests | ./mvnw test |
| Run specific test | ./mvnw test -Dtest=ClassName |
| Lint check | yarn lint |
| Lint fix | yarn lint:fix |
yarn buildThis runs the complete build pipeline:
- Cleans dist and catalog directories
- Builds the Maven JAR (
./mvnw clean package) - Executes the catalog generator (Java JAR)
- Generates TypeScript type definitions from JSON schemas
- Copies generated catalog to the root
catalog/folder
yarn build:mvn
# or
./mvnw clean packageBuilds the Java catalog generator JAR without running the full pipeline.
yarn build:catalogRuns the Java JAR to generate catalogs (requires JAR to be built first).
yarn build:tsGenerates TypeScript .d.ts files from the JSON schemas in dist/camel-catalog/.
yarn lint # Check for issues
yarn lint:fix # Auto-fix issues./mvnw test # Run all tests
./mvnw test -Dtest=ClassName # Run specific test classThe build process is split into two distinct phases:
-
Java Phase: Maven builds a shaded JAR containing the catalog generator with all dependencies. This JAR is a command-line tool that:
- Loads Apache Camel catalog metadata from Maven dependencies
- Processes Kamelets (Camel connectors) from YAML definitions
- Generates JSON schemas for Camel YAML DSL, CRDs, and XSD schemas
- Produces a catalog index file referencing all generated artifacts
- Main entry point:
io.kaoto.camelcatalog.Main
-
Node.js Phase: Yarn scripts orchestrate post-processing:
- Execute the Java JAR with configured Camel/Kamelets versions (via
scripts/build-catalogs.mjs) - Generate TypeScript type definitions from JSON schemas (via
scripts/json-schema-to-typescript.mjs) - Copy artifacts to the publishable
dist/folder
- Execute the Java JAR with configured Camel/Kamelets versions (via
The catalog generator (CatalogGenerator.java) follows this pipeline:
- Load Camel catalog, Kamelets, Kubernetes schemas, and Camel-K CRDs
- Process Camel YAML DSL schema (JSON Schema Draft-07)
- Generate aggregated catalog JSON files for components, EIPs, and data formats
- Process and aggregate Kamelet definitions
- Generate schemas (YAML DSL, CRDs, XSD)
- Create catalog index file with hash-based filenames for cache-busting
io.kaoto.camelcatalog.generator: Core catalog generation logicCatalogGenerator: Main orchestration classCamelCatalogProcessor: Processes Camel components and patternsCamelYamlDslSchemaProcessor: Handles YAML DSL schema processingKameletProcessor: Processes Kamelet YAML definitions
io.kaoto.camelcatalog.generators: Specific generators for different catalog typesComponentGenerator,EIPGenerator: Generate component and EIP catalogsCRDGenerator: Generates Kubernetes CRD schemasSchemasGenerator: Aggregates all schema generation
io.kaoto.camelcatalog.model: Data model classes (serialized to JSON, TypeScript types auto-generated)io.kaoto.camelcatalog.maven: Maven catalog version loading and resource managementKaotoMavenVersionManager: Downloads and manages versioned Maven artifactsResourceLoader: Loads resources from JARs and local filesystemCamelCatalogVersionLoader: Coordinates loading of all Camel artifacts for a specific version
Camel runtime versions are defined in index.js:
CATALOGS.Main: Apache Camel versions (community + Red Hat)CATALOGS.Quarkus: Camel Quarkus versionsCATALOGS.SpringBoot: Camel Spring Boot versionsKAMELETS_VERSION: Kamelets version
To update Camel versions:
- Modify
pom.xmlproperties (version.camel,version.camel.quarkus, etc.) - Update
index.jsCATALOGS arrays if adding/removing runtime versions - Run
yarn buildto regenerate all catalogs
Always run before opening PRs:
yarn lint # Check code style
yarn lint:fix # Fix auto-fixable issues
./mvnw test # Run Java tests
yarn build # Verify full build works
git add catalog # Commit generated catalogs (required!)When updating to a new Camel version:
-
Update
pom.xml:<version.camel>for main Camel version<version.camel.quarkus>for Quarkus<version.camel-kamelets>for Kamelets
-
Update
index.js:- Add new version to appropriate CATALOGS array (Main/Quarkus/SpringBoot)
- Update
KAMELETS_VERSIONif changed
-
Rebuild and commit catalog changes:
yarn build git add catalog pom.xml index.js git commit -m "feat(catalog): Update Camel runtime to X.Y.Z"
The CI workflow (build-publish.yml) enforces that generated catalog files in catalog/ must be committed. After running yarn build, always commit the changes to catalog/:
yarn build
git add catalog
git commit -m "chore: update generated catalog"This ensures the npm package includes pre-built catalogs without requiring consumers to run the Java build.
# Run all tests
./mvnw test
# Run specific test class
./mvnw test -Dtest=MainTest
# Run specific test method
./mvnw test -Dtest=CatalogGeneratorTest#testGenerateCatalog
# Test catalog generation without full build
./mvnw clean package -DskipTests
java -jar target/catalog-generator-0.0.1-SNAPSHOT.jar \
-o ./test-output \
-n "Test Catalog" \
-k 4.15.0 \
-m 4.15.0 \
-q 3.27.0 \
-s 4.14.1To test catalog generation for a specific runtime:
# Build JAR first
./mvnw clean package
# Generate Quarkus catalog only
yarn build:catalog -- --runtime quarkus --version 3.27.0
# Generate Main runtime catalog
yarn build:catalog -- --runtime main --version 4.15.0-
Update
pom.xml:<version.camel>4.16.0</version.camel>
-
Update
index.js:CATALOGS.Main = [ // ... existing versions { name: 'Apache Camel 4.16.0', version: '4.16.0', runtime: 'Main' } ]
-
Build and test:
yarn build ./mvnw test -
Verify catalog was generated:
ls -la catalog/Main/4.16.0/
-
Check if component exists in upstream Camel:
# Search in target directory after build grep -r "component-name" target/
-
Run generator with verbose output:
java -jar target/catalog-generator-*.jar --debug -o ./debug-output ... -
Check generated catalog JSON:
cat dist/camel-catalog/Main/4.15.0/camel-catalog-*.json | jq '.components'
-
Ensure Java build completed:
ls -la target/catalog-generator-*.jar -
Ensure catalogs were generated:
ls -la dist/camel-catalog/
-
Run TypeScript generation separately:
yarn build:ts
-
Check for JSON schema validation errors in the output
If CI fails with uncommitted changes:
- Run
yarn buildlocally - Commit the changes to the
catalog/folder - Push the updated catalog files
This project requires Java 17+. Verify with:
java -version
./mvnw -versionIf Maven cannot resolve Camel artifacts:
- Check your internet connection
- Verify the version exists in Maven Central or Red Hat repositories
- Try clearing Maven cache:
rm -rf ~/.m2/repository/org/apache/camel ./mvnw clean package
Ensure the Java JAR has been built and catalogs generated before running yarn build:ts. The TypeScript generator depends on JSON schema files in dist/camel-catalog/.
The catalog generator downloads many Maven artifacts. First build may take 5-10 minutes. Subsequent builds are faster due to Maven cache.
The project uses Lerna for version management and NPM publishing:
yarn publishThis is automated on the main branch via GitHub Actions (.github/workflows/build-publish.yml).
For deep technical details on the following topics, see the sections below. Most developers won't need this level of detail for typical contributions.
Maven Artifact Loading and Resource Management (click to expand)
The project uses a dynamic Maven artifact resolution system to load versioned Camel catalogs at runtime without requiring them to be compile-time dependencies. This allows generating catalogs for multiple Camel versions from a single JAR.
KaotoMavenVersionManager extends Apache Camel's MavenVersionManager and provides:
- Dynamic Artifact Resolution: Downloads Maven artifacts (JARs) from remote repositories at runtime
- Transitive Dependency Support: Unlike the base class, this resolves transitive dependencies needed for Quarkus and Spring Boot runtime providers
- Custom ClassLoader: Uses
KaotoOpenURLClassLoaderto dynamically add downloaded JARs to the classpath - Repository Configuration: Automatically configures Maven Central and Red Hat GA repositories based on version string (detects
-redhatsuffix) - Version-Aware Resource Loading: Ensures resources are loaded from the correct version when multiple Camel versions are on the classpath
Example artifact resolution (from CamelCatalogVersionLoader.java:252):
// Downloads org.apache.camel.quarkus:camel-quarkus-catalog:3.27.0 and all dependencies
camelCatalog.loadRuntimeProviderVersion("org.apache.camel.quarkus",
"camel-quarkus-catalog",
"3.27.0");This internally calls KaotoMavenVersionManager.resolve() which:
- Uses
MavenDownloaderto fetch the artifact from configured repositories - Resolves transitive dependencies
- Adds all JAR files to the custom URLClassLoader
- Makes resources from those JARs available for loading
ResourceLoader provides utilities to extract resources from the dynamically loaded JARs:
- Single Resource Loading (
getResourceAsString): Loads individual files likecamel-yaml-dsl.jsonfrom the classpath - Bulk Folder Loading (
loadResourcesFromFolderAsString): Loads all files with a specific suffix from a folder in JARs or filesystem- Example: Load all
.kamelet.yamlfiles from thekamelets/folder inside the kamelets JAR - Handles both JAR protocol (
jar:file:) and file protocol (file:) resources - Returns a map of filename → content for processing
- Example: Load all
How ResourceLoader handles JAR vs filesystem:
- For JAR resources: Uses
JarURLConnectionto iterateJarEntryobjects and extract matching files - For file resources: Uses
Files.walk()to traverse directory structure (useful during development)
CamelCatalogVersionLoader orchestrates loading all Camel artifacts for a specific version and runtime:
Loading sequence (typically called from CatalogGenerator.java):
-
Load Camel Catalog (
loadCamelCatalog):- Determines Maven coordinates based on runtime (Main/Quarkus/SpringBoot)
- Downloads catalog artifact:
camel-catalog,camel-quarkus-catalog, orcamel-catalog-provider-springboot - Configures runtime provider (QuarkusRuntimeProvider, SpringBootRuntimeProvider, etc.)
-
Load Camel YAML DSL (
loadCamelYamlDsl):- Downloads YAML DSL artifact:
camel-yaml-dsl,camel-quarkus-yaml-dsl, orcamel-yaml-dsl-starter - Extracts
camel-yaml-dsl.jsonschema file using version-aware loading
- Downloads YAML DSL artifact:
-
Load Kamelets (
loadKamelets):- Downloads
org.apache.camel.kamelets:camel-kamelets:VERSION - Uses ResourceLoader to bulk-load all
.kamelet.yamlfiles from thekamelets/folder
- Downloads
-
Load Kamelet Boundaries (
loadKameletBoundaries):- Loads built-in kamelet boundary definitions from local resources
-
Load Kubernetes Schema (
loadKubernetesSchema):- Fetches Kubernetes OpenAPI schema directly from GitHub
-
Load Camel-K CRDs (
loadCamelKCRDs):- Downloads
org.apache.camel.k:camel-k-crds:VERSION - Extracts specific CRD YAML files (Integration, Pipe, Kamelet, etc.)
- Downloads
-
Load Local Schemas & Patterns:
- Loads JSON schemas and Kaoto-specific patterns from local classpath resources
Complete Flow: Version to Catalog Generation (click to expand)
Here's the complete flow from specifying a Camel version to generating Kaoto catalogs:
-
User invokes build (
yarn build)- Executes
scripts/build-catalogs.mjs - Calls Java JAR with version parameters from
index.js
- Executes
-
Java Main class (
io.kaoto.camelcatalog.Main)- Parses CLI arguments (catalog version, kamelets version, output directory, etc.)
- Creates
GenerateCommandwith configuration
-
GenerateCommand.run()
- For each catalog version configuration:
- Creates
CatalogGeneratorBuilder - Specifies runtime (Main/Quarkus/SpringBoot) and versions
- Creates
- For each catalog version configuration:
-
CatalogGeneratorBuilder.build()
- Instantiates
CamelCatalogVersionLoaderwith runtime - Creates
KaotoMavenVersionManagerwith custom URLClassLoader - Creates
ResourceLoaderwrapping the version manager - Returns configured
CatalogGenerator
- Instantiates
-
CatalogGenerator.generate()
- Calls
CamelCatalogVersionLoadermethods to load all artifacts:- Downloads Camel catalog JARs via Maven
- Downloads YAML DSL JARs
- Downloads Kamelets JAR
- Downloads CRDs JAR
- Fetches Kubernetes schema
- All resources now available in custom classloader
- Calls
-
Process and aggregate (via processors):
CamelCatalogProcessor: Extracts component/EIP metadata from loaded catalogCamelYamlDslSchemaProcessor: Processes YAML DSL JSON schemaKameletProcessor: Parses and aggregates all Kamelet YAML definitions- Various generators create output JSON files
-
Write output
- Generates catalog JSON files (components, EIPs, patterns, etc.)
- Generates schemas (YAML DSL, CRDs, XSD)
- Creates catalog index with hash-based filenames
- Writes to
dist/camel-catalog/<runtime>/<version>/
-
Post-processing (back in Node.js)
scripts/json-schema-to-typescript.mjsgenerates TypeScript definitions- Files copied to
catalog/for npm distribution
Key insight: This architecture allows the generator to produce catalogs for any Camel version without modifying the JAR's compile-time dependencies. The version manager downloads the exact artifacts for each requested version, loads them into an isolated classloader, and extracts all necessary metadata dynamically.
camel-catalog/
├── src/
│ └── main/java/io/kaoto/camelcatalog/
│ ├── generator/ # Core catalog generation logic
│ ├── generators/ # Specific generators (Component, EIP, CRD, etc.)
│ ├── maven/ # Maven artifact loading and resource management
│ ├── model/ # Data model classes (→ JSON → TypeScript)
│ └── Main.java # CLI entry point
├── scripts/
│ ├── build-catalogs.mjs # Orchestrates Java JAR execution
│ └── json-schema-to-typescript.mjs # TypeScript type generation
├── catalog/ # Generated catalogs (committed to repo)
├── dist/ # Build output (not committed)
├── target/ # Maven build output
├── pom.xml # Maven configuration
├── index.js # Version configuration
└── package.json # Node.js/Yarn configuration
- Java: Standard Java code style, enforced by Maven Checkstyle (if configured)
- JavaScript/TypeScript: Prettier + ESLint
- Prettier: semicolons required, single quotes, width 120, 2-space indent, trailing commas
- Kaoto Main Repository - The visual editor that consumes these catalogs
- Apache Camel Documentation - Upstream Camel documentation
- Kamelets Catalog - Kamelet connector documentation