You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Purpose**: Configure JMH (Java Microbenchmark Harness) profile for performance benchmarking with proper source directories and build configuration.
1552
+
1553
+
**Dependencies**: Only execute if user selected "JMH" in Step 3. Requires completion of core plugin steps (3, 4, 5).
1554
+
1555
+
**CRITICAL PRESERVATION RULE**: Only ADD this profile if it doesn't already exist. Never REPLACE or REMOVE existing profiles.
1556
+
1557
+
**CRITICAL PREREQUISITE**: This step requires the project to be a single-module Maven project. Multi-module projects are not supported for JMH integration.
1558
+
1559
+
## Pre-Implementation Checks
1560
+
1561
+
**BEFORE adding JMH profile, perform these mandatory checks:**
1562
+
1563
+
1. **Check for multi-module configuration**: Scan pom.xml for `<modules>` section
1564
+
1565
+
If `<modules>` section exists: **STOP IMMEDIATELY** and inform user: "JMH profile cannot be added to multi-module Maven projects. JMH requires a single-module project structure for proper benchmark execution. Please configure JMH in individual modules instead."
1566
+
1567
+
2. **Check for existing JMH profile**:
1568
+
1569
+
If `<profiles>` section with `jmh` profile already exists: Ask user "JMH profile already exists. Do you want to enhance the existing configuration? (y/n)"
1570
+
1571
+
If user says "n": Skip this step entirely.
1572
+
If user says "y": Proceed with adding missing configuration elements only.
1573
+
1574
+
**CONDITIONAL EXECUTION**: Only execute this step if user selected "JMH" in Step 3 AND project is single-module.
1575
+
1576
+
## JMH Profile Configuration
1577
+
1578
+
**ADD this profile to the `<profiles>` section in pom.xml ONLY if it doesn't already exist:**
Copy file name to clipboardExpand all lines: CURSOR-RULES-JAVA.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,6 +41,7 @@ Use the following set of Java Cursor Rules to improve your Java development.
41
41
|[141-java-refactoring-with-modern-features](.cursor/rules/141-java-refactoring-with-modern-features.mdc)| Add Modern Java Features in your development |**Prompt:**`Review my code for using modern Java features showing several alternatives thanks to the cursor rule @141-java-refactoring-with-modern-features`**Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Interactive cursor rule. |
42
42
|[142-java-functional-programming](.cursor/rules/142-java-functional-programming.mdc)| Add Functional Programming style in your development |**Prompt:**`Review my code for using functional programming showing several alternatives thanks to the cursor rule @142-java-functional-programming`**Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Interactive cursor rule. |
43
43
|[143-java-data-oriented-programming](.cursor/rules/143-java-data-oriented-programming.mdc)| Add Data Oriented Programmin in your development |**Prompt:**`Review my code for using data oriented programming showing several alternatives thanks to the cursor rule @143-java-data-oriented-programming`**Note:** Add a class or package which consider that it could bye improved by the cursor rule. | Interactive cursor rule. |
44
+
| - | Improve a Java class method using results from a JMH analysis | Add JMH support using the cursor rule `@112-java-maven-plugins` (For Maven projects without modules). In Order to design a JMH Benchmark use the following User prompt: `Can you create a JMH benchmark in order to know what is the best implementation?` and add in the context the Java class that you want to benchmark. Once you execute the Benchmark and you have generated the JSON file, you can analyze the results with: `Can you explain the JMH results and advice about the best implementation?` Add in the context the JMH report in JSON format **Note:**| Interactive rule & User prompts |
44
45
45
46
## Performance rule (Jmeter)
46
47
@@ -61,7 +62,7 @@ Use the following set of Java Cursor Rules to improve your Java development.
61
62
62
63
| Activity | Description | Prompt | Notes |
63
64
|----|----|-----|----|
64
-
|[170-java-documentation](.cursor/rules/170-java-documentation.mdc)| Generate Java project documentation & diagrams including README.md and package-info.java files using a modular step-based approach |**Prompt:**`Generate technical documentation & diagrams about the project with the cursor rule @170-java-documentation.mdc and software located in YOUR_DIRECTORY`**Note:** The rule will analyze existing documentation and ask for user preferences before generating anything. Ensures project validation with Maven before proceeding. | Interactive cursor rule with 6 modular steps: 1) Existing documentation analysis and preservation, 2) Project structure analysis, 3) Documentation preferences assessment, 4) README.md generation, 5) package-info.java generation, 6) Validation and summary. Preserves existing documentation and creates backups when needed. |
65
+
|[170-java-documentation](.cursor/rules/170-java-documentation.mdc)| Generate Java project documentation & diagrams including README.md and package-info.java files using a modular step-based approach |**Prompt:**`Generate technical documentation & diagrams about the project with the cursor rule @170-java-documentation.mdc`**Note:**Add in the context the folder to generate the documentation. The rule will analyze existing documentation and ask for user preferences before generating anything. Ensures project validation with Maven before proceeding. | Interactive cursor rule. |
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ With this structure in mind, the project uses an XML Schema to define the way th
52
52
53
53
## Cursor Rules
54
54
55
-
Read the generated list of cursor rules for Java [here](./CURSOR-RULES-JAVA.md). The set of cursor rules covers aspects like `Build system based on Maven`, `Design`, `Coding`, `Testing`, `Refactoring`, `Performance testing with JMeter`, `Profiling with Async profiler, jps, jstack, jcmd & jstat` & `Documentation`.
55
+
Read the generated list of cursor rules for Java [here](./CURSOR-RULES-JAVA.md). The set of cursor rules covers aspects like `Build system based on Maven`, `Design`, `Coding`, `Testing`, `Refactoring & JMH Benchmarking`, `Performance testing with JMeter`, `Profiling with tools like Async profiler, jps, jstack, jcmd & jstat` & `Documentation`.
0 commit comments