IntelliJ IDEA 配置Play项目
Play 提供命令将Play应用转化成一个 IntelliJ IDEA 模块
$> play idealize [myApp]
配置流程
-
创建一个单模块的IntlliJ IDEA.
- $> play new [myApp] ; 创建Play项目
- $> play idealize [myApp] ; 创建IDEA模块,该命令会生成一个.ipr文件
- 在IntelliJ IDEA中选择.ipr文件打开项目
-
配置运行参数
- 打开 Run 菜单, 选择 Edit Configurations .
- Default -> Apllication -> Add New Configuration .
- Main Class [play.server.server]
- VM options [-Dapplication.path="."]
- Working directory [/path/to/application]
- 删除 Make
-
配置测试运行环境*
- 添加 VM options 配置: [-Dplay.id=test].
- Open Module Settings -> Dependencies -> Add.. -> Single-Entry Module Library 选择:[$PLAY_HOME/modules/testrunner/lib/play-testrunner.jar]
IntelliJ IDEA 配置
IntelliJ IDEA 配置