私は次のチュートリアルに従います:https://spring.io/guides/gs/rest-service/tomcat 8の下でSpring RESTfulプロジェクトを実行するには?
私は、彼らのプロジェクトを実行するためにtomcatを使用していないことに気付きました。彼らはそれを実行するために "gradle run"コマンドを使用します。 TomプロジェクトでそのSpringプロジェクトを実行できますか?
また、私はそれが共鳴できるかどうかを知りたいです。 SpringのRESTfulプロジェクトを実行するためにTomcatが必要ですか( "gradle run"コマンドで実行する方が良いでしょうか?)
私は次のbuild.gradleコンテンツ持ちのIntelliJ IDEAとGradleの3.0
を使用しています:その名の通り
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
jar {
baseName = 'gs-rest-service'
version = '0.1.0'
}
repositories {
jcenter()
maven { url "http://repo.spring.io/libs-snapshot" }
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
providedRuntime("org.springframework.boot:spring-boot-starter-tomcat")
}
にチュートリアルの
単純にチュートリアルを一歩一歩進んで、プロジェクトを実行しますあなたのIDEから、またはmvnを使ってコマンドラインから実行する:spring-boot – xenteros