-
Notifications
You must be signed in to change notification settings - Fork 5.2k
CAMEL-23701: Make generated archetype projects more AI-relevant #25409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # AGENTS.md | ||
|
|
||
| Guidance for AI coding assistants working on this project, which was generated from the | ||
| `camel-archetype-api-component` Maven archetype. | ||
|
|
||
| ## Start here | ||
|
|
||
| - Apache Camel LLM index: https://camel.apache.org/llms.txt | ||
| - Any Apache Camel documentation page is available as LLM-friendly Markdown by replacing `.html` with `.md` in its URL. | ||
| - Prefer the Camel CLI and the Camel MCP server (both linked from the index above) to look up components, their endpoint options and the catalog. Do not invent component URIs or options — verify them against the catalog or the documentation. | ||
|
|
||
| ## Project layout | ||
|
|
||
| This is a multi-module project: | ||
|
|
||
| - `*-api` — the Java API that this component proxies. | ||
| - `*-component` — the Camel component generated from that API. | ||
| - `*-component/signatures` — the API signature files consumed by `camel-api-component-maven-plugin`. | ||
|
|
||
| ## Build and test | ||
|
|
||
| - Build: `mvn install` from the project root (the `*-api` module must be built before the `*-component` module). | ||
| - Test: `mvn test` | ||
|
|
||
| ## Conventions | ||
|
|
||
| - The API method proxies and collections are generated at build time by `camel-api-component-maven-plugin` from the API signatures. Do not hand-edit them — change the API or the signature files instead. | ||
| - The endpoint and configuration classes under `*-component/src/main/java` are hand-written: annotate the endpoint with `@UriEndpoint` and its options with `@UriPath`, `@UriParam` and `@Metadata`. | ||
| - Reference: https://camel.apache.org/manual/writing-components.html |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Camel API Component Project | ||
|
|
||
| A custom API-based Apache Camel component generated from the `camel-archetype-api-component` Maven archetype. | ||
|
|
||
| This is a multi-module project: | ||
|
|
||
| - `*-api` — the Java API that the component proxies. | ||
| - `*-component` — the Camel component, generated from that API by `camel-api-component-maven-plugin` | ||
| using the API signatures under `*-component/signatures`. | ||
|
|
||
| ## Build | ||
|
|
||
| mvn install | ||
|
|
||
| ## For AI coding assistants | ||
|
|
||
| See `AGENTS.md` in this directory, and start from the Apache Camel LLM index: | ||
| https://camel.apache.org/llms.txt | ||
|
|
||
| ## More information | ||
|
|
||
| Writing custom components: https://camel.apache.org/manual/writing-components.html |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # AGENTS.md | ||
|
|
||
| Guidance for AI coding assistants working on this project, which was generated from the | ||
| `camel-archetype-component` Maven archetype. | ||
|
|
||
| ## Start here | ||
|
|
||
| - Apache Camel LLM index: https://camel.apache.org/llms.txt | ||
| - Any Apache Camel documentation page is available as LLM-friendly Markdown by replacing `.html` with `.md` in its URL. | ||
| - Prefer the Camel CLI and the Camel MCP server (both linked from the index above) to look up components, their endpoint options and the catalog. Do not invent component URIs or options — verify them against the catalog or the documentation. | ||
|
|
||
| ## Project layout | ||
|
|
||
| - `src/main/java` — the `Component`, `Endpoint`, `Producer` and `Consumer` classes of this component. | ||
| - `src/main/resources/META-INF/services/org/apache/camel/component/<scheme>` — registers the component for its URI scheme. | ||
| - `src/test/java` — tests based on `CamelTestSupport`. | ||
|
|
||
| ## Build and test | ||
|
|
||
| - Build: `mvn install` | ||
| - Test: `mvn test` | ||
|
|
||
| ## Conventions | ||
|
|
||
| - Annotate the endpoint with `@UriEndpoint`, and its options with `@UriPath`, `@UriParam` and `@Metadata`; these annotations drive the generated component metadata and documentation. | ||
| - Keep the file name under `META-INF/services/org/apache/camel/component` in sync with the endpoint scheme. | ||
| - Reference: https://camel.apache.org/manual/writing-components.html |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Camel Component Project | ||
|
|
||
| A custom Apache Camel component generated from the `camel-archetype-component` Maven archetype. | ||
|
|
||
| The component, endpoint, producer and consumer classes are in `src/main/java`, and the component is | ||
| registered for its URI scheme by the file in `src/main/resources/META-INF/services/org/apache/camel/component`. | ||
|
|
||
| ## Build | ||
|
|
||
| mvn install | ||
|
|
||
| ## For AI coding assistants | ||
|
|
||
| See `AGENTS.md` in this directory, and start from the Apache Camel LLM index: | ||
| https://camel.apache.org/llms.txt | ||
|
|
||
| ## More information | ||
|
|
||
| Writing custom components: https://camel.apache.org/manual/writing-components.html |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # AGENTS.md | ||
|
|
||
| Guidance for AI coding assistants working on this project, which was generated from the | ||
| `camel-archetype-dataformat` Maven archetype. | ||
|
|
||
| ## Start here | ||
|
|
||
| - Apache Camel LLM index: https://camel.apache.org/llms.txt | ||
| - Any Apache Camel documentation page is available as LLM-friendly Markdown by replacing `.html` with `.md` in its URL. | ||
| - Prefer the Camel CLI and the Camel MCP server (both linked from the index above) to look up components, their endpoint options and the catalog. Do not invent component URIs or options — verify them against the catalog or the documentation. | ||
|
|
||
| ## Project layout | ||
|
|
||
| - `src/main/java` — the `org.apache.camel.spi.DataFormat` implementation. | ||
| - `src/test/java` — tests based on `CamelTestSupport`. | ||
|
|
||
| ## Build and test | ||
|
|
||
| - Build: `mvn install` | ||
| - Test: `mvn test` | ||
|
|
||
| ## Conventions | ||
|
|
||
| - Implement both `marshal` and `unmarshal`, and stream from the given `InputStream`/`OutputStream` instead of buffering whole messages where possible. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Worth adding the actual registration hook from the generated template: |
||
| - Use the Camel type converters (`exchange.getContext().getTypeConverter()`) rather than casting the body directly. | ||
| - The data format is registered by the `@org.apache.camel.spi.annotations.Dataformat("<scheme>")` annotation on the class; there is no `META-INF/services` file to add. Keep the annotation value and `getDataFormatName()` in sync. | ||
| - Data formats in Camel: https://camel.apache.org/manual/data-format.html | ||
| - Writing the implementation: https://camel.apache.org/manual/writing-components.html | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Camel Data Format Project | ||
|
|
||
| A custom Apache Camel data format generated from the `camel-archetype-dataformat` Maven archetype. | ||
|
|
||
| The data format implementation is in `src/main/java` and implements `org.apache.camel.spi.DataFormat` | ||
| (`marshal` and `unmarshal`). | ||
|
|
||
| ## Build | ||
|
|
||
| mvn install | ||
|
|
||
| ## For AI coding assistants | ||
|
|
||
| See `AGENTS.md` in this directory, and start from the Apache Camel LLM index: | ||
| https://camel.apache.org/llms.txt | ||
|
|
||
| ## More information | ||
|
|
||
| Data formats in Camel: https://camel.apache.org/manual/data-format.html | ||
|
|
||
| Writing the implementation: https://camel.apache.org/manual/writing-components.html |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # AGENTS.md | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test coverage: No automated test validates generated AGENTS.md presence or content. JBang ExportTest already asserts AGENTS.md exists after export (#24063). Archetypes have IT scaffolding under src/test/resources/projects-disabled/ but it is disabled — a minimal smoke IT per archetype would lock this in. |
||
|
|
||
| Guidance for AI coding assistants working on this project, which was generated from the | ||
| `camel-archetype-java` Maven archetype. | ||
|
|
||
| ## Start here | ||
|
|
||
| - Apache Camel LLM index: https://camel.apache.org/llms.txt | ||
| - Any Apache Camel documentation page is available as LLM-friendly Markdown by replacing `.html` with `.md` in its URL. | ||
| - Prefer the Camel CLI and the Camel MCP server (both linked from the index above) to look up components, their endpoint options and the catalog. Do not invent component URIs or options — verify them against the catalog or the documentation. | ||
|
|
||
| ## Project layout | ||
|
|
||
| - `src/main/java/<package>/MyRouteBuilder.java` — the Camel routes. | ||
| - `src/main/java/<package>/MainApp.java` — starts the application via `org.apache.camel.main.Main`. | ||
| - `src/main/resources/log4j2.properties` — logging. | ||
| - `src/data` — sample messages consumed by the generated route. | ||
|
|
||
| ## Build and run | ||
|
|
||
| - Build: `mvn install` | ||
| - Run: `mvn camel:run` | ||
|
|
||
| ## Conventions | ||
|
|
||
| - Add routes as `RouteBuilder` classes and register them on `Main` the same way as `MyRouteBuilder`, with `main.configure().addRoutesBuilder(...)`. This archetype does not scan for routes. | ||
| - Keep endpoint configuration in `pom.xml` dependencies plus route URIs; add a component dependency before using its scheme. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Camel Java Router Project | ||
|
|
||
| A standalone Apache Camel application generated from the `camel-archetype-java` Maven archetype. | ||
| Routes live in `src/main/java/<package>/MyRouteBuilder.java` and are started by | ||
| `src/main/java/<package>/MainApp.java`. | ||
|
|
||
| ## Build | ||
|
|
||
| mvn install | ||
|
|
||
| ## Run | ||
|
|
||
| mvn camel:run | ||
|
|
||
| ## For AI coding assistants | ||
|
|
||
| See `AGENTS.md` in this directory, and start from the Apache Camel LLM index: | ||
| https://camel.apache.org/llms.txt | ||
|
|
||
| ## More information | ||
|
|
||
| Apache Camel documentation: https://camel.apache.org/ |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # AGENTS.md | ||
|
|
||
| Guidance for AI coding assistants working on this project, which was generated from the | ||
| `camel-archetype-main` Maven archetype. | ||
|
|
||
| ## Start here | ||
|
|
||
| - Apache Camel LLM index: https://camel.apache.org/llms.txt | ||
| - Any Apache Camel documentation page is available as LLM-friendly Markdown by replacing `.html` with `.md` in its URL. | ||
| - Prefer the Camel CLI and the Camel MCP server (both linked from the index above) to look up components, their endpoint options and the catalog. Do not invent component URIs or options — verify them against the catalog or the documentation. | ||
|
|
||
| ## Project layout | ||
|
|
||
| - `src/main/java/<package>/MyRouteBuilder.java` — the Camel routes. | ||
| - `src/main/java/<package>/MyApplication.java` — starts the application via `org.apache.camel.main.Main`. | ||
| - `src/main/java/<package>/MyBean.java`, `src/main/java/<package>/MyConfiguration.java` — beans wired by Camel's built-in dependency injection. | ||
| - `src/main/resources/application.properties` — Camel Main configuration. | ||
| - `src/test/java/<package>/MyApplicationTest.java` — test using `CamelMainTestSupport`. | ||
|
|
||
| ## Build and run | ||
|
|
||
| - Build: `mvn install` | ||
| - Run: `mvn camel:run` | ||
| - Test: `mvn test` | ||
|
|
||
| ## Conventions | ||
|
|
||
| - Configure Camel through `application.properties` (`camel.main.*`, `camel.component.*`) rather than in code where possible. | ||
| - Register beans with `@BindToRegistry`, and inject with `@BeanInject` and `@PropertyInject`. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Camel Main | ||
|
|
||
| A standalone Apache Camel application generated from the `camel-archetype-main` Maven archetype, | ||
| running via the built-in `Main` class. | ||
|
|
||
| It also shows how to configure the application with Camel's built-in dependency injection | ||
| (`@BindToRegistry`, `@BeanInject` and `@PropertyInject`), and via `src/main/resources/application.properties`. | ||
|
|
||
| ## Build | ||
|
|
||
| mvn install | ||
|
|
||
| ## Run | ||
|
|
||
| mvn camel:run | ||
|
|
||
| ## For AI coding assistants | ||
|
|
||
| See `AGENTS.md` in this directory, and start from the Apache Camel LLM index: | ||
| https://camel.apache.org/llms.txt | ||
|
|
||
| ## More information | ||
|
|
||
| Apache Camel documentation: https://camel.apache.org/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test coverage: This fileSet fix is exactly the kind of regression automated archetype ITs would catch — before this PR, ReadMe.txt was listed under artifactId-component/ while the file lived at project root, so no readme was generated (reproduced on 4.21.0). Consider adding/re-enabling a build-it archetype IT that asserts README.md and AGENTS.md exist at the generated project root.