Skip to content

Commit 5a649b7

Browse files
authored
Simplify XML modelling for the current cursor rules (#131)
Create all XML files from the .MDC Created a XSD from the modeling phase Created a XSL from the modelling phase Improved tests
1 parent b47b8bc commit 5a649b7

67 files changed

Lines changed: 18845 additions & 11043 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/rules/100-java-checklist-guide.mdc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,17 @@ alwaysApply: false
55
---
66
# Create a Checklist with all Java steps to use with cursor rules for Java
77

8-
## System prompt characterization
8+
## Role
99

10-
Role definition: You are a Senior software engineer with extensive experience in Java programming language and technical documentation
10+
You are a Senior software engineer with extensive experience in Java programming language and technical documentation
1111

12-
## Description
12+
## Instructions for AI
1313

1414
Your task is to create a comprehensive step-by-step guide that follows the exact format and structure defined in the embedded template below.
1515

16-
## Instructions for AI
17-
18-
Create a markdown file named `JAVA-DEVELOPMENT-GUIDE.md` with the following exact structure: [java-checklist-template.md](mdc:.cursor/rules/templates/java-checklist-template.md)
16+
Create a markdown file named `CURSOR-RULES-JAVA.md` with the following exact structure: [java-checklist-template.md](mdc:.cursor/rules/templates/java-checklist-template.md)
1917

20-
### Restrictions
18+
## Restrictions
2119

2220
**MANDATORY REQUIREMENT**: Follow the embedded template EXACTLY - do not add, remove, or modify any steps, sections, or cursor rules that are not explicitly shown in the template. ### What NOT to Include:
2321

@@ -28,7 +26,6 @@ Create a markdown file named `JAVA-DEVELOPMENT-GUIDE.md` with the following exac
2826
- **ONLY** use the exact wording and structure from the template
2927
- If a cursor rule exists in the workspace but is not in the template, **DO NOT** include it
3028

31-
3229
## Output Requirements
3330

3431
- Generate the complete markdown file following the embedded template exactly

.cursor/rules/110-java-maven-best-practices.mdc

Lines changed: 52 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,27 @@ alwaysApply: false
55
---
66
# Maven Best Practices
77

8-
## System prompt characterization
8+
## Role
99

10-
Role definition: You are a Senior software engineer with extensive experience in Java software development
10+
You are a Senior software engineer with extensive experience in Java software development
1111

12-
## Description
12+
## Instructions for AI
1313

14-
Effective Maven usage involves robust dependency management via `<dependencyManagement>` and BOMs, adherence to the standard directory layout, and centralized plugin management. Build profiles should be used for environment-specific configurations. POMs must be kept readable and maintainable with logical structure and properties for versions. Custom repositories should be declared explicitly and their use minimized, preferably managed via a central repository manager.
14+
Update the pom.xml based on the following rules about Maven best practices.
1515

16-
## Table of contents
16+
## Examples
1717

18-
- Rule 1: Effective Dependency Management
19-
- Rule 2: Standard Directory Layout
20-
- Rule 3: Plugin Management and Configuration
21-
- Rule 4: Use Build Profiles for Environment-Specific Configurations
22-
- Rule 5: Keep POMs Readable and Maintainable
23-
- Rule 6: Manage Repositories Explicitly
24-
- Rule 7: Centralize Version Management with Properties
18+
### Table of contents
2519

26-
## Rule 1: Effective Dependency Management
20+
- Example 1: Effective Dependency Management
21+
- Example 2: Standard Directory Layout
22+
- Example 3: Plugin Management and Configuration
23+
- Example 4: Use Build Profiles for Environment-Specific Configurations
24+
- Example 5: Keep POMs Readable and Maintainable
25+
- Example 6: Manage Repositories Explicitly
26+
- Example 7: Centralize Version Management with Properties
27+
28+
### Example 1: Effective Dependency Management
2729

2830
Title: Manage Dependencies Effectively using `dependencyManagement` and BOMs
2931
Description: Use the `<dependencyManagement>` section in parent POMs or import Bill of Materials (BOMs) to centralize and control dependency versions. This helps avoid version conflicts and ensures consistency across multi-module projects. Avoid hardcoding versions directly in `<dependencies>` when managed elsewhere.
@@ -92,9 +94,10 @@ Description: Use the `<dependencyManagement>` section in parent POMs or import B
9294
</dependency>
9395
</dependencies>
9496
</project>
97+
9598
```
9699

97-
**Bad Example:**
100+
**Bad example:**
98101

99102
```xml
100103
<!-- Child POM hardcoding versions -->
@@ -118,16 +121,17 @@ Description: Use the `<dependencyManagement>` section in parent POMs or import B
118121
</dependency>
119122
</dependencies>
120123
</project>
124+
121125
```
122126

123-
## Rule 2: Standard Directory Layout
127+
### Example 2: Standard Directory Layout
124128

125129
Title: Adhere to the Standard Directory Layout
126130
Description: Follow Maven's convention for directory structure (`src/main/java`, `src/main/resources`, `src/test/java`, `src/test/resources`, etc.). This makes projects easier to understand and build, as Maven relies on these defaults.
127131

128132
**Good example:**
129133

130-
```
134+
```text
131135
my-app/
132136
├── pom.xml
133137
└── src/
@@ -141,11 +145,12 @@ my-app/
141145
│ └── com/example/myapp/AppTest.java
142146
└── resources/
143147
└── test-data.xml
148+
144149
```
145150

146-
**Bad Example:**
151+
**Bad example:**
147152

148-
```
153+
```text
149154
my-app/
150155
├── pom.xml
151156
├── sources/ <!-- Non-standard -->
@@ -155,9 +160,10 @@ my-app/
155160
└── tests/ <!-- Non-standard -->
156161
└── com/example/myapp/AppTest.java
157162
<!-- This would require explicit configuration in pom.xml to specify source/resource directories -->
163+
158164
```
159165

160-
## Rule 3: Plugin Management and Configuration
166+
### Example 3: Plugin Management and Configuration
161167

162168
Title: Manage Plugin Versions and Configurations Centrally
163169
Description: Use `<pluginManagement>` in a parent POM to define plugin versions and common configurations. Child POMs can then use the plugins without specifying versions, ensuring consistency. Override configurations in child POMs only when necessary.
@@ -198,9 +204,10 @@ Description: Use `<pluginManagement>` in a parent POM to define plugin versions
198204
</plugins>
199205
</build>
200206
</project>
207+
201208
```
202209

203-
**Bad Example:**
210+
**Bad example:**
204211

205212
```xml
206213
<!-- Child POM -->
@@ -220,9 +227,10 @@ Description: Use `<pluginManagement>` in a parent POM to define plugin versions
220227
</plugins>
221228
</build>
222229
</project>
230+
223231
```
224232

225-
## Rule 4: Use Build Profiles for Environment-Specific Configurations
233+
### Example 4: Use Build Profiles for Environment-Specific Configurations
226234

227235
Title: Employ Build Profiles for Environment-Specific Settings
228236
Description: Use Maven profiles to customize build settings for different environments (e.g., dev, test, prod) or other conditional scenarios. This can include different dependencies, plugin configurations, or properties. Activate profiles via command line, OS, JDK, or file presence.
@@ -272,9 +280,10 @@ Description: Use Maven profiles to customize build settings for different enviro
272280
</profiles>
273281
</project>
274282
<!-- Activation: mvn clean install -P prod -->
283+
275284
```
276285

277-
**Bad Example:**
286+
**Bad example:**
278287

279288
```xml
280289
<!-- Commented out sections for different environments -->
@@ -285,9 +294,10 @@ Description: Use Maven profiles to customize build settings for different enviro
285294
<database.url>jdbc:postgresql://prodserver/mydb</database.url> <!-- Manually switch by commenting/uncommenting -->
286295
</properties>
287296
</project>
297+
288298
```
289299

290-
## Rule 5: Keep POMs Readable and Maintainable
300+
### Example 5: Keep POMs Readable and Maintainable
291301

292302
Title: Structure POMs Logically for Readability
293303
Description: Organize your `pom.xml` sections in a consistent order (e.g., project coordinates, parent, properties, dependencyManagement, dependencies, build, profiles, repositories). Use properties for recurring versions or values. Add comments for complex configurations.
@@ -344,9 +354,10 @@ Description: Organize your `pom.xml` sections in a consistent order (e.g., proje
344354
<!-- Repositories and Plugin Repositories (if needed) -->
345355
<!-- ... -->
346356
</project>
357+
347358
```
348359

349-
**Bad Example:**
360+
**Bad example:**
350361

351362
```xml
352363
<!-- Haphazard order, missing properties for versions -->
@@ -369,9 +380,10 @@ Description: Organize your `pom.xml` sections in a consistent order (e.g., proje
369380
<artifactId>my-app</artifactId>
370381
<version>1.0.0-SNAPSHOT</version>
371382
</project>
383+
372384
```
373385

374-
## Rule 6: Manage Repositories Explicitly
386+
### Example 6: Manage Repositories Explicitly
375387

376388
Title: Declare Custom Repositories Explicitly and Minimize Their Use
377389
Description: Prefer dependencies from Maven Central. If custom repositories are necessary, declare them in the `<repositories>` section and `<pluginRepositories>` for plugins. It's often better to manage these in a company-wide Nexus/Artifactory instance configured in `settings.xml` rather than per-project POMs. Avoid relying on transitive repositories.
@@ -395,9 +407,10 @@ Description: Prefer dependencies from Maven Central. If custom repositories are
395407
</pluginRepositories>
396408
</project>
397409
<!-- Better: Configure these in settings.xml and use a repository manager -->
410+
398411
```
399412

400-
**Bad Example:**
413+
**Bad example:**
401414

402415
```xml
403416
<!-- No explicit repository for a non-central artifact, relying on developer's local settings or transitive ones -->
@@ -414,9 +427,10 @@ Description: Prefer dependencies from Maven Central. If custom repositories are
414427
</dependency>
415428
</dependencies>
416429
</project>
430+
417431
```
418432

419-
## Rule 7: Centralize Version Management with Properties
433+
### Example 7: Centralize Version Management with Properties
420434

421435
Title: Use Properties to Manage Dependency and Plugin Versions
422436
Description: Define all dependency and plugin versions in the `<properties>` section rather than hardcoding them throughout the POM. This centralizes version management, makes updates easier, reduces duplication, and helps maintain consistency across related dependencies. Use consistent property naming conventions: `maven-plugin-[name].version` for Maven plugins, simple names like `[library].version` for dependencies, and descriptive names for quality thresholds like `coverage.level`.
@@ -436,22 +450,22 @@ Description: Define all dependency and plugin versions in the `<properties>` sec
436450
<maven.version>3.9.10</maven.version>
437451
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
438452
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
439-
453+
440454
<!-- Dependency versions -->
441455
<jackson.version>2.15.3</jackson.version>
442456
<junit.version>5.10.1</junit.version>
443457
<mockito.version>5.7.0</mockito.version>
444458
<logback.version>1.4.11</logback.version>
445-
459+
446460
<!-- Maven plugin versions -->
447461
<maven-plugin-compiler.version>3.14.0</maven-plugin-compiler.version>
448462
<maven-plugin-surefire.version>3.5.3</maven-plugin-surefire.version>
449463
<maven-plugin-failsafe.version>3.5.3</maven-plugin-failsafe.version>
450464
<maven-plugin-enforcer.version>3.5.0</maven-plugin-enforcer.version>
451-
465+
452466
<!-- Third-party plugin versions -->
453467
<maven-plugin-jacoco.version>0.8.13</maven-plugin-jacoco.version>
454-
468+
455469
<!-- Quality thresholds -->
456470
<coverage.level>80</coverage.level>
457471
<mutation.level>70</mutation.level>
@@ -501,9 +515,10 @@ Description: Define all dependency and plugin versions in the `<properties>` sec
501515
</plugins>
502516
</build>
503517
</project>
518+
504519
```
505520

506-
**Bad Example:**
521+
**Bad example:**
507522

508523
```xml
509524
<!-- Hardcoded versions scattered throughout the POM -->
@@ -567,4 +582,9 @@ Description: Define all dependency and plugin versions in the `<properties>` sec
567582
</plugins>
568583
</build>
569584
</project>
585+
570586
```
587+
## Output Requirements
588+
589+
- Update the file pom.xml if something is not correct
590+
- verify changes with the command: `mvn validate`

.cursor/rules/112-java-maven-documentation.mdc

Lines changed: 14 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -5,52 +5,27 @@ alwaysApply: false
55
---
66
# Create README-DEV.md with information about how to use the Maven project
77

8-
## System prompt characterization
8+
## Role
99

10-
Role definition: You are a Senior software engineer with extensive experience in Java software development
10+
You are a Senior software engineer with extensive experience in Java software development
1111

12-
## Description
12+
## Instructions for AI
1313

1414
When creating a README-DEV.md file for a Maven project, include ONLY the following sections with the specified Maven goals. Do NOT add any additional sections, explanations, or content beyond what is explicitly listed below.
1515

16-
## STRICT Structure for README-DEV.md (Template):
16+
Create a markdown file named `README-DEV.md` with the following exact structure: [java-maven-documentation-template.md](mdc:.cursor/rules/templates/java-maven-documentation-template.md)
1717

18-
**IMPORTANT: Include ONLY the content specified below.**
18+
## Restrictions
1919

20-
---
21-
22-
# Essential Maven Goals:
23-
24-
```bash
25-
# Analyze dependencies
26-
./mvnw dependency:tree
27-
./mvnw dependency:analyze
28-
./mvnw dependency:resolve
29-
30-
./mvnw clean validate -U
31-
./mvnw buildplan:list-plugin
32-
./mvnw buildplan:list-phase
33-
./mvnw help:all-profiles
34-
./mvnw help:active-profiles
35-
./mvnw license:third-party-report
36-
37-
# Clean the project
38-
./mvnw clean
39-
40-
# Clean and package in one command
41-
./mvnw clean package
42-
43-
# Run integration tests
44-
./mvnw verify
20+
**MANDATORY REQUIREMENT**: Follow the embedded template EXACTLY - do not add, remove, or modify any steps, sections, or cursor rules that are not explicitly shown in the template. ### What NOT to Include:
4521

46-
# Check for dependency updates
47-
./mvnw versions:display-property-updates
48-
./mvnw versions:display-dependency-updates
49-
./mvnw versions:display-plugin-updates
22+
- **DO NOT** create additional steps beyond what's shown in the template
23+
- **DO NOT** expand or elaborate on sections beyond what the template shows
24+
- **ONLY** use the exact wording and structure from the template
25+
- If a cursor rule exists in the workspace but is not in the template, **DO NOT** include it
5026

51-
# Generate project reports
52-
./mvnw site
53-
jwebserver -p 8005 -d "$(pwd)/target/site/"
54-
```
27+
## Output Requirements
5528

56-
**END OF TEMPLATE - DO NOT ADD ANYTHING BEYOND THIS POINT**
29+
- Generate the complete markdown file following the embedded template exactly
30+
- Use proper markdown formatting with headers, code blocks, tables, and checklists
31+
- **VERIFY**: Final output contains ONLY what appears in the embedded template

0 commit comments

Comments
 (0)