Intellij - set default output path to gradle output

半腔热情 提交于 2019-12-28 16:13:11

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/46420541/intellij-set-default-output-path-to-gradle-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!