Prefer to run scripts/scaffold_java_maven_model.py to create the module skeleton; do not hand-write the module name,pom.xml, package path, and parent module declaration. The script extracts pom.xml from the description of the root 公司名称、产品名称、服务名称, and completes the naming conversion according to the convention; if the parent pom.xml already has an dependencyManagement entry for an internal module of the same family, it will also be filled in. Empty directories use .gitkeep to ensure they can be tracked by Git.
Workflow
- First run
--dry-runonce in the root directory of the target repository; if the current directory is not the root directory, pass--repo-root。 - Review the
moduleName、packageName、groupId、artifactId、parent、managedDependency。 - output by the script to confirm it is correct, then execute the formal command to create the
<serviceName>-<modelName>module. - After execution, use
git diffor directly open the parentpom.xml, confirm that at least<modules>was synchronized, and check whetherdependencyManagement。 - was filled in according to the repository's existing conventions. Continue to add classes, dependencies, documentation, or tests only when the user explicitly requests it or the repository conventions explicitly require it.
Quick Commands
python3 .agents/skills/eliteforge-new-java-maven-model/scripts/scaffold_java_maven_model.py reasoning-engine
python3 .agents/skills/eliteforge-new-java-maven-model/scripts/scaffold_java_maven_model.py reasoning-engine --repo-root /path/to/repo
python3 .agents/skills/eliteforge-new-java-maven-model/scripts/scaffold_java_maven_model.py reasoning-engine --dry-run
Fixed Rules
- The module name uses
<serviceName>-<modelName>,serviceNameand must be read from the description of the rootpom.xml. - The package name uses
cn.<companyName>.<productName>.<serviceName>.<modelName>, all converted to dot style. artifactIdusesapp-<companyName>-<productName>-<serviceName>-<modelName>, all converted to hyphen style.groupIdusescn.<companyName>.<productName>, all converted to dot style.parentis identified by searching upward from the target directory for the nearest Maven aggregator parent project,<version>is fixed to${revision}。- By default create
pom.xml、src/main/java/<packagePath>/.gitkeep、src/main/resources/.gitkeep、src/test/java/.gitkeep。 - If the parent
pom.xmlalready has<modules>, append the new module; if not, create the<modules>block; do not write it repeatedly. - If the parent
pom.xmlalready maintains internal modulegroupIdaccording to the sameapp-<company>-<product>-<service>-*anddependencyManagementconventions, then append the managed dependency for the current module; if the repository does not have this convention, do not add it out of thin air. - If
<serviceName>-runtime-planeexists in the repository, it can be treated as an optional reference module for observing naming and minimal directory habits; if it cannot be found, still create according to the built-in minimal skeleton, without affecting the applicability of the skill. - After the scaffolding is complete, review
git difffirst to confirm that there is no omission of the parentpom.xmlmodule aggregation or internal dependency management synchronization. - If the user also requests business code, tests, or module documentation, first create the module skeleton, then continue executing other skills or repository conventions.