بنقرة واحدة
fix-mvn-compile
Fix common Maven compilation errors in emp-script project (missing imports, throws declarations)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Fix common Maven compilation errors in emp-script project (missing imports, throws declarations)
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
EWA RESTful handler 开发/调试时,与 Frame 路径 (ServletUpload/ActionFrame) 对照确保参数映射和 SQL 执行一致性
How to write DataConnection tests using SQLite — driver version, pool setup (HikariCP/Druid), path expressions, concurrency, and API patterns
Use when: 调用 EWA Servlet API、查询数据库表结构与数据、读取或修改 EWA XML 配置项、生成业务 XML(自动创建容器)、查看配置存储路径(showScriptPaths)、直接读取 XML 文件(getXmlFile)、校验 SQL 语法(validateSql)、需要脚本化执行 login/getTables/getTable/getTableData/getConfItem/previewBusinessXml/createBusinessXml/showScriptPaths/getXmlFile/validateSql。
Use when: 通过 EWA API 查看存储过程、函数或触发器的完整定义文本。INFORMATION_SCHEMA.ROUTINES 会截断,需用 sys.sql_modules 获取完整内容。
Use when: 编写 EWA 表单前端 JS 代码、表单提交与验证、表单与列表联动、对话框中表单操作、动态字段控制、合并单元格、分组向导。按任务组织,含完整代码示例。
Use when: 编写 EWA ListFrame 列表前端 JS 代码、行数据操作、选中行、翻页排序、检索过滤、展开行详情、动态列、底部汇总、行内编辑。按任务组织,含完整代码示例。
| name | fix-mvn-compile |
| description | Fix common Maven compilation errors in emp-script project (missing imports, throws declarations) |
| source | auto-skill |
| extracted_at | 2026-06-26T08:25:21.571Z |
Run mvn clean compile 2>&1 | tail -80 to identify error types:
throwsError pattern:
error: unreported exception Exception; must be caught or declared to be thrown
Cause: DTRow.getCell(String colName) throws Exception, calling methods must declare throws Exception.
Fix: Add throws Exception to method signature:
// Before
private static JSONObject createEndpointDescription(...) {
// After
private static JSONObject createEndpointDescription(...) throws Exception {
Common missing classes and their packages:
| Class | Package |
|---|---|
UserConfig | com.gdxsoft.easyweb.script.userConfig.UserConfig |
UserXItems | com.gdxsoft.easyweb.script.userConfig.UserXItems |
UserXItem | com.gdxsoft.easyweb.script.userConfig.UserXItem |
UserXItemValue | com.gdxsoft.easyweb.script.userConfig.UserXItemValue |
UserXItemValues | com.gdxsoft.easyweb.script.userConfig.UserXItemValues |
JSONArray | org.json.JSONArray |
JSONObject | org.json.JSONObject |
DTTable | com.gdxsoft.easyweb.data.DTTable |
DTRow | com.gdxsoft.easyweb.data.DTRow |
Fix: Add import after existing imports:
import com.gdxsoft.easyweb.script.userConfig.UserConfig;
import com.gdxsoft.easyweb.script.userConfig.UserXItem;
import com.gdxsoft.easyweb.script.userConfig.UserXItems;
import org.json.JSONArray;
Error pattern (pre-existing, in bussinessXmlCreator tests):
不兼容的类型: com.gdxsoft.easyweb.script.template.EwaConfig无法转换为com.gdxsoft.easyweb.script.userConfig.IConfig
Cause: Test files use EwaConfig (template package) but BusinessXmlCreator.create() expects IConfig (userConfig package). These are different class hierarchies.
IConfig implementations: FileConfig, JdbcConfig, ResourceConfig (all in script.userConfig package).
Quick fix — skip test compilation:
mvn clean package -Dmaven.test.skip=true
Important:
-DskipTestsonly skips test execution, test compilation still runs. Use-Dmaven.test.skip=trueto skip both.
mvn clean compilemvn clean compilemvn clean package -Dmaven.test.skip=true (avoids pre-existing test issues)