这里有一个Gradle构建,这里建议使用play web framework.
plugins {
id 'play'
id 'idea'
}
repositories {
jcenter()
maven {
name "typesafe-maven-release"
url "https://repo.typesafe.com/typesafe/maven-releases"
}
ivy {
name "typesafe-ivy-release"
url "https://repo.typesafe.com/typesafe/ivy-releases"
layout "ivy"
}
}
它在构建,启动等时从命令行工作正常但是一旦项目在intellij中导入(想法的项目文件生成gradle idea
),依赖项(来自播放插件)不会显示在项目视图/外部库中(甚至在gradle面板中点击"刷新所有gradle项目"之后).
谢谢 :)
PS:intellij 15.0.2/gradle 2.6/播放插件
在这里找到答案。显然,需要明确告知gradle idea插件如何连接依赖项。
总结一下 :
创建典型的游戏布局
添加一个build.gradle(如下)
键入gradle idea
以生成想法的项目文件
在intellij中打开项目
plugins {
id 'play'
id 'idea'
}
repositories {
jcenter()
maven {
name "typesafe-maven-release"
url "https://repo.typesafe.com/typesafe/maven-releases"
}
ivy {
name "typesafe-ivy-release"
url "https://repo.typesafe.com/typesafe/ivy-releases"
layout "ivy"
}
}
idea {
module {
sourceDirs += file("app")
testSourceDirs += file("test")
scopes.COMPILE = [plus: [configurations.play], minus: []]
scopes.RUNTIME = [plus: [configurations.playRun], minus:[configurations.play]]
scopes.TEST = [plus: [configurations.playTest], minus: [configurations.playRun]]
}
}
PS:已使用intellij 15.0.2 / gradle 2.10 / gradle play插件进行了测试