0

Project setup is build.gradle file with main, integTest, test and peroformanceTest modules, each one has it's on set of java classes and resources folders.

When importing project to Intellij unit test wouldn't properly work as intellij merges all resources into one folder, until you select Use module compile output path in intellij Project Settings->Modules->MyProject->Paths tab

Is there a way to include this config in build.gradle file? => Intellij - set default output path to gradle output

But after setting this all my modules share resources that means since I have same resource files (application.conf) in each of the modules those gets overwritten. I would need to specify different output folder for each module:

apply plugin: 'idea'

idea{
    module{
        inheritOutputDirs = false
        outputDir = compileJava.destinationDir + ${module.name}
        testOutputDir = compileTestJava.destinationDir + ${module.name}
    }
}
blackuprise
  • 440
  • 6
  • 26
  • Possible duplicate of [Intellij - set default output path to gradle output](https://stackoverflow.com/questions/46420541/intellij-set-default-output-path-to-gradle-output) – Kootli Jul 31 '19 at 15:25
  • yes you're correct that's what I was looking for – blackuprise Aug 02 '19 at 14:01

1 Answers1

0

Solution will be:

idea {
  module {
    inheritOutputDirs = false
    outputDir = new File("${rootDir}/build/java/${name}")
    testOutputDir = new File("${rootDir}/build/java/test/${name}")
    downloadJavadoc = true
    downloadSources = true
  }
}
blackuprise
  • 440
  • 6
  • 26