Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intellij - set default output path to gradle output

So, I created a new gradle project, choosing Java as "additional libraries and frameworks".

Gradle will compile to .\build\classes and maintain package structure,

but the "module compile output path" in project structure -> modules is set to .\out\production\classes.

That's really annoying and not something I want to remember having to change every time I create a new Java project.

Can I somehow change the default so it matches the gradle output path?

like image 743
User1291 Avatar asked Sep 26 '17 07:09

User1291


1 Answers

You can use the Gradle pluigin for INtelliJ

In build.gradle:

apply plugin: 'idea'

idea{
    module{
        inheritOutputDirs = false
        outputDir = compileJava.destinationDir
        testOutputDir = compileTestJava.destinationDir
    }
}

Then when you run ...

gradle idea

... it will generate complete IntelliJ project files for you.

like image 57
glytching Avatar answered Oct 16 '22 17:10

glytching