项目设置是带有main,integTest,test和peroformanceTest模块的build.gradle文件,每个模块都位于一组Java类和资源文件夹中。
将项目导入Intellij单元测试无法正常工作,因为intellij将所有资源合并到一个文件夹中,直到您在intellij项目设置->模块-> MyProject->路径选项卡中选择Use module compile output path
有没有办法将此配置包含在build.gradle文件中? => Intellij - set default output path to gradle output
但是,设置完所有这些模块后,我的所有模块共享资源,这意味着由于每个模块中都有相同的资源文件(application.conf),这些资源文件将被覆盖。我需要为每个模块指定不同的输出文件夹:
apply plugin: 'idea'
idea{
module{
inheritOutputDirs = false
outputDir = compileJava.destinationDir + ${module.name}
testOutputDir = compileTestJava.destinationDir + ${module.name}
}
}
答案 0 :(得分:0)
解决方案将是:
idea {
module {
inheritOutputDirs = false
outputDir = new File("${rootDir}/build/java/${name}")
testOutputDir = new File("${rootDir}/build/java/test/${name}")
downloadJavadoc = true
downloadSources = true
}
}