diff --git a/build.gradle b/build.gradle index d663148d..d72b8306 100644 --- a/build.gradle +++ b/build.gradle @@ -518,6 +518,7 @@ configure(rootProject) { dependencies { // just used to get version into docs compile "org.springframework:spring-core" + compile "org.springframework.boot:spring-boot" } // don't publish the default jar for the root project @@ -554,6 +555,7 @@ configure(rootProject) { numbered: '', 'spring-statemachine-version' : project.version, 'spring-version' : getResolvedVersionOf("spring-core"), + 'spring-boot-version' : getResolvedVersionOf("spring-boot"), revnumber : project.version } diff --git a/docs/src/reference/asciidoc/getting-started.adoc b/docs/src/reference/asciidoc/getting-started.adoc index 4b93054a..da855ab1 100644 --- a/docs/src/reference/asciidoc/getting-started.adoc +++ b/docs/src/reference/asciidoc/getting-started.adoc @@ -73,48 +73,59 @@ framework. |=== == Using Gradle -Here is a typical `build.gradle` file: +Here is a typical `build.gradle` file created by https://start.spring.io: -[source,groovy,indent=0] +[source,groovy,indent=0,subs="attributes+"] ---- buildscript { - repositories { - maven { url "http://repo.spring.io/libs-release" } - } - dependencies { - classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.5.RELEASE") - } + ext { + springBootVersion = '{spring-boot-version}' + } + repositories { + mavenCentral() + maven { url "https://repo.spring.io/snapshot" } + maven { url "https://repo.spring.io/milestone" } + } + dependencies { + classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") + } } -apply plugin: 'base' apply plugin: 'java' apply plugin: 'eclipse' -apply plugin: 'idea' -apply plugin: 'spring-boot' -version = '0.1.0' -archivesBaseName = 'gs-statemachine' +apply plugin: 'org.springframework.boot' +apply plugin: 'io.spring.dependency-management' + +group = 'com.example' +version = '0.0.1-SNAPSHOT' +sourceCompatibility = 1.8 repositories { - mavenCentral() - maven { url "http://repo.spring.io/libs-release" } - maven { url "http://repo.spring.io/libs-milestone" } - maven { url "http://repo.spring.io/libs-snapshot" } + mavenCentral() + maven { url "https://repo.spring.io/snapshot" } + maven { url "https://repo.spring.io/milestone" } +} + + +ext { + springStatemachineVersion = '{revnumber}' } dependencies { - compile("org.springframework.statemachine:spring-statemachine-core:1.0.0.BUILD-SNAPSHOT") - compile("org.springframework.boot:spring-boot-starter:1.2.5.RELEASE") - testCompile("org.springframework.statemachine:spring-statemachine-test:1.0.0.BUILD-SNAPSHOT") + compile('org.springframework.statemachine:spring-statemachine-starter') + testCompile('org.springframework.boot:spring-boot-starter-test') } -task wrapper(type: Wrapper) { - gradleVersion = '1.11' +dependencyManagement { + imports { + mavenBom "org.springframework.statemachine:spring-statemachine-bom:${springStatemachineVersion}" + } } ---- [NOTE] ==== -Replace `1.0.0.BUILD-SNAPSHOT` with a version you want to use. +Replace `0.0.1-SNAPSHOT` with a version you want to use. ==== Having a normal project structure you'd build this with command: @@ -123,7 +134,7 @@ Having a normal project structure you'd build this with command: # ./gradlew clean build ---- -Expected Spring Boot packaged fat-jar would be `build/libs/gs-statemachine-0.1.0.jar`. +Expected Spring Boot packaged fat-jar would be `build/libs/demo-0.0.1-SNAPSHOT.jar`. [NOTE] ==== @@ -132,103 +143,116 @@ production development. ==== == Using Maven -Here is a typical `pom.xml` file: +Here is a typical `pom.xml` file created by https://start.spring.io: -[source,xml,indent=0] +[source,xml,indent=0,subs="attributes+"] ---- - - 4.0.0 + + 4.0.0 - org.springframework - gs-statemachine - 0.1.0 - jar + com.example + demo + 0.0.1-SNAPSHOT + jar - - org.springframework.boot - spring-boot-starter-parent - 1.2.5.RELEASE - + gs-statemachine + Demo project for Spring Statemachine - - - org.springframework.statemachine - spring-statemachine-core - 1.0.0.BUILD-SNAPSHOT - - - org.springframework.boot - spring-boot-starter - 1.0.0.BUILD-SNAPSHOT - - - org.springframework.statemachine - spring-statemachine-test - 1.0.0.BUILD-SNAPSHOT - test - - + + org.springframework.boot + spring-boot-starter-parent + {spring-boot-version} + + - - - - maven-compiler-plugin - 2.3.2 - - - org.springframework.boot - spring-boot-maven-plugin - - - maven-failsafe-plugin - - - package - - integration-test - verify - - - - - - + + UTF-8 + UTF-8 + 1.8 + {revnumber} + - - - spring-release - http://repo.spring.io/libs-release - false - - - spring-milestone - http://repo.spring.io/libs-milestone - false - - - spring-snapshot - http://repo.spring.io/libs-snapshot - true - - + + + org.springframework.statemachine + spring-statemachine-starter + + + + org.springframework.boot + spring-boot-starter-test + test + + + + + + + org.springframework.statemachine + spring-statemachine-bom + ${spring-statemachine.version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + + + + + spring-snapshots + Spring Snapshots + https://repo.spring.io/snapshot + + true + + + + spring-milestones + Spring Milestones + https://repo.spring.io/milestone + + false + + + - - - spring-release - http://repo.spring.io/libs-release - false - - ---- [NOTE] ==== -Replace `1.0.0.BUILD-SNAPSHOT` with a version you want to use. +Replace `0.0.1-SNAPSHOT` with a version you want to use. ==== Having a normal project structure you'd build this with command: @@ -237,7 +261,7 @@ Having a normal project structure you'd build this with command: # mvn clean package ---- -Expected Spring Boot packaged fat-jar would be `target/gs-statemachine-0.1.0.jar`. +Expected Spring Boot packaged fat-jar would be `target/demo-0.0.1-SNAPSHOT.jar`. [NOTE] ====