脚步:
播放新模块 firstmodule
更新了模块的play.plugins文件以包含
10:play.modules.firstmodule.MyPlugin
创建MyPlugin类:
package play.modules.firstmodule; import play.Logger; import play.PlayPlugin; public class MyPlugin extends PlayPlugin { @Override public void onLoad() { Logger.info("hello"); } @Override public void onApplicationStart() { Logger.info("hello"); } @Override public void onRoutesLoaded() { Logger.info("hello"); } }
玩构建模块
将模块添加到主项目依赖项
require: - play 1.2.5 - customModules -> firstmodule repositories: - playCustomModules: type: local artifact: c:\github\firstmodule\dist\firstmodule-0.1.zip contains: - customModules -> *
play deps正确解析所有依赖项
玩跑
服务器启动,我点击任何页面,但从未打印日志消息“hello”。是什么赋予了?