开发者社区> 问答> 正文

能正常运行的jfinal项目在用maven打包时报错

以前一直用eclipse的导出war包,可正常在tomcat下运行

昨天将项目转成maven管理的后,用maven install会报错,异常如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project project_name: Compilation failure
 [ERROR] /D:/git/project_name/src/com/jfinal/plugin/activerecord/Model.java:[501,32] 不兼容的类型: com.jfinal.plugin.activerecord.Model无法转换为M
 [ERROR] -> [Help 1]
 [ERROR] 
 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR] 
 [ERROR] For more information about the errors and possible solutions, please read the following articles:
 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException 

检查了下代码,所有继承了Model类的domain都在config中注册了arp.addMapping,请问这是什么原因造成的

展开
收起
爵霸 2016-06-02 11:03:10 3835 0
1 条回答
写回答
取消 提交回答
  • 是否用的最新版本的 jfinal 1.9? 看错误提示原因是该 maven 版本对com.jfinal.plugin.activerecord.Model泛型检测没有通过。解决办法可以是换 maven版本或者在编译时提供相关的参数。

    最简单快捷的办法是用 eclipse 的 export 功能导出 war 包,项目上线以后再回头再解决 maven 的问题 
    
    2019-07-17 19:24:19
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
使用Spring.Initializr定制工程脚手架 立即下载
陈曦:使用Spring.Initializr定制工程脚手架 立即下载
低代码开发师(初级)实战教程 立即下载