Intellij-IDEA gradle templates

How to change the "build.gradle" template in IntelliJ IDEA 15.0.1?

I want to remove the "sourceCompatibility", add the "idea" plugin and change the version of JUnit.

I tried changing the "Gradle Build Script" as shown below,

Vista> Editor> File and Code Templates> Gradle Build Script

apply plugin: 'java'
apply plugin: 'idea'

repositories {
    mavenCentral()
}

dependencies {
    testCompile 'junit:junit:4.12'
}

but i got build.gradle as it should

apply plugin: 'java'
apply plugin: 'idea'

repositories {
    mavenCentral()
}

dependencies {
    testCompile 'junit:junit:4.12'
}

apply plugin: 'java'

sourceCompatibility = 1.5

repositories {
    mavenCentral()
}

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.11'
}

Regards,

-Mitsutaka Ohisa

+4
source share
1 answer

The preferences that interest you are hardcoded in the IDEA JetBrains gradle plugin:

<IDEA_base>\plugins\gradle\lib\gradle.jar\org\jetbrains\plugins\gradle\frameworkSupport\GradleJavaFrameworkSupportProvider.class

0
source

Source: https://habr.com/ru/post/1618859/


All Articles