Intellij - 将默认输出路径设置为gradle输出 [英] Intellij - set default output path to gradle output

查看:1997
本文介绍了Intellij - 将默认输出路径设置为gradle输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我创建了一个新的gradle项目,选择Java作为附加库和框架。

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

Gradle将编译为。\ build \classes 并维护包结构,

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

但是项目结构中的模块编译输出路径 - >模块设置为。\\\\production\classes

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

这真令我讨厌,而不是我想记住要改变的事情每次我创建一个新的Java项目。

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

我可以以某种方式更改默认值,使其与gradle输出路径匹配吗?

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

推荐答案

你可以使用Gradle pluigin for INtelliJ

You can use the Gradle pluigin for INtelliJ

build.gradle

apply plugin: 'idea'

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

然后当你跑...

gradle idea

...它将为您生成完整的IntelliJ项目文件。

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

这篇关于Intellij - 将默认输出路径设置为gradle输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆