xiaohongshu
xiaohongshu
maven-converter
将 Java 项目转换为标准 Maven 结构,自动重组目录、转换包名(test→example)并生成 pom.xml。当用户需要将非 Maven Java 项目转换为 Maven 项目、重构现有项目为 Maven 标准结构,或请求 Maven 项目设置/转换时使用此技能。
Full skill instructions
自动将 Java 项目转换为 Maven 标准结构,包括重组目录、更新包名和生成构建配置。
在目标项目上运行转换脚本:
python3 scripts/maven_converter.py [项目路径] [选项]
常用选项:
--dry-run: 预览更改而不修改文件--group-id: 设置 Maven groupId(默认:com.example)--artifact-id: 设置 Maven artifactId(默认:项目目录名)--version: 设置项目版本(默认:1.0-SNAPSHOT)示例:
# 预览转换
python3 scripts/maven_converter.py /path/to/project --dry-run
# 执行转换并自定义 groupId
python3 scripts/maven_converter.py /path/to/project --group-id com.mycompany --artifact-id my-app
转换器自动执行以下操作:
创建 Maven 标准结构
src/main/java/ - 生产源代码src/main/resources/ - 生产资源文件src/test/java/ - 测试源代码src/test/resources/ - 测试资源文件重组文件
转换包名
test 替换为 exampletest.*、*.test.*、*.testpackage test; → package example;package com.test.app; → package com.example.app;package com.app.test.utils; → package com.app.example.utils;生成 pom.xml
清理
转换前先了解项目结构:
# 查看当前结构
find /path/to/project -type f -name "*.java" | head -20
# 检查是否已有 Maven 设置
ls -la /path/to/project/pom.xml
ls -la /path/to/project/src/
始终先预览更改:
python3 scripts/maven_converter.py /path/to/project --dry-run
检查输出以验证:
运行实际转换:
python3 scripts/maven_converter.py /path/to/project \
--group-id com.company \
--artifact-id project-name \
--version 1.0.0
检查转换后的结构:
# 查看 Maven 结构
tree /path/to/project/src -L 4
# 验证 pom.xml
cat /path/to/project/pom.xml
# 测试构建
cd /path/to/project
mvn clean compile
mvn test
根据需要进行检查和调整:
检查 pom.xml
验证包名
检查移动的文件
src/test/javasrc/main/java如果要使用自定义 pom.xml 模板而不是自动生成:
assets/pom_template.xmlcp assets/pom_template.xml /path/to/project/pom.xml
assets/pom_template.xml 中的模板提供了起点,包含:
src/main/java 或 src/test/java 中的文件文件未正确移动
.java 扩展名包转换问题
转换后构建失败
mvn clean compile 检查编译脚本错误
python3 --versionxiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience