3
我正在爲我的gradle項目使用IntelliJ 14.1.1(但此問題存在於以前的版本中)。我有以下爲我gradle這個文件:IntelliJ與gradle和querydsl
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'jacoco'
apply plugin: 'maven'
project.ext {
springBootVersion = '1.1.7.RELEASE'
}
configurations {
querydslapt
}
jacoco {
toolVersion = "0.7.0.201403182114"
}
buildscript {
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url "http://repo.spring.io/libs-milestone" }
maven { url "http://repo.spring.io/libs-snapshot" }
mavenLocal()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.3.RELEASE")
}
}
jar {
...
}
repositories {
mavenCentral()
maven { url "http://repo.spring.io/libs-milestone" }
...
}
jacocoTestReport {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
}
task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
//Querydsl
def generatedSrcDir = 'src/main/generated'
task createGeneratedSrcDir << {
file(generatedSrcDir).mkdirs()
}
compileJava.dependsOn createGeneratedSrcDir
compileJava {
options.compilerArgs << '-processor' << 'com.mysema.query.apt.jpa.JPAAnnotationProcessor' << '-s' << file(generatedSrcDir).absolutePath
}
clean {
delete generatedSrcDir
}
好像每次的IntelliJ我做gradle這個建立時間失去我的設置生成的來源,我必須進入工程|模塊設置,並手動添加src/main/generated /到源。
這通常工作,但我不明白爲什麼我必須告訴IntelliJ我的源路徑是什麼。 IntelliJ問題,或我的gradle文件?
謝謝你,是沒有的伎倆! – sonoerin