Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
232 views
in Technique[技术] by (71.8m points)

java - 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 .uildclasses and maintain package structure,

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...