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

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

问题描述

因此,我创建了一个新的 gradle 项目,选择 Java 作为附加库和框架".

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

Gradle 将编译为 .uildclasses 并维护包结构,

Gradle will compile to .uildclasses and maintain package structure,

但是项目结构->modules中的模块编译输出路径"设置为.outproductionclasses.

but the "module compile output path" in project structure -> modules is set to .outproductionclasses.

这真的很烦人,而且我不想记住每次创建新 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?

推荐答案

您可以使用适用于 INtelliJ 的 Gradle 插件

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天全站免登陆