my minimal build.gradle at 2018.8


2018.8時点の最小のbuild.gradle

いつも作り直すのが面倒だと感じているのに、どこで管理してよいかわからず、ここに上げることが適切とは思わないが、必要なときにすぐに見れる点では、githubのprivateリポジトリよりも優れている気がするのでとりあえず残す。

/*
----------------------------------------------
 keep updating
 generated on  https://start.spring.io/ 
----------------------------------------------

buildscript {
	ext {
		springBootVersion = '2.0.4.RELEASE'
	}
	repositories {
		mavenCentral()
	}
	dependencies {
		classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
	}
}
*/


apply plugin: 'java'
// apply plugin: 'application'
apply plugin: 'eclipse'
// apply plugin: 'org.springframework.boot'
// apply plugin: 'io.spring.dependency-management'

group = 'todo.set.somegroup' // like com.github.xxxx
version = '0.0.1'
sourceCompatibility = 1.8
targetCompatibility = 1.8

// mainClassName = 'todo.SetMainClassFQCN'

repositories { 
  jcenter()
  mavenCentral() 
  google()
}

jar {
  baseName = 'todo-setsomename-java'
}

dependencies {

//	compile('org.springframework.boot:spring-boot-starter')

  // https://mvnrepository.com/artifact/com.google.guava/guava
  compile group: 'com.google.guava', name: 'guava', version: '26.0-jre'
  // https://mvnrepository.com/artifact/com.google.code.gson/gson
  compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
  // https://mvnrepository.com/artifact/joda-time/joda-time
  compile group: 'joda-time', name: 'joda-time', version: '2.10'
  // https://mvnrepository.com/artifact/org.slf4j/slf4j-api
  compile group: 'org.slf4j', name: 'slf4j-api', version: '1.8.0-beta2'
  // https://mvnrepository.com/artifact/ch.qos.logback/logback-classic
  compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.3.0-alpha4'

//	testCompile('org.springframework.boot:spring-boot-starter-test')

  // https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
  testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.2.0'
}

task initDirs  {
  doLast {
    new File("src/main/java").mkdirs();
    new File("src/main/groovy").mkdirs();
    new File("src/main/resources").mkdirs();
    new File("src/test/java").mkdirs();
    new File("src/test/groovy").mkdirs();
    new File("src/test/resources").mkdirs();
  }
}