私のアプリケーションに新しいモジュールを追加しようとしています。 movie-apiモジュールを追加しましたが(下の図を参照)、別のモジュール(client-app)を追加しようとすると、図のようにエラーが表示されます。 Gradle DSLメソッドが見つかりません: 'compileOnly()'
私はGradle DSL method not found: 'compile()'を含むさまざまなソリューションを試しましたが、私には役に立たなかった。 あなたの助けを感謝します!
Build.gradleファイル:
buildscript {
ext {
springBootVersion = '1.4.3.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
jar {
baseName = 'client-app'
version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile('org.springframework.boot:spring-boot-starter')
compileOnly('org.projectlombok:lombok')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
build.gradleファイルを表示します。あなたは、Javaプラグインが適用されていないか、何かが解析を破っているように思えます。コマンドラインからビルドできますか? 'build -s'タスクの出力は何ですか?またチェック:http://stackoverflow.com/questions/27617687/gradle-dsl-method-not-found-compile?noredirect=1&lq=1 – JBirdVegas
@JBirdVegas、ここに私のbuild.gradle –
@JBirdVegas私は私を追加しましたbuild.gradle。あなたはそれを見ていただけますか?ありがとうございました:) –