Skip to main content

Java Configuration

Codeflash stores its configuration inside your existing build file — pom.xml properties for Maven projects, or gradle.properties for Gradle projects. No separate config file is needed.

Maven Configuration

For Maven projects, Codeflash writes properties under the <properties> section of your pom.xml with the codeflash. prefix:

Gradle Configuration

For Gradle projects, Codeflash writes settings to gradle.properties with the codeflash. prefix:
Codeflash auto-detects most settings from your project structure. Running codeflash init will set up the correct config — manual configuration is usually not needed. For standard Maven/Gradle layouts, Codeflash may write no config at all if all defaults are correct.

Auto-Detection

When you run codeflash init, Codeflash inspects your project and auto-detects:

Configuration Options

Only non-default values are written to the config. If your project uses the standard src/main/java and src/test/java layout with the default origin remote, Codeflash may not need to write any config properties at all.

Multi-Module Projects

For multi-module Maven/Gradle projects, run codeflash init from the module you want to optimize. The config is written to that module’s pom.xml or gradle.properties:
For non-standard layouts (like the Aerospike client where source is under client/src/), codeflash init will prompt you to override the detected paths.

Tracer Options

When using codeflash optimize to trace a Java program, these CLI options are available: Example with timeout:

Example

Standard Maven project

Standard layout — no extra config needed. codeflash init detects everything automatically.

Gradle project

Standard layout — no extra config needed. codeflash init detects everything automatically.