Conversation
- Add .cursor/environment.json with maven:3-eclipse-temurin-21 base image - mvn is available by default for module tests (e.g. mvn -pl beans -am test) - Pre-compile step caches dependencies for faster agent startup Co-authored-by: David Pilato <david@pilato.fr>
|
Cursor Agent can help with this pull request. Just |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
.cursor/environment.json
Outdated
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "baseImage": "maven:3-eclipse-temurin-21", | |||
| "install": "mvn -B -DskipTests -DskipIntegTests compile -q" | |||
There was a problem hiding this comment.
Maven compile phase insufficient for multi-module dependency resolution
Medium Severity
The install command uses the compile Maven phase, but this is a multi-module project with 15+ interdependent modules. The compile phase doesn't install module artifacts into the local Maven repository, so when the agent later attempts to run tests on an individual module (e.g., mvn test -pl core), Maven won't find sibling module JARs and the build will fail. The project's own CURSOR.md recommends mvn clean install -DskipIntegTests for this reason. Using install instead of compile as the lifecycle phase would match the project's conventions and actually fulfill the stated goal of enabling test runs.
There was a problem hiding this comment.
Pull request overview
This PR adds a .cursor/environment.json file to configure the Cursor cloud agent's base environment, making Maven and Java 21 (matching the project's CI configuration) available by default. This enables running Java module tests directly within the Cursor agent environment without additional setup.
Changes:
- Adds
.cursor/environment.jsonwithmaven:3-eclipse-temurin-21as the base image - Configures a pre-compilation install step (
mvn -B -DskipTests -DskipIntegTests compile -q) to warm up Maven's dependency cache
.cursor/environment.json
Outdated
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "baseImage": "maven:3-eclipse-temurin-21", | |||
| "install": "mvn -B -DskipTests -DskipIntegTests compile -q" | |||
There was a problem hiding this comment.
The install command runs mvn ... compile -q, which only compiles main sources (src/main/java). However, the PR description states the goal is to "enable running Java module tests directly" and "pre-compile dependencies, speeding up subsequent test runs." To achieve this, the test-compile phase should be used instead of (or in addition to) compile, since test-compile compiles both main and test sources. Without compiling test sources in the install step, subsequent test runs will still need to compile test classes from scratch, reducing the benefit of the pre-compilation step.
| "install": "mvn -B -DskipTests -DskipIntegTests compile -q" | |
| "install": "mvn -B -DskipTests -DskipIntegTests test-compile -q" |
| @@ -0,0 +1,4 @@ | |||
| { | |||
| "baseImage": "maven:3-eclipse-temurin-21", | |||
There was a problem hiding this comment.
The maven:3-eclipse-temurin-21 base image uses a floating/mutable tag. This means the resolved Maven version can change between environment builds as Docker Hub updates the tag (e.g., a new minor or patch Maven release). For reproducibility, consider pinning to a more specific tag such as maven:3.9-eclipse-temurin-21 to lock the Maven major/minor version, or even a fully versioned tag like maven:3.9.9-eclipse-temurin-21.
| "baseImage": "maven:3-eclipse-temurin-21", | |
| "baseImage": "maven:3.9.9-eclipse-temurin-21", |
The compile phase doesn't install module artifacts to the local Maven repository. For this 16-module project with interdependencies, running tests on individual modules (e.g., mvn test -pl core) fails without sibling JARs installed. Matches CURSOR.md recommendation. Co-authored-by: David Pilato <david@pilato.fr>
|





Add Maven to the cloud agent base environment for FSCrawler to enable running Java module tests directly.
This PR configures the cloud agent to use the
maven:3-eclipse-temurin-21base image, ensuring Maven and Java 21 (matching project CI) are available by default. Aninstallstep is included to pre-compile dependencies, speeding up subsequent test runs.