mirror of
https://gitee.com/dcren/initializr.git
synced 2026-09-20 23:07:42 +08:00
Add version to pom and gradle build
This commit is contained in:
@@ -10,6 +10,9 @@ class MainController {
|
|||||||
@Value('${info.home:http://localhost:8080/}')
|
@Value('${info.home:http://localhost:8080/}')
|
||||||
private String home
|
private String home
|
||||||
|
|
||||||
|
@Value('${info.spring-boot.version:1.0.0.RELEASE}')
|
||||||
|
private String bootVersion
|
||||||
|
|
||||||
@Value('${TMPDIR:.}')
|
@Value('${TMPDIR:.}')
|
||||||
private String tmpdir
|
private String tmpdir
|
||||||
|
|
||||||
@@ -116,6 +119,7 @@ class MainController {
|
|||||||
@RequestMapping("/pom")
|
@RequestMapping("/pom")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
ResponseEntity<byte[]> pom(PomRequest request, Map model) {
|
ResponseEntity<byte[]> pom(PomRequest request, Map model) {
|
||||||
|
model.bootVersion = bootVersion
|
||||||
new ResponseEntity<byte[]>(render("starter-pom.xml", request, model), ["Content-Type":"application/octet-stream"] as HttpHeaders, HttpStatus.OK)
|
new ResponseEntity<byte[]>(render("starter-pom.xml", request, model), ["Content-Type":"application/octet-stream"] as HttpHeaders, HttpStatus.OK)
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -123,6 +127,7 @@ class MainController {
|
|||||||
@RequestMapping("/build")
|
@RequestMapping("/build")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
ResponseEntity<byte[]> gradle(PomRequest request, Map model) {
|
ResponseEntity<byte[]> gradle(PomRequest request, Map model) {
|
||||||
|
model.bootVersion = bootVersion
|
||||||
new ResponseEntity<byte[]>(render("starter-build.gradle", request, model), ["Content-Type":"application/octet-stream"] as HttpHeaders, HttpStatus.OK)
|
new ResponseEntity<byte[]>(render("starter-build.gradle", request, model), ["Content-Type":"application/octet-stream"] as HttpHeaders, HttpStatus.OK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
ext {
|
ext {
|
||||||
springBootVersion = '1.0.0.BUILD-SNAPSHOT'
|
springBootVersion = '${bootVersion}'
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>1.0.0.BUILD-SNAPSHOT</version>
|
<version>${bootVersion}</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies><% styles.each { %>
|
<dependencies><% styles.each { %>
|
||||||
|
|||||||
Reference in New Issue
Block a user