Building Camel from Source
Common Requirements
-
About 10Gb of free disk space for the compiled code and local Maven cache.
-
At least 3.5Gb of RAM.
-
A relatively modern operating system (Linux, Windows, macOS, *BSDs).
-
Other operating systems capable of running Java should work too, although that is not tested by the project
-
Prerequisites for Camel 3.x
-
Java 11 (we test using OpenJDK, but any modern JDK should be fine).
-
Apache Maven version 3.8.0 or greater to build the code. You can either use your own Maven package or build using the Maven Wrapper (
mvnw) provided with the project.
Prerequisites for Camel 4.x
-
Java 21 (we test using OpenJDK, but any modern JDK should be fine).
-
Maven Wrapper can be used and is bundled.
-
Apache Maven version 3.9.0 or greater to build the code. You can either use your own Maven package or build using the Maven Wrapper (
mvnw) provided with the project.
Maven
Running the Maven Wrapper mvnw script with -v parameter from the root directory of the project will reveal the recommended Maven version:
./mvnw -v
Apache Maven 1.2.3
Maven home: /home/user/.m2/wrapper/dists/apache-maven-1.2.3-bin/deadbeef/apache-maven-1.2.3
Java version: 21.0.10, vendor: Eclipse Adoptium, runtime: /home/user/java/21.0.10-tem
Default locale: en_IE, platform encoding: UTF-8
OS name: "linux", version: "6.3.7-200.fc38.x86_64", arch: "amd64", family: "unix" If you do not like installing Maven manually, you can keep using mvnw instead of mvn.
| Camel committers and experienced Camel contributors are may also use Maven Daemon |
Maven options
To build Camel maven has to be configured to use more memory, which is done automatically via the .mvn/jvm.config file.
| The build uses the Develocity Maven extension ( If you want incremental local builds to reuse unchanged module outputs, you can opt in to the local build cache by setting the following environment variable (e.g. in your shell profile): With the cache enabled, you can still force a real build of a single run with |
A normal build
Beware this runs all the unit tests which takes many hours.
mvn clean install Building Camel 4
The following command will do a fast build.
mvn clean install -Dquickly | On Camel 4, you can also use |
| On Camel 4, Virtual Threads can only be enabled by compiling with JDK 21 or greater and adding the system property |
The commands above will build Camel in a quick way: skipping build optional artifacts and running tests. In most modern computers, this should complete in at most 30 minutes (usually much less, for newer hardware).
Camel 4.x
Starting with Camel 4.0.0, our build system will automatically verify and format the code when doing a full build or when running certain phases that trigger it (i.e.; when running mvn verify).
Camel 3.x
Apache Camel source code uses a coding style/format that can be verified for compliance using the "checkstyle" plugin.
To enable source style checking, build Camel with the -Psourcecheck profile:
mvn clean install -Psourcecheck Please remember to run this check on your code changes before submitting a patch or GitHub PR. You do not need to run this against the entire project, but only in the modules you modified.
For instance, if you do some code changes in the camel-ftp component, following which you can run the check from within this directory:
cd camel-ftp
mvn clean install -Psourcecheck Checking dependency hygiene
The opt-in -Pdep-check profile leverages pilot:dependencies for bytecode-level detection of used-but-undeclared and unused-but-declared dependencies. It is non-blocking by default (report mode), so it only prints findings without failing the build.
The mojo requires compiled classes and packaged JARs for all reactor modules. Run package -DskipTests first:
# Full reactor — report mode (default, includes test-scope)
./mvnw package -DskipTests -Dlicense.skip eu.maveniverse.maven.plugins:pilot-plugin:0.4.0:dependencies -Pdep-check
# Single module (after a full reactor package)
cd components/camel-ftp
./mvnw eu.maveniverse.maven.plugins:pilot-plugin:0.4.0:dependencies -Pdep-check To fail the build on findings:
./mvnw package -DskipTests -Dlicense.skip eu.maveniverse.maven.plugins:pilot-plugin:0.4.0:dependencies -Pdep-check -Dpilot.action=check CI also runs this check automatically on pull requests targeting main (see the Dependency Analysis workflow).