Apache Camel Upgrade Recipes Repository https://camel.apache.org
  • Java 99.7%
  • Shell 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
jiriOndrusek-agent accc688430
Some checks are pending
ci-build / Build on ubuntu-latest (push) Waiting to run
Sync Spring versions from the Spring Boot BOM with cq:sync-versions
Fixes #138

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 14:45:20 +01:00
.github/workflows Sync Spring versions from the Spring Boot BOM with cq:sync-versions 2026-11-05 14:45:20 +01:00
.mvn/wrapper Added Maven Wrapper 2025-01-24 09:11:01 +01:00
camel-spring-boot-upgrade-recipes Sync Spring versions from the Spring Boot BOM with cq:sync-versions 2026-11-05 14:45:20 +01:00
camel-upgrade-recipes [maven-release-plugin] prepare for next development iteration 2026-11-03 15:31:11 +01:00
release-utils/scripts Fix release script 2025-02-11 14:22:35 +01:00
.asf.yaml Set up default protection ruleset for default and release branches 2026-05-18 11:34:23 +02:00
.gitignore Preparation to camel 4.19.0 and CSB specific recipes 2026-04-27 14:51:55 +02:00
AGENTS.md Fixed links to be applicable to camel-upgrade-recipes 2026-04-14 09:39:39 +02:00
CLAUDE.md Add the Apache Camel AI agent guidelines to camel-upgrade-recipes with a section defining the licensing constraints for recipes to be included in this repository 2026-04-14 09:39:39 +02:00
KEYS Add PGP key for Federico Mariani 2025-06-26 11:27:01 +02:00
LICENSE.txt Initial recipes for migration to Camel 4.0 and 4.4 2024-07-09 14:14:08 +02:00
lombok.config Clean test warnings from OpenRewrite (#16) 2024-12-05 09:50:42 +01:00
mvnw Added Maven Wrapper 2025-01-24 09:11:01 +01:00
mvnw.cmd Added Maven Wrapper 2025-01-24 09:11:01 +01:00
pom.xml [maven-release-plugin] prepare for next development iteration 2026-11-03 15:31:11 +01:00
README.adoc Sync Spring versions from the Spring Boot BOM with cq:sync-versions 2026-11-05 14:45:20 +01:00
RECIPE-CONVENTIONS.md Add Camel 4.23.0 upgrade recipes (#132) 2026-10-21 10:28:17 +02:00
release_notes.adoc Add Camel 4.23.0 upgrade recipes (#132) 2026-10-21 10:28:17 +02:00
rewrite.yml Add Camel 4.22 upgrade recipes 2026-08-25 10:11:38 +02:00

= Apache Camel Update Recipes

This project contains recipes to assist in the migration of Camel projects.

You can find the recipes in the src/main/resources/META-INF/rewrite directory.

The names of the recipes correspond to the Camel version they support, formatted as [major].[minor].yaml. To migrate from version X.Y to version A.B, apply all recipes with versions greater than X.Y and less than A.B.
For example, to migrate from version 3.8 to 4.4, you need to apply the recipes `*4.0.yaml*` and `*4.4.yaml*`.

Special recipes `latest.yaml` and `4.10LTS.yaml` (or other lts version in the future) can be used for migration to the latest version.

== How to run from cmd

To upgrade to the latest version of Camel, you can execute the following script:

```
$ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.apache.camel.upgrade:camel-upgrade-recipes:LATEST -Drewrite.activeRecipes=org.apache.camel.upgrade.CamelMigrationRecipe
```


To upgrade to the latest version of Camel 4.10 (LTS), you can execute the following script:

```
$ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.apache.camel.upgrade:camel-upgrade-recipes:LATEST -Drewrite.activeRecipes=org.apache.camel.upgrade.Camel410LTSMigrationRecipe
```


To upgrade to the latest version of Camel 4.18 (LTS), you can execute the following script:

```
$ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.apache.camel.upgrade:camel-upgrade-recipes:LATEST -Drewrite.activeRecipes=org.apache.camel.upgrade.Camel418LTSMigrationRecipe
```


To upgrade a Camel Spring Boot application to the latest version:

```
$ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.apache.camel.upgrade:camel-spring-boot-upgrade-recipes:LATEST -Drewrite.activeRecipes=org.apache.camel.upgrade.CamelSpringBootMigrationRecipe
```


To upgrade a Camel Spring Boot application to the 4.18 LTS (staying on Spring Boot 3.x):

```
$ mvn -U org.openrewrite.maven:rewrite-maven-plugin:run -Drewrite.recipeArtifactCoordinates=org.apache.camel.upgrade:camel-spring-boot-upgrade-recipes:LATEST -Drewrite.activeRecipes=org.apache.camel.upgrade.CamelSpringBoot418LTSMigrationRecipe
```


To apply specific recipes you can use the following script:

```

$ mvn -U org.openrewrite.maven:rewrite-maven-plugin:6.0.4:run \
-Drewrite.recipeArtifactCoordinates=org.apache.camel.upgrade:camel-upgrade-recipes:4.8.0 \
-DactiveRecipes=org.apache.camel.upgrade.camel44.CamelMigrationRecipe,org.apache.camel.upgrade.camel45.CamelMigrationRecipe
```

[WARNING]
====
This project is not meant for migration of an application based on Camel-Quarkus. Use https://github.com/quarkusio/quarkus/wiki/Migration-Guide-3.0[Quakus migration guide] instead.
====

== JUnit testing

Several migration paths to different versions must be covered by the tests.
Therefore, the project uses the maven-dependency-plugin to download various versions of certain libraries.

Libraries are not packed into the installed jar.

== Test jar

Project installs also test classes into a `test-jar` artifact.
This allows other projects (like https://github.com/quarkusio/quarkus-updates/[quarkus-updates]) to reuse the tests.

== Releasing

This project is released as standard Apache Camel module.

⚠️ Check that release notes are up-to-date!

⚠️ Check that the following versions are up-to-date!
```xml
        <!-- versions for latest recipes, has to be kept aligned to the latest camel release -->
        <camel-latest-version>4.20.0</camel-latest-version>

        <!-- versions for camel-spring-boot -->
        <spring-boot-version>3.5.10</spring-boot-version>
        <springframework-version>6.2.15</springframework-version>

        <!-- Should be aligned to quarkus-updates - https://github.com/quarkusio/quarkus-updates/blob/main/pom.xml#L64 -->
        <rewrite-recipe-bom.version>3.24.0</rewrite-recipe-bom.version>
```

NOTE: The Spring Framework, Security and Batch versions in `camel-spring-boot-upgrade-recipes/pom.xml` are annotated with `@sync` and derived from the matching `spring-boot-dependencies` BOM.
After changing a `spring-boot-*version` property, run `mvn -f camel-spring-boot-upgrade-recipes cq:sync-versions -N` from the repository root and commit the result. CI fails if they are out of sync.

NOTE: The `camel-latest-version` property is automatically verified by the test suite (`LatestCamelVersionTest`) to match the highest version recipe file. If you add a new version recipe (e.g., `4.21.yaml`), the test will fail until you update the property.

Check that everything is alright and run:

```bash
./mvnw release:prepare -Prelease \
  -DreleaseVersion=<CAMEL_UPGRADE_RECIPES_RELEASE_VERSION> \
  -DdevelopmentVersion=<next_snapshot> \
  -Dtag=<CAMEL_UPGRADE_RECIPES_RELEASE_VERSION>
  -Dusername=<asf_username>
  -Dpassword=<asf_password>
```

Then perform the release:

```bash
./mvnw release:perform -Prelease
```

Go to https://repository.apache.org/ and close the staging repository.

A URL will be generated for the repository, like: https://repository.apache.org/content/repositories/orgapachecamel-xxxx. The URL needs to be communicated during the voting process.

Now run:

```bash
cd release-utils/scripts/
./upload-source.sh $CAMEL_UPGRADE_RECIPES_VERSION $CAMEL_UPGRADE_RECIPES_VERSION
```

You'll be requested to insert the password to unlock the secret key to sign the artifacts and after uploading to nexus dev repository.

You could verify the result at the following URL:

https://dist.apache.org/repos/dist/dev/camel/camel-upgrade-recipes/<$CAMEL_UPGRADE_RECIPES_VERSION> 

Send an email to dev mailing list to start the vote.

## Post Release

Once the vote for the release has been completed, you need to send the Vote Result mail to mailing list.

Now, you'll need to release the artifacts from Apache staging repositories to Apache releases repository.

To do this you'll need to access the Apache Nexus Server.

You'll need then to promote the release from dist/dev location to dist/release location.

There is an handy script for this:

Now run:

```bash
cd release-utils/scripts/
./promote-release.sh $CAMEL_UPGRADE_RECIPES_VERSION 
```

When done, release the staging repository.

To do this you'll need to access https://repository.apache.org/#stagingRepositories.
Select proper staging repository and click release.

## Cancelling

If the vote email was already sent, send a cancelling vote email. (https://lists.apache.org/thread/b6dmmjzjsvg3vnkmbyz0xd8bddllsh0m[example])

All changes done during the releasing have to be reverted manually:

* Staging repository has to be dropped in https://repository.apache.org/#stagingRepositories

* Both *tag* and *release* in github have to be deleted

* Project version has to be reverted to the value before the release was started. (example https://github.com/apache/camel-upgrade-recipes/commit/d6db69ed45a39c5e5de31871178d2b74b3c574b9[commit])

* Dev folder (https://dist.apache.org/repos/dist/dev/camel/camel-upgrade-recipes/4.18.0/[example]) has to be deleted via svn. See example commands below.
```bash
export $VERSION=4.18.0

svn checkout 'https://dist.apache.org/repos/dist/dev/camel/camel-upgrade-recipes' camel-upgrade-recipes-dev

# In case you have performed the above step during some release in the past, you need to update your working copy:
cd camel-upgrade-recipes-dev
svn update .

svn remove $VERSION

# Review and commit the changes:
svn diff

# Commit change
svn commit -m "Cleaning cancelled Camel Upgrade Recipes release *$VERSION)"
```

## Applying OpenRewrite best practices

On pull requests, a GitHub Action is run to apply OpenRewrite best practices to the codebase.
To minimize changes, you can run the following command locally to apply the same best practices:

```
mvn -Popenrewrite rewrite:run
```