GradleとIntelliJを使用してSpring Framework Restful Web Service作成チュートリアル(https://spring.io/guides/gs/rest-service/#scratch)を試してみようとしています。私は手紙にすべてを従ってきましたが、Spring、IntelliJ、およびJavaについてはかなり新しいです。一般的に、私の問題をさらにデバッグする方法は不明です。IntelliJでSpring RestServiceチュートリアルを作成できません
プロジェクトをビルドしようとすると「Java:package org.springframework.web.bind.annotationが存在しません」というエラーが表示されます。私はライブラリの参照が不足していると推測していますが、それをチェックして含める方法がわかりません。
buildscript {
ext {
springBootVersion = '1.3.5.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
classpath("org.springframework:spring-web:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
jar {
baseName = 'hello_springtest'
version = '0.0.1-SNAPSHOT'
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile('org.springframework.boot:spring-boot-starter-web')
testCompile('org.springframework.boot:spring-boot-starter-test')
}
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
}
eclipse {
classpath {
containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
}
}
ちょっとした情報を追加したいと思っていました。私はまだエラーが表示されているとわかりませんが、私のプロジェクトはビルドが成功したと報告します。しかし、プロジェクトを作成しようとすると、そのときにアノテーションが存在しないというエラーが表示されます。
また、IntelliJとGradle https://spring.io/guides/gs/intellij-idea/のIDE手順に従っていますか? – judoole
@judooleだから、SpringからIntelliJへのチュートリアルを読み込むためのウォークスルーのように見えます。私は歩き回って最初からそれを構築しようとしていたので、それは本当に適用されないようです。 –
このリンクのチュートリアルは、このチュートリアルのリファレンスです。https://spring.io/guides/gs/rest-service/#use-sts私が尋ねた理由は、エラーがIntelliJがエラーを起こした場合のようです。 build.gradle – judoole