Gradle - paulvi/notes GitHub Wiki

http://stackoverflow.com/questions/27349972/spring-boot-and-jpa-2-0

configurations.all { resolutionStrategy.eachDependency { DependencyResolveDetails details -> // Use Hibernate 4.2 if (details.requested.name == "hibernate-entitymanager") { details.useTarget "org.hibernate:hibernate-entitymanager:4.2.16.Final" } // Use JPA 2.0 if (details.requested.name == "hibernate-jpa-2.1-api") { details.useTarget "org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final" } } }

plugins

extra

// https://docs.gradle.org/current/userguide/init_scripts.html

Put a file called init.gradle (or init.gradle.kts for Kotlin) in the USER_HOME/.gradle/ directory.

/* add looking-up in local Maven repo, don't download twice! */
allprojects {
    repositories {
        mavenLocal()
    }
}

Fat Jars with Excluded provided Dependencies in Gradle http://www.tuicool.com/articles/aeMR7vi

Jars

task copyDeps(type: Copy) {
    from configurations.runtime into "${buildDir}/deps"
}
//+ build in RAM drive
if ( file("r:/").exists() ) {
	rootProject.buildDir = 'r:/build/STS372/GradleSTSJavaQuickStart'
}

http://www.romseysoftware.co.uk/2012/03/12/gradle-and-utf-8/

[ compileJava, compileTestJava ]*.options*.encoding = 'UTF-8'

jar.manifest.writeTo("$buildDir/mymanifest.mf") http://stackoverflow.com/questions/8973638/how-to-use-gradles-manifest-api-to-insert-a-manifest-mf-file-into-the-root-of